From 6f85a29d75929b1dd5dc4c051abd1e566d15dda1 Mon Sep 17 00:00:00 2001 From: Kilian Schulte Date: Thu, 14 Dec 2023 09:50:22 +0100 Subject: [PATCH] generate api outputs --- .../example/app/macos/Runner/messages.g.h | 25 +- .../example/app/macos/Runner/messages.g.m | 107 +- .../example/app/windows/runner/messages.g.cpp | 322 +- .../example/app/windows/runner/messages.g.h | 73 +- .../CoreTests.java | 61 + .../ios/Classes/CoreTests.gen.h | 434 +- .../ios/Classes/CoreTests.gen.m | 2647 +++---- .../macos/Classes/CoreTests.gen.h | 434 +- .../macos/Classes/CoreTests.gen.m | 2647 +++---- .../lib/src/generated/core_tests.gen.dart | 62 + .../com/example/test_plugin/CoreTests.gen.kt | 45 + .../ios/Classes/CoreTests.gen.swift | 46 + .../macos/Classes/CoreTests.gen.swift | 46 + .../windows/pigeon/core_tests.gen.cpp | 6345 +++++++---------- .../windows/pigeon/core_tests.gen.h | 636 +- 15 files changed, 6037 insertions(+), 7893 deletions(-) diff --git a/packages/pigeon/example/app/macos/Runner/messages.g.h b/packages/pigeon/example/app/macos/Runner/messages.g.h index bba1ff2deb07..ed2d74613e31 100644 --- a/packages/pigeon/example/app/macos/Runner/messages.g.h +++ b/packages/pigeon/example/app/macos/Runner/messages.g.h @@ -30,13 +30,13 @@ typedef NS_ENUM(NSUInteger, PGNCode) { /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithName:(nullable NSString *)name - description:(nullable NSString *)description - code:(PGNCode)code - data:(NSDictionary *)data; -@property(nonatomic, copy, nullable) NSString *name; -@property(nonatomic, copy, nullable) NSString *description; + description:(nullable NSString *)description + code:(PGNCode)code + data:(NSDictionary *)data; +@property(nonatomic, copy, nullable) NSString * name; +@property(nonatomic, copy, nullable) NSString * description; @property(nonatomic, assign) PGNCode code; -@property(nonatomic, copy) NSDictionary *data; +@property(nonatomic, copy) NSDictionary * data; @end /// The codec used by PGNExampleHostApi. @@ -46,23 +46,18 @@ NSObject *PGNExampleHostApiGetCodec(void); /// @return `nil` only when `error != nil`. - (nullable NSString *)getHostLanguageWithError:(FlutterError *_Nullable *_Nonnull)error; /// @return `nil` only when `error != nil`. -- (nullable NSNumber *)addNumber:(NSInteger)a - toNumber:(NSInteger)b - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)sendMessageMessage:(PGNMessageData *)message - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (nullable NSNumber *)addNumber:(NSInteger)a toNumber:(NSInteger)b error:(FlutterError *_Nullable *_Nonnull)error; +- (void)sendMessageMessage:(PGNMessageData *)message completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; @end -extern void SetUpPGNExampleHostApi(id binaryMessenger, - NSObject *_Nullable api); +extern void SetUpPGNExampleHostApi(id binaryMessenger, NSObject *_Nullable api); /// The codec used by PGNMessageFlutterApi. NSObject *PGNMessageFlutterApiGetCodec(void); @interface PGNMessageFlutterApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (void)flutterMethodAString:(nullable NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)flutterMethodAString:(nullable NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; @end NS_ASSUME_NONNULL_END diff --git a/packages/pigeon/example/app/macos/Runner/messages.g.m b/packages/pigeon/example/app/macos/Runner/messages.g.m index 90983b10cd22..68a0e5263998 100644 --- a/packages/pigeon/example/app/macos/Runner/messages.g.m +++ b/packages/pigeon/example/app/macos/Runner/messages.g.m @@ -26,12 +26,7 @@ } static FlutterError *createConnectionError(NSString *channelName) { - return [FlutterError - errorWithCode:@"channel-error" - message:[NSString stringWithFormat:@"%@/%@/%@", - @"Unable to establish connection on channel: '", - channelName, @"'."] - details:@""]; + return [FlutterError errorWithCode:@"channel-error" message:[NSString stringWithFormat:@"%@/%@/%@", @"Unable to establish connection on channel: '", channelName, @"'."] details:@""]; } static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { @@ -57,10 +52,10 @@ - (NSArray *)toList; @implementation PGNMessageData + (instancetype)makeWithName:(nullable NSString *)name - description:(nullable NSString *)description - code:(PGNCode)code - data:(NSDictionary *)data { - PGNMessageData *pigeonResult = [[PGNMessageData alloc] init]; + description:(nullable NSString *)description + code:(PGNCode)code + data:(NSDictionary *)data { + PGNMessageData* pigeonResult = [[PGNMessageData alloc] init]; pigeonResult.name = name; pigeonResult.description = description; pigeonResult.code = code; @@ -93,7 +88,7 @@ @interface PGNExampleHostApiCodecReader : FlutterStandardReader @implementation PGNExampleHostApiCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 128: + case 128: return [PGNMessageData fromList:[self readValue]]; default: return [super readValueOfType:type]; @@ -129,25 +124,21 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { static FlutterStandardMessageCodec *sSharedObject = nil; static dispatch_once_t sPred = 0; dispatch_once(&sPred, ^{ - PGNExampleHostApiCodecReaderWriter *readerWriter = - [[PGNExampleHostApiCodecReaderWriter alloc] init]; + PGNExampleHostApiCodecReaderWriter *readerWriter = [[PGNExampleHostApiCodecReaderWriter alloc] init]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; }); return sSharedObject; } -void SetUpPGNExampleHostApi(id binaryMessenger, - NSObject *api) { +void SetUpPGNExampleHostApi(id binaryMessenger, NSObject *api) { { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage" binaryMessenger:binaryMessenger - codec:PGNExampleHostApiGetCodec()]; + codec:PGNExampleHostApiGetCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(getHostLanguageWithError:)], - @"PGNExampleHostApi api (%@) doesn't respond to @selector(getHostLanguageWithError:)", - api); + NSCAssert([api respondsToSelector:@selector(getHostLanguageWithError:)], @"PGNExampleHostApi api (%@) doesn't respond to @selector(getHostLanguageWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; NSString *output = [api getHostLanguageWithError:&error]; @@ -158,15 +149,13 @@ void SetUpPGNExampleHostApi(id binaryMessenger, } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add" binaryMessenger:binaryMessenger - codec:PGNExampleHostApiGetCodec()]; + codec:PGNExampleHostApiGetCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(addNumber:toNumber:error:)], - @"PGNExampleHostApi api (%@) doesn't respond to @selector(addNumber:toNumber:error:)", - api); + NSCAssert([api respondsToSelector:@selector(addNumber:toNumber:error:)], @"PGNExampleHostApi api (%@) doesn't respond to @selector(addNumber:toNumber:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSInteger arg_a = [GetNullableObjectAtIndex(args, 0) integerValue]; @@ -180,22 +169,19 @@ void SetUpPGNExampleHostApi(id binaryMessenger, } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage" binaryMessenger:binaryMessenger - codec:PGNExampleHostApiGetCodec()]; + codec:PGNExampleHostApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(sendMessageMessage:completion:)], - @"PGNExampleHostApi api (%@) doesn't respond to " - @"@selector(sendMessageMessage:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(sendMessageMessage:completion:)], @"PGNExampleHostApi api (%@) doesn't respond to @selector(sendMessageMessage:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; PGNMessageData *arg_message = GetNullableObjectAtIndex(args, 0); - [api sendMessageMessage:arg_message - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api sendMessageMessage:arg_message completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -221,28 +207,25 @@ - (instancetype)initWithBinaryMessenger:(NSObject *)bina } return self; } -- (void)flutterMethodAString:(nullable NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod"; +- (void)flutterMethodAString:(nullable NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:PGNMessageFlutterApiGetCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:PGNMessageFlutterApiGetCodec()]; + [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } @end + diff --git a/packages/pigeon/example/app/windows/runner/messages.g.cpp b/packages/pigeon/example/app/windows/runner/messages.g.cpp index 4541b9d4f369..ecf41a4a2c07 100644 --- a/packages/pigeon/example/app/windows/runner/messages.g.cpp +++ b/packages/pigeon/example/app/windows/runner/messages.g.cpp @@ -25,25 +25,29 @@ using flutter::EncodableMap; using flutter::EncodableValue; FlutterError CreateConnectionError(const std::string channel_name) { - return FlutterError( - "channel-error", - "Unable to establish connection on channel: '" + channel_name + "'.", - EncodableValue("")); + return FlutterError( + "channel-error", + "Unable to establish connection on channel: '" + channel_name + "'.", + EncodableValue("")); } // MessageData -MessageData::MessageData(const Code& code, const EncodableMap& data) - : code_(code), data_(data) {} - -MessageData::MessageData(const std::string* name, - const std::string* description, const Code& code, - const EncodableMap& data) - : name_(name ? std::optional(*name) : std::nullopt), - description_(description ? std::optional(*description) - : std::nullopt), - code_(code), - data_(data) {} +MessageData::MessageData( + const Code& code, + const EncodableMap& data) + : code_(code), + data_(data) {} + +MessageData::MessageData( + const std::string* name, + const std::string* description, + const Code& code, + const EncodableMap& data) + : name_(name ? std::optional(*name) : std::nullopt), + description_(description ? std::optional(*description) : std::nullopt), + code_(code), + data_(data) {} const std::string* MessageData::name() const { return name_ ? &(*name_) : nullptr; @@ -53,43 +57,56 @@ void MessageData::set_name(const std::string_view* value_arg) { name_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void MessageData::set_name(std::string_view value_arg) { name_ = value_arg; } +void MessageData::set_name(std::string_view value_arg) { + name_ = value_arg; +} + const std::string* MessageData::description() const { return description_ ? &(*description_) : nullptr; } void MessageData::set_description(const std::string_view* value_arg) { - description_ = - value_arg ? std::optional(*value_arg) : std::nullopt; + description_ = value_arg ? std::optional(*value_arg) : std::nullopt; } void MessageData::set_description(std::string_view value_arg) { description_ = value_arg; } -const Code& MessageData::code() const { return code_; } -void MessageData::set_code(const Code& value_arg) { code_ = value_arg; } +const Code& MessageData::code() const { + return code_; +} -const EncodableMap& MessageData::data() const { return data_; } +void MessageData::set_code(const Code& value_arg) { + code_ = value_arg; +} + + +const EncodableMap& MessageData::data() const { + return data_; +} + +void MessageData::set_data(const EncodableMap& value_arg) { + data_ = value_arg; +} -void MessageData::set_data(const EncodableMap& value_arg) { data_ = value_arg; } EncodableList MessageData::ToEncodableList() const { EncodableList list; list.reserve(4); list.push_back(name_ ? EncodableValue(*name_) : EncodableValue()); - list.push_back(description_ ? EncodableValue(*description_) - : EncodableValue()); + list.push_back(description_ ? EncodableValue(*description_) : EncodableValue()); list.push_back(EncodableValue((int)code_)); list.push_back(EncodableValue(data_)); return list; } MessageData MessageData::FromEncodableList(const EncodableList& list) { - MessageData decoded((Code)(std::get(list[2])), - std::get(list[3])); + MessageData decoded( + (Code)(std::get(list[2])), + std::get(list[3])); auto& encodable_name = list[0]; if (!encodable_name.IsNull()) { decoded.set_name(std::get(encodable_name)); @@ -101,29 +118,27 @@ MessageData MessageData::FromEncodableList(const EncodableList& list) { return decoded; } + ExampleHostApiCodecSerializer::ExampleHostApiCodecSerializer() {} EncodableValue ExampleHostApiCodecSerializer::ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const { + uint8_t type, + flutter::ByteStreamReader* stream) const { switch (type) { case 128: - return CustomEncodableValue(MessageData::FromEncodableList( - std::get(ReadValue(stream)))); + return CustomEncodableValue(MessageData::FromEncodableList(std::get(ReadValue(stream)))); default: return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); } } void ExampleHostApiCodecSerializer::WriteValue( - const EncodableValue& value, flutter::ByteStreamWriter* stream) const { - if (const CustomEncodableValue* custom_value = - std::get_if(&value)) { + const EncodableValue& value, + flutter::ByteStreamWriter* stream) const { + if (const CustomEncodableValue* custom_value = std::get_if(&value)) { if (custom_value->type() == typeid(MessageData)) { stream->WriteByte(128); - WriteValue( - EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), - stream); + WriteValue(EncodableValue(std::any_cast(*custom_value).ToEncodableList()), stream); return; } } @@ -132,112 +147,93 @@ void ExampleHostApiCodecSerializer::WriteValue( /// The codec used by ExampleHostApi. const flutter::StandardMessageCodec& ExampleHostApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &ExampleHostApiCodecSerializer::GetInstance()); + return flutter::StandardMessageCodec::GetInstance(&ExampleHostApiCodecSerializer::GetInstance()); } -// Sets up an instance of `ExampleHostApi` to handle messages through the -// `binary_messenger`. -void ExampleHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, - ExampleHostApi* api) { +// Sets up an instance of `ExampleHostApi` to handle messages through the `binary_messenger`. +void ExampleHostApi::SetUp( + flutter::BinaryMessenger* binary_messenger, + ExampleHostApi* api) { { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi." - "getHostLanguage", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage", &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - ErrorOr output = api->GetHostLanguage(); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel->SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + ErrorOr output = api->GetHostLanguage(); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add", &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_arg = args.at(0); - if (encodable_a_arg.IsNull()) { - reply(WrapError("a_arg unexpectedly null.")); - return; - } - const int64_t a_arg = encodable_a_arg.LongValue(); - const auto& encodable_b_arg = args.at(1); - if (encodable_b_arg.IsNull()) { - reply(WrapError("b_arg unexpectedly null.")); - return; - } - const int64_t b_arg = encodable_b_arg.LongValue(); - ErrorOr output = api->Add(a_arg, b_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel->SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_arg = args.at(0); + if (encodable_a_arg.IsNull()) { + reply(WrapError("a_arg unexpectedly null.")); + return; + } + const int64_t a_arg = encodable_a_arg.LongValue(); + const auto& encodable_b_arg = args.at(1); + if (encodable_b_arg.IsNull()) { + reply(WrapError("b_arg unexpectedly null.")); + return; + } + const int64_t b_arg = encodable_b_arg.LongValue(); + ErrorOr output = api->Add(a_arg, b_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage", &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_message_arg = args.at(0); - if (encodable_message_arg.IsNull()) { - reply(WrapError("message_arg unexpectedly null.")); - return; - } - const auto& message_arg = std::any_cast( - std::get(encodable_message_arg)); - api->SendMessage(message_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel->SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_message_arg = args.at(0); + if (encodable_message_arg.IsNull()) { + reply(WrapError("message_arg unexpectedly null.")); + return; + } + const auto& message_arg = std::any_cast(std::get(encodable_message_arg)); + api->SendMessage(message_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel->SetMessageHandler(nullptr); } @@ -245,63 +241,53 @@ void ExampleHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } EncodableValue ExampleHostApi::WrapError(std::string_view error_message) { - return EncodableValue( - EncodableList{EncodableValue(std::string(error_message)), - EncodableValue("Error"), EncodableValue()}); + return EncodableValue(EncodableList{ + EncodableValue(std::string(error_message)), + EncodableValue("Error"), + EncodableValue() + }); } EncodableValue ExampleHostApi::WrapError(const FlutterError& error) { - return EncodableValue(EncodableList{EncodableValue(error.code()), - EncodableValue(error.message()), - error.details()}); + return EncodableValue(EncodableList{ + EncodableValue(error.code()), + EncodableValue(error.message()), + error.details() + }); } -// Generated class from Pigeon that represents Flutter messages that can be -// called from C++. +// Generated class from Pigeon that represents Flutter messages that can be called from C++. MessageFlutterApi::MessageFlutterApi(flutter::BinaryMessenger* binary_messenger) - : binary_messenger_(binary_messenger) {} + : binary_messenger_(binary_messenger) {} const flutter::StandardMessageCodec& MessageFlutterApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &flutter::StandardCodecSerializer::GetInstance()); + return flutter::StandardMessageCodec::GetInstance(&flutter::StandardCodecSerializer::GetInstance()); } void MessageFlutterApi::FlutterMethod( - const std::string* a_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi." - "flutterMethod"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + const std::string* a_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_string_arg ? EncodableValue(*a_string_arg) : EncodableValue(), + a_string_arg ? EncodableValue(*a_string_arg) : EncodableValue(), + }); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel->Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } } // namespace pigeon_example diff --git a/packages/pigeon/example/app/windows/runner/messages.g.h b/packages/pigeon/example/app/windows/runner/messages.g.h index 92ab57e3176e..9b8192fec9c5 100644 --- a/packages/pigeon/example/app/windows/runner/messages.g.h +++ b/packages/pigeon/example/app/windows/runner/messages.g.h @@ -17,16 +17,17 @@ namespace pigeon_example { + // Generated class from Pigeon. class FlutterError { public: - explicit FlutterError(const std::string& code) : code_(code) {} + explicit FlutterError(const std::string& code) + : code_(code) {} explicit FlutterError(const std::string& code, const std::string& message) - : code_(code), message_(message) {} - explicit FlutterError(const std::string& code, const std::string& message, - const flutter::EncodableValue& details) - : code_(code), message_(message), details_(details) {} + : code_(code), message_(message) {} + explicit FlutterError(const std::string& code, const std::string& message, const flutter::EncodableValue& details) + : code_(code), message_(message), details_(details) {} const std::string& code() const { return code_; } const std::string& message() const { return message_; } @@ -38,8 +39,7 @@ class FlutterError { flutter::EncodableValue details_; }; -template -class ErrorOr { +template class ErrorOr { public: ErrorOr(const T& rhs) : v_(rhs) {} ErrorOr(const T&& rhs) : v_(std::move(rhs)) {} @@ -59,17 +59,26 @@ class ErrorOr { std::variant v_; }; -enum class Code { one = 0, two = 1 }; + +enum class Code { + one = 0, + two = 1 +}; // Generated class from Pigeon that represents data sent in messages. class MessageData { public: // Constructs an object setting all non-nullable fields. - explicit MessageData(const Code& code, const flutter::EncodableMap& data); + explicit MessageData( + const Code& code, + const flutter::EncodableMap& data); // Constructs an object setting all fields. - explicit MessageData(const std::string* name, const std::string* description, - const Code& code, const flutter::EncodableMap& data); + explicit MessageData( + const std::string* name, + const std::string* description, + const Code& code, + const flutter::EncodableMap& data); const std::string* name() const; void set_name(const std::string_view* value_arg); @@ -85,6 +94,7 @@ class MessageData { const flutter::EncodableMap& data() const; void set_data(const flutter::EncodableMap& value_arg); + private: static MessageData FromEncodableList(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -96,6 +106,7 @@ class MessageData { std::optional description_; Code code_; flutter::EncodableMap data_; + }; class ExampleHostApiCodecSerializer : public flutter::StandardCodecSerializer { @@ -106,47 +117,53 @@ class ExampleHostApiCodecSerializer : public flutter::StandardCodecSerializer { return sInstance; } - void WriteValue(const flutter::EncodableValue& value, - flutter::ByteStreamWriter* stream) const override; + void WriteValue( + const flutter::EncodableValue& value, + flutter::ByteStreamWriter* stream) const override; protected: flutter::EncodableValue ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const override; + uint8_t type, + flutter::ByteStreamReader* stream) const override; + }; -// Generated interface from Pigeon that represents a handler of messages from -// Flutter. +// Generated interface from Pigeon that represents a handler of messages from Flutter. class ExampleHostApi { public: ExampleHostApi(const ExampleHostApi&) = delete; ExampleHostApi& operator=(const ExampleHostApi&) = delete; virtual ~ExampleHostApi() {} virtual ErrorOr GetHostLanguage() = 0; - virtual ErrorOr Add(int64_t a, int64_t b) = 0; - virtual void SendMessage(const MessageData& message, - std::function reply)> result) = 0; + virtual ErrorOr Add( + int64_t a, + int64_t b) = 0; + virtual void SendMessage( + const MessageData& message, + std::function reply)> result) = 0; // The codec used by ExampleHostApi. static const flutter::StandardMessageCodec& GetCodec(); - // Sets up an instance of `ExampleHostApi` to handle messages through the - // `binary_messenger`. - static void SetUp(flutter::BinaryMessenger* binary_messenger, - ExampleHostApi* api); + // Sets up an instance of `ExampleHostApi` to handle messages through the `binary_messenger`. + static void SetUp( + flutter::BinaryMessenger* binary_messenger, + ExampleHostApi* api); static flutter::EncodableValue WrapError(std::string_view error_message); static flutter::EncodableValue WrapError(const FlutterError& error); protected: ExampleHostApi() = default; + }; -// Generated class from Pigeon that represents Flutter messages that can be -// called from C++. +// Generated class from Pigeon that represents Flutter messages that can be called from C++. class MessageFlutterApi { public: MessageFlutterApi(flutter::BinaryMessenger* binary_messenger); static const flutter::StandardMessageCodec& GetCodec(); - void FlutterMethod(const std::string* a_string, - std::function&& on_success, - std::function&& on_error); + void FlutterMethod( + const std::string* a_string, + std::function&& on_success, + std::function&& on_error); private: flutter::BinaryMessenger* binary_messenger_; diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java index b6a72835e4ac..d00e996f47a7 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 @@ -4020,6 +4020,39 @@ public void echoEnum(@NonNull AnEnum anEnumArg, @NonNull Result result) } }); } + /** Returns the default string. */ + public void echoNamedDefaultString(@NonNull String aStringArg, @NonNull Result result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNamedDefaultString"; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList(Collections.singletonList(aStringArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + String output = (String) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } /** Returns the passed boolean, to test serialization and deserialization. */ public void echoNullableBool( @Nullable Boolean aBoolArg, @NonNull NullableResult result) { @@ -4247,6 +4280,34 @@ public void echoNullableEnum( } }); } + /** Returns the passed in string. */ + public void echoNamedNullableString( + @Nullable String aNullableStringArg, @NonNull NullableResult result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNamedNullableString"; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList(Collections.singletonList(aNullableStringArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); + } else { + @SuppressWarnings("ConstantConditions") + String output = (String) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } /** * A no-op function taking no arguments and returning no value, to sanity test basic * asynchronous calling. 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 782c3794a13b..4f8377e52bfc 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, do not edit directly. // See also: https://pub.dev/packages/pigeon @@ -35,70 +35,68 @@ typedef NS_ENUM(NSUInteger, AnEnum) { @interface AllTypes : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithABool:(BOOL)aBool - anInt:(NSInteger)anInt - anInt64:(NSInteger)anInt64 - aDouble:(double)aDouble - aByteArray:(FlutterStandardTypedData *)aByteArray - a4ByteArray:(FlutterStandardTypedData *)a4ByteArray - a8ByteArray:(FlutterStandardTypedData *)a8ByteArray - aFloatArray:(FlutterStandardTypedData *)aFloatArray - aList:(NSArray *)aList - aMap:(NSDictionary *)aMap - anEnum:(AnEnum)anEnum - aString:(NSString *)aString - anObject:(id)anObject; -@property(nonatomic, assign) BOOL aBool; -@property(nonatomic, assign) NSInteger anInt; -@property(nonatomic, assign) NSInteger anInt64; -@property(nonatomic, assign) double aDouble; -@property(nonatomic, strong) FlutterStandardTypedData *aByteArray; -@property(nonatomic, strong) FlutterStandardTypedData *a4ByteArray; -@property(nonatomic, strong) FlutterStandardTypedData *a8ByteArray; -@property(nonatomic, strong) FlutterStandardTypedData *aFloatArray; -@property(nonatomic, copy) NSArray *aList; -@property(nonatomic, copy) NSDictionary *aMap; ++ (instancetype)makeWithABool:(BOOL )aBool + anInt:(NSInteger )anInt + anInt64:(NSInteger )anInt64 + aDouble:(double )aDouble + aByteArray:(FlutterStandardTypedData *)aByteArray + a4ByteArray:(FlutterStandardTypedData *)a4ByteArray + a8ByteArray:(FlutterStandardTypedData *)a8ByteArray + aFloatArray:(FlutterStandardTypedData *)aFloatArray + aList:(NSArray *)aList + aMap:(NSDictionary *)aMap + anEnum:(AnEnum)anEnum + aString:(NSString *)aString + anObject:(id )anObject; +@property(nonatomic, assign) BOOL aBool; +@property(nonatomic, assign) NSInteger anInt; +@property(nonatomic, assign) NSInteger anInt64; +@property(nonatomic, assign) double aDouble; +@property(nonatomic, strong) FlutterStandardTypedData * aByteArray; +@property(nonatomic, strong) FlutterStandardTypedData * a4ByteArray; +@property(nonatomic, strong) FlutterStandardTypedData * a8ByteArray; +@property(nonatomic, strong) FlutterStandardTypedData * aFloatArray; +@property(nonatomic, copy) NSArray * aList; +@property(nonatomic, copy) NSDictionary * aMap; @property(nonatomic, assign) AnEnum anEnum; -@property(nonatomic, copy) NSString *aString; -@property(nonatomic, strong) id anObject; +@property(nonatomic, copy) NSString * aString; +@property(nonatomic, strong) id anObject; @end /// A class containing all supported nullable types. @interface AllNullableTypes : NSObject + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - aNullableList:(nullable NSArray *)aNullableList - aNullableMap:(nullable NSDictionary *)aNullableMap - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable AnEnumBox *)aNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject; -@property(nonatomic, strong, nullable) NSNumber *aNullableBool; -@property(nonatomic, strong, nullable) NSNumber *aNullableInt; -@property(nonatomic, strong, nullable) NSNumber *aNullableInt64; -@property(nonatomic, strong, nullable) NSNumber *aNullableDouble; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable4ByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable8ByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableFloatArray; -@property(nonatomic, copy, nullable) NSArray *aNullableList; -@property(nonatomic, copy, nullable) NSDictionary *aNullableMap; -@property(nonatomic, copy, nullable) NSArray *> *nullableNestedList; -@property(nonatomic, copy, nullable) - NSDictionary *nullableMapWithAnnotations; -@property(nonatomic, copy, nullable) NSDictionary *nullableMapWithObject; -@property(nonatomic, strong, nullable) AnEnumBox *aNullableEnum; -@property(nonatomic, copy, nullable) NSString *aNullableString; -@property(nonatomic, strong, nullable) id aNullableObject; + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + aNullableList:(nullable NSArray *)aNullableList + aNullableMap:(nullable NSDictionary *)aNullableMap + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations:(nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(nullable AnEnumBox *)aNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id )aNullableObject; +@property(nonatomic, strong, nullable) NSNumber * aNullableBool; +@property(nonatomic, strong, nullable) NSNumber * aNullableInt; +@property(nonatomic, strong, nullable) NSNumber * aNullableInt64; +@property(nonatomic, strong, nullable) NSNumber * aNullableDouble; +@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullableByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullable4ByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullable8ByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullableFloatArray; +@property(nonatomic, copy, nullable) NSArray * aNullableList; +@property(nonatomic, copy, nullable) NSDictionary * aNullableMap; +@property(nonatomic, copy, nullable) NSArray *> * nullableNestedList; +@property(nonatomic, copy, nullable) NSDictionary * nullableMapWithAnnotations; +@property(nonatomic, copy, nullable) NSDictionary * nullableMapWithObject; +@property(nonatomic, strong, nullable) AnEnumBox * aNullableEnum; +@property(nonatomic, copy, nullable) NSString * aNullableString; +@property(nonatomic, strong, nullable) id aNullableObject; @end /// A class for testing nested class handling. @@ -110,15 +108,15 @@ typedef NS_ENUM(NSUInteger, AnEnum) { /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithAllNullableTypes:(AllNullableTypes *)allNullableTypes - allTypes:(nullable AllTypes *)allTypes; -@property(nonatomic, strong) AllNullableTypes *allNullableTypes; -@property(nonatomic, strong, nullable) AllTypes *allTypes; + allTypes:(nullable AllTypes *)allTypes; +@property(nonatomic, strong) AllNullableTypes * allNullableTypes; +@property(nonatomic, strong, nullable) AllTypes * allTypes; @end /// A data class containing a List, used in unit tests. @interface TestMessage : NSObject + (instancetype)makeWithTestList:(nullable NSArray *)testList; -@property(nonatomic, copy, nullable) NSArray *testList; +@property(nonatomic, copy, nullable) NSArray * testList; @end /// The codec used by HostIntegrationCoreApi. @@ -133,8 +131,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; /// Returns an error from a void function, to test error handling. @@ -156,13 +153,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`. @@ -170,18 +165,15 @@ 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 map to test nested class serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable AllClassesWrapper *)echoClassWrapper:(AllClassesWrapper *)wrapper - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable AllClassesWrapper *)echoClassWrapper:(AllClassesWrapper *)wrapper error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed enum to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. @@ -189,209 +181,124 @@ NSObject *HostIntegrationCoreApiGetCodec(void); /// Returns the default string. /// /// @return `nil` only when `error != nil`. -- (nullable NSString *)echoNamedDefaultString:(NSString *)aString - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)echoNamedDefaultString:(NSString *)aString error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in double. /// /// @return `nil` only when `error != nil`. -- (nullable NSNumber *)echoOptionalDefaultDouble:(double)aDouble - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoOptionalDefaultDouble:(double)aDouble error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in int. /// /// @return `nil` only when `error != nil`. -- (nullable NSNumber *)echoRequiredInt:(NSInteger)anInt - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoRequiredInt:(NSInteger)anInt error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed object, to test serialization and deserialization. -- (nullable AllNullableTypes *)echoAllNullableTypes:(nullable AllNullableTypes *)everything - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable AllNullableTypes *)echoAllNullableTypes:(nullable AllNullableTypes *)everything error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. -- (nullable NSString *)extractNestedNullableStringFrom:(AllClassesWrapper *)wrapper - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)extractNestedNullableStringFrom:(AllClassesWrapper *)wrapper error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. /// /// @return `nil` only when `error != nil`. -- (nullable AllClassesWrapper *) - createNestedObjectWithNullableString:(nullable NSString *)nullableString - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable AllClassesWrapper *)createNestedObjectWithNullableString:(nullable NSString *)nullableString error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in arguments of multiple types. /// /// @return `nil` only when `error != nil`. -- (nullable AllNullableTypes *)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - error:(FlutterError *_Nullable *_Nonnull) - error; +- (nullable AllNullableTypes *)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in int. -- (nullable NSNumber *)echoNullableInt:(nullable NSNumber *)aNullableInt - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoNullableInt:(nullable NSNumber *)aNullableInt error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in double. -- (nullable NSNumber *)echoNullableDouble:(nullable NSNumber *)aNullableDouble - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoNullableDouble:(nullable NSNumber *)aNullableDouble error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in boolean. -- (nullable NSNumber *)echoNullableBool:(nullable NSNumber *)aNullableBool - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoNullableBool:(nullable NSNumber *)aNullableBool error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in string. -- (nullable NSString *)echoNullableString:(nullable NSString *)aNullableString - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)echoNullableString:(nullable NSString *)aNullableString error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in Uint8List. -- (nullable FlutterStandardTypedData *) - echoNullableUint8List:(nullable FlutterStandardTypedData *)aNullableUint8List - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FlutterStandardTypedData *)echoNullableUint8List:(nullable FlutterStandardTypedData *)aNullableUint8List error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in generic Object. -- (nullable id)echoNullableObject:(nullable id)aNullableObject - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable id)echoNullableObject:(nullable id)aNullableObject error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed list, to test serialization and deserialization. -- (nullable NSArray *)echoNullableList:(nullable NSArray *)aNullableList - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSArray *)echoNullableList:(nullable NSArray *)aNullableList error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed map, to test serialization and deserialization. -- (nullable NSDictionary *)echoNullableMap: - (nullable NSDictionary *)aNullableMap - error:(FlutterError *_Nullable *_Nonnull)error; -- (AnEnumBox *_Nullable)echoNullableEnum:(nullable AnEnumBox *)anEnumBoxed - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSDictionary *)echoNullableMap:(nullable NSDictionary *)aNullableMap error:(FlutterError *_Nullable *_Nonnull)error; +- (AnEnumBox *_Nullable)echoNullableEnum:(nullable AnEnumBox *)anEnumBoxed error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in int. -- (nullable NSNumber *)echoOptionalNullableInt:(nullable NSNumber *)aNullableInt - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoOptionalNullableInt:(nullable NSNumber *)aNullableInt error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in string. -- (nullable NSString *)echoNamedNullableString:(nullable NSString *)aNullableString - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)echoNamedNullableString:(nullable NSString *)aNullableString error:(FlutterError *_Nullable *_Nonnull)error; /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. - (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion; /// Returns passed in int asynchronously. -- (void)echoAsyncInt:(NSInteger)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncInt:(NSInteger)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in double asynchronously. -- (void)echoAsyncDouble:(double)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncDouble:(double)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in boolean asynchronously. -- (void)echoAsyncBool:(BOOL)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncBool:(BOOL)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed string asynchronously. -- (void)echoAsyncString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in Uint8List asynchronously. -- (void)echoAsyncUint8List:(FlutterStandardTypedData *)aUint8List - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncUint8List:(FlutterStandardTypedData *)aUint8List completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in generic Object asynchronously. -- (void)echoAsyncObject:(id)anObject - completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncObject:(id)anObject completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; /// Returns the passed list, to test asynchronous serialization and deserialization. -- (void)echoAsyncList:(NSArray *)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 asynchronous serialization and deserialization. -- (void)echoAsyncMap:(NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncMap:(NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed enum, to test asynchronous serialization and deserialization. -- (void)echoAsyncEnum:(AnEnum)anEnum - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncEnum:(AnEnum)anEnum completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; /// Responds with an error from an async function returning a value. - (void)throwAsyncErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; /// Responds with an error from an async void function. - (void)throwAsyncErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; /// Responds with a Flutter error from an async function returning a value. -- (void)throwAsyncFlutterErrorWithCompletion:(void (^)(id _Nullable, - FlutterError *_Nullable))completion; +- (void)throwAsyncFlutterErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; /// Returns the passed object, to test async serialization and deserialization. -- (void)echoAsyncAllTypes:(AllTypes *)everything - completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncAllTypes:(AllTypes *)everything completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAsyncNullableAllNullableTypes:(nullable AllNullableTypes *)everything - completion:(void (^)(AllNullableTypes *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncNullableAllNullableTypes:(nullable AllNullableTypes *)everything completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in int asynchronously. -- (void)echoAsyncNullableInt:(nullable NSNumber *)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableInt:(nullable NSNumber *)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in double asynchronously. -- (void)echoAsyncNullableDouble:(nullable NSNumber *)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableDouble:(nullable NSNumber *)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in boolean asynchronously. -- (void)echoAsyncNullableBool:(nullable NSNumber *)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableBool:(nullable NSNumber *)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed string asynchronously. -- (void)echoAsyncNullableString:(nullable NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableString:(nullable NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in Uint8List asynchronously. -- (void)echoAsyncNullableUint8List:(nullable FlutterStandardTypedData *)aUint8List - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncNullableUint8List:(nullable FlutterStandardTypedData *)aUint8List completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in generic Object asynchronously. -- (void)echoAsyncNullableObject:(nullable id)anObject - completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableObject:(nullable id)anObject completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; /// Returns the passed list, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableList:(nullable NSArray *)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 asynchronous serialization and deserialization. -- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed enum, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableEnum:(nullable AnEnumBox *)anEnumBoxed - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableEnum:(nullable AnEnumBox *)anEnumBoxed completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; - (void)callFlutterNoopWithCompletion:(void (^)(FlutterError *_Nullable))completion; -- (void)callFlutterThrowErrorWithCompletion:(void (^)(id _Nullable, - FlutterError *_Nullable))completion; +- (void)callFlutterThrowErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; - (void)callFlutterThrowErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; -- (void)callFlutterEchoAllTypes:(AllTypes *)everything - completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoAllNullableTypes:(nullable AllNullableTypes *)everything - completion:(void (^)(AllNullableTypes *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterSendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - completion:(void (^)(AllNullableTypes *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoBool:(BOOL)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoInt:(NSInteger)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoDouble:(double)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoUint8List:(FlutterStandardTypedData *)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)callFlutterEchoEnum:(AnEnum)anEnum - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableBool:(nullable NSNumber *)aBool - completion: - (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableInt:(nullable NSNumber *)anInt - completion: - (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableDouble:(nullable NSNumber *)aDouble - completion: - (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableString:(nullable NSString *)aString - completion: - (void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableUint8List:(nullable FlutterStandardTypedData *)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)callFlutterEchoNullableEnum:(nullable AnEnumBox *)anEnumBoxed - completion: - (void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoAllTypes:(AllTypes *)everything completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoAllNullableTypes:(nullable AllNullableTypes *)everything completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterSendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoBool:(BOOL)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoInt:(NSInteger)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoDouble:(double)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoUint8List:(FlutterStandardTypedData *)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)callFlutterEchoEnum:(AnEnum)anEnum completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableBool:(nullable NSNumber *)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableInt:(nullable NSNumber *)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableDouble:(nullable NSNumber *)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableString:(nullable NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableUint8List:(nullable FlutterStandardTypedData *)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)callFlutterEchoNullableEnum:(nullable AnEnumBox *)anEnumBoxed completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; @end -extern void SetUpHostIntegrationCoreApi(id binaryMessenger, - NSObject *_Nullable api); +extern void SetUpHostIntegrationCoreApi(id binaryMessenger, NSObject *_Nullable api); /// The codec used by FlutterIntegrationCoreApi. NSObject *FlutterIntegrationCoreApiGetCodec(void); @@ -408,78 +315,54 @@ 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:(nullable AllNullableTypes *)everything - completion: - (void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAllNullableTypes:(nullable AllNullableTypes *)everything completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. -- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - completion:(void (^)(AllNullableTypes *_Nullable, - FlutterError *_Nullable))completion; +- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed boolean, to test serialization and deserialization. -- (void)echoBool:(BOOL)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoBool:(BOOL)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed int, to test serialization and deserialization. -- (void)echoInt:(NSInteger)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoInt:(NSInteger)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed double, to test serialization and deserialization. -- (void)echoDouble:(double)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoDouble:(double)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed string, to test serialization and deserialization. -- (void)echoString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed byte list, to test serialization and deserialization. -- (void)echoUint8List:(FlutterStandardTypedData *)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 enum to test serialization and deserialization. -- (void)echoEnum:(AnEnum)anEnum - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoEnum:(AnEnum)anEnum completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +/// Returns the default string. +- (void)echoNamedDefaultString:(NSString *)aString completion:(void (^)(NSString *_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; /// Returns the passed enum to test serialization and deserialization. -- (void)echoNullableEnum:(nullable AnEnumBox *)anEnumBoxed - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableEnum:(nullable AnEnumBox *)anEnumBoxed completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed in string. +- (void)echoNamedNullableString:(nullable NSString *)aNullableString completion:(void (^)(NSString *_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. @@ -490,21 +373,18 @@ NSObject *HostTrivialApiGetCodec(void); - (void)noopWithError:(FlutterError *_Nullable *_Nonnull)error; @end -extern void SetUpHostTrivialApi(id binaryMessenger, - NSObject *_Nullable api); +extern void SetUpHostTrivialApi(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 SetUpHostSmallApi(id binaryMessenger, - NSObject *_Nullable api); +extern void SetUpHostSmallApi(id binaryMessenger, NSObject *_Nullable api); /// The codec used by FlutterSmallApi. NSObject *FlutterSmallApiGetCodec(void); @@ -512,10 +392,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)echoString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoWrappedList:(TestMessage *)msg completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion; +- (void)echoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; @end NS_ASSUME_NONNULL_END diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m index 0cc5b059c04f..664facc2ae15 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, do not edit directly. // See also: https://pub.dev/packages/pigeon @@ -27,12 +27,7 @@ } static FlutterError *createConnectionError(NSString *channelName) { - return [FlutterError - errorWithCode:@"channel-error" - message:[NSString stringWithFormat:@"%@/%@/%@", - @"Unable to establish connection on channel: '", - channelName, @"'."] - details:@""]; + return [FlutterError errorWithCode:@"channel-error" message:[NSString stringWithFormat:@"%@/%@/%@", @"Unable to establish connection on channel: '", channelName, @"'."] details:@""]; } static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { @@ -75,20 +70,20 @@ - (NSArray *)toList; @end @implementation AllTypes -+ (instancetype)makeWithABool:(BOOL)aBool - anInt:(NSInteger)anInt - anInt64:(NSInteger)anInt64 - aDouble:(double)aDouble - aByteArray:(FlutterStandardTypedData *)aByteArray - a4ByteArray:(FlutterStandardTypedData *)a4ByteArray - a8ByteArray:(FlutterStandardTypedData *)a8ByteArray - aFloatArray:(FlutterStandardTypedData *)aFloatArray - aList:(NSArray *)aList - aMap:(NSDictionary *)aMap - anEnum:(AnEnum)anEnum - aString:(NSString *)aString - anObject:(id)anObject { - AllTypes *pigeonResult = [[AllTypes alloc] init]; ++ (instancetype)makeWithABool:(BOOL )aBool + anInt:(NSInteger )anInt + anInt64:(NSInteger )anInt64 + aDouble:(double )aDouble + aByteArray:(FlutterStandardTypedData *)aByteArray + a4ByteArray:(FlutterStandardTypedData *)a4ByteArray + a8ByteArray:(FlutterStandardTypedData *)a8ByteArray + aFloatArray:(FlutterStandardTypedData *)aFloatArray + aList:(NSArray *)aList + aMap:(NSDictionary *)aMap + anEnum:(AnEnum)anEnum + aString:(NSString *)aString + anObject:(id )anObject { + AllTypes* pigeonResult = [[AllTypes alloc] init]; pigeonResult.aBool = aBool; pigeonResult.anInt = anInt; pigeonResult.anInt64 = anInt64; @@ -145,23 +140,22 @@ - (NSArray *)toList { @implementation AllNullableTypes + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - aNullableList:(nullable NSArray *)aNullableList - aNullableMap:(nullable NSDictionary *)aNullableMap - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable AnEnumBox *)aNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject { - AllNullableTypes *pigeonResult = [[AllNullableTypes alloc] init]; + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + aNullableList:(nullable NSArray *)aNullableList + aNullableMap:(nullable NSDictionary *)aNullableMap + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations:(nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(nullable AnEnumBox *)aNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id )aNullableObject { + AllNullableTypes* pigeonResult = [[AllNullableTypes alloc] init]; pigeonResult.aNullableBool = aNullableBool; pigeonResult.aNullableInt = aNullableInt; pigeonResult.aNullableInt64 = aNullableInt64; @@ -196,10 +190,7 @@ + (AllNullableTypes *)fromList:(NSArray *)list { pigeonResult.nullableMapWithAnnotations = GetNullableObjectAtIndex(list, 11); pigeonResult.nullableMapWithObject = GetNullableObjectAtIndex(list, 12); NSNumber *aNullableEnumAsNumber = GetNullableObjectAtIndex(list, 13); - AnEnumBox *aNullableEnum = - aNullableEnumAsNumber == nil - ? nil - : [[AnEnumBox alloc] initWithValue:[aNullableEnumAsNumber integerValue]]; + AnEnumBox *aNullableEnum = aNullableEnumAsNumber == nil ? nil : [[AnEnumBox alloc] initWithValue:[aNullableEnumAsNumber integerValue]]; pigeonResult.aNullableEnum = aNullableEnum; pigeonResult.aNullableString = GetNullableObjectAtIndex(list, 14); pigeonResult.aNullableObject = GetNullableObjectAtIndex(list, 15); @@ -223,8 +214,7 @@ - (NSArray *)toList { self.nullableNestedList ?: [NSNull null], self.nullableMapWithAnnotations ?: [NSNull null], self.nullableMapWithObject ?: [NSNull null], - (self.aNullableEnum == nil ? [NSNull null] - : [NSNumber numberWithInteger:self.aNullableEnum.value]), + (self.aNullableEnum == nil ? [NSNull null] : [NSNumber numberWithInteger:self.aNullableEnum.value]), self.aNullableString ?: [NSNull null], self.aNullableObject ?: [NSNull null], ]; @@ -233,16 +223,15 @@ - (NSArray *)toList { @implementation AllClassesWrapper + (instancetype)makeWithAllNullableTypes:(AllNullableTypes *)allNullableTypes - allTypes:(nullable AllTypes *)allTypes { - AllClassesWrapper *pigeonResult = [[AllClassesWrapper alloc] init]; + allTypes:(nullable AllTypes *)allTypes { + AllClassesWrapper* pigeonResult = [[AllClassesWrapper alloc] init]; pigeonResult.allNullableTypes = allNullableTypes; pigeonResult.allTypes = allTypes; return pigeonResult; } + (AllClassesWrapper *)fromList:(NSArray *)list { AllClassesWrapper *pigeonResult = [[AllClassesWrapper alloc] init]; - pigeonResult.allNullableTypes = - [AllNullableTypes nullableFromList:(GetNullableObjectAtIndex(list, 0))]; + pigeonResult.allNullableTypes = [AllNullableTypes nullableFromList:(GetNullableObjectAtIndex(list, 0))]; pigeonResult.allTypes = [AllTypes nullableFromList:(GetNullableObjectAtIndex(list, 1))]; return pigeonResult; } @@ -259,7 +248,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; } @@ -283,13 +272,13 @@ @interface HostIntegrationCoreApiCodecReader : FlutterStandardReader @implementation HostIntegrationCoreApiCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 128: + case 128: return [AllClassesWrapper fromList:[self readValue]]; - case 129: + case 129: return [AllNullableTypes 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]; @@ -334,26 +323,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 SetUpHostIntegrationCoreApi(id binaryMessenger, - NSObject *api) { +void SetUpHostIntegrationCoreApi(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.pigeon_integration_tests.HostIntegrationCoreApi.noop" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -365,16 +351,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -388,16 +371,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns an error, to test error handling. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -409,16 +389,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns an error from a void function, to test error handling. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"throwErrorFromVoid" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -430,16 +407,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns a Flutter error, to test error handling. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"throwFlutterError" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwFlutterErrorWithError:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwFlutterErrorWithError:)", - api); + NSCAssert([api respondsToSelector:@selector(throwFlutterErrorWithError:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(throwFlutterErrorWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; id output = [api throwFlutterErrorWithError:&error]; @@ -451,15 +425,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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; NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; @@ -473,15 +445,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns passed in double. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; @@ -495,15 +465,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in boolean. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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; BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; @@ -517,15 +485,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in string. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -539,16 +505,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in Uint8List. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -562,15 +525,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in generic Object. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -584,15 +545,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed list, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -606,15 +565,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed map, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -628,16 +585,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed map to test nested class serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoClassWrapper" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoClassWrapper:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoClassWrapper:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoClassWrapper:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoClassWrapper:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllClassesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); @@ -651,20 +605,18 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed enum to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoEnum:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoEnum:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoEnum:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoEnum:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AnEnum arg_anEnum = [GetNullableObjectAtIndex(args, 0) integerValue]; FlutterError *error; - AnEnumBox *enumBox = [api echoEnum:arg_anEnum error:&error]; + AnEnumBox * enumBox = [api echoEnum:arg_anEnum error:&error]; NSNumber *output = enumBox == nil ? nil : [NSNumber numberWithInteger:enumBox.value]; callback(wrapResult(output, error)); }]; @@ -674,16 +626,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the default string. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoNamedDefaultString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNamedDefaultString:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNamedDefaultString:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNamedDefaultString:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNamedDefaultString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); @@ -697,16 +646,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns passed in double. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoOptionalDefaultDouble" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoOptionalDefaultDouble:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoOptionalDefaultDouble:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoOptionalDefaultDouble:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoOptionalDefaultDouble:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; @@ -720,16 +666,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoRequiredInt:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoRequiredInt:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoRequiredInt:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoRequiredInt:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; @@ -743,16 +686,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAllNullableTypes" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -767,16 +707,13 @@ void SetUpHostIntegrationCoreApi(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.pigeon_integration_tests.HostIntegrationCoreApi." - @"extractNestedNullableString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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; AllClassesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); @@ -791,22 +728,18 @@ void SetUpHostIntegrationCoreApi(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.pigeon_integration_tests.HostIntegrationCoreApi." - @"createNestedNullableString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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; - AllClassesWrapper *output = [api createNestedObjectWithNullableString:arg_nullableString - error:&error]; + AllClassesWrapper *output = [api createNestedObjectWithNullableString:arg_nullableString error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -815,27 +748,20 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns passed in arguments of multiple types. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"sendMultipleNullableTypes" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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 { @@ -844,16 +770,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -867,16 +790,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns passed in double. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoNullableDouble" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -890,16 +810,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in boolean. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoNullableBool" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -913,16 +830,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in string. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoNullableString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -936,22 +850,18 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in Uint8List. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoNullableUint8List" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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 { @@ -960,16 +870,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in generic Object. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoNullableObject" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -983,16 +890,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed list, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoNullableList" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -1006,16 +910,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed map, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -1028,25 +929,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoNullableEnum" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoNullableEnum:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableEnum:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNullableEnum:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableEnum:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_anEnumAsNumber = GetNullableObjectAtIndex(args, 0); - AnEnumBox *arg_anEnum = - arg_anEnumAsNumber == nil - ? nil - : [[AnEnumBox alloc] initWithValue:[arg_anEnumAsNumber integerValue]]; + AnEnumBox *arg_anEnum = arg_anEnumAsNumber == nil ? nil : [[AnEnumBox alloc] initWithValue:[arg_anEnumAsNumber integerValue]]; FlutterError *error; - AnEnumBox *enumBox = [api echoNullableEnum:arg_anEnum error:&error]; + AnEnumBox * enumBox = [api echoNullableEnum:arg_anEnum error:&error]; NSNumber *output = enumBox == nil ? nil : [NSNumber numberWithInteger:enumBox.value]; callback(wrapResult(output, error)); }]; @@ -1056,16 +951,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoOptionalNullableInt" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoOptionalNullableInt:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoOptionalNullableInt:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoOptionalNullableInt:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoOptionalNullableInt:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 0); @@ -1079,16 +971,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in string. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoNamedNullableString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNamedNullableString:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNamedNullableString:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNamedNullableString:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNamedNullableString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 0); @@ -1103,16 +992,13 @@ void SetUpHostIntegrationCoreApi(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.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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)); @@ -1124,23 +1010,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns passed in int asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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; NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; - [api echoAsyncInt:arg_anInt - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncInt:arg_anInt completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1148,23 +1030,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns passed in double asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; - [api echoAsyncDouble:arg_aDouble - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncDouble:arg_aDouble completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1172,23 +1050,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in boolean asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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; BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; - [api echoAsyncBool:arg_aBool - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncBool:arg_aBool completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1196,23 +1070,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed string asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1220,24 +1090,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in Uint8List asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAsyncUint8List" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1245,23 +1110,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in generic Object asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1269,23 +1130,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed list, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1293,24 +1150,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed map, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1318,25 +1170,20 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed enum, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncEnum:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncEnum:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncEnum:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncEnum:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AnEnum arg_anEnum = [GetNullableObjectAtIndex(args, 0) integerValue]; - [api echoAsyncEnum:arg_anEnum - completion:^(AnEnumBox *_Nullable enumValue, FlutterError *_Nullable error) { - NSNumber *output = - enumValue == nil ? nil : [NSNumber numberWithInteger:enumValue.value]; - callback(wrapResult(output, error)); - }]; + [api echoAsyncEnum:arg_anEnum completion:^(AnEnumBox *_Nullable enumValue, FlutterError *_Nullable error) { + NSNumber *output = enumValue == nil ? nil : [NSNumber numberWithInteger:enumValue.value]; + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1344,16 +1191,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Responds with an error from an async function returning a value. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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)); @@ -1365,16 +1209,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Responds with an error from an async void function. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"throwAsyncErrorFromVoid" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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)); @@ -1386,19 +1227,15 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Responds with a Flutter error from an async function returning a value. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"throwAsyncFlutterError" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwAsyncFlutterErrorWithCompletion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwAsyncFlutterErrorWithCompletion:)", - api); + NSCAssert([api respondsToSelector:@selector(throwAsyncFlutterErrorWithCompletion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(throwAsyncFlutterErrorWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api throwAsyncFlutterErrorWithCompletion:^(id _Nullable output, - FlutterError *_Nullable error) { + [api throwAsyncFlutterErrorWithCompletion:^(id _Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; }]; @@ -1408,23 +1245,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed object, to test async serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAsyncAllTypes" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1432,24 +1265,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAsyncNullableAllNullableTypes" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1457,23 +1285,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns passed in int asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAsyncNullableInt" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1481,23 +1305,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns passed in double asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAsyncNullableDouble" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1505,23 +1325,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in boolean asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAsyncNullableBool" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1529,23 +1345,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed string asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAsyncNullableString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1553,24 +1365,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in Uint8List asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAsyncNullableUint8List" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1578,23 +1385,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in generic Object asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAsyncNullableObject" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1602,23 +1405,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed list, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAsyncNullableList" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1626,24 +1425,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed map, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAsyncNullableMap" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1651,46 +1445,34 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed enum, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAsyncNullableEnum" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableEnum:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableEnum:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableEnum:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableEnum:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_anEnumAsNumber = GetNullableObjectAtIndex(args, 0); - AnEnumBox *arg_anEnum = - arg_anEnumAsNumber == nil - ? nil - : [[AnEnumBox alloc] initWithValue:[arg_anEnumAsNumber integerValue]]; - [api - echoAsyncNullableEnum:arg_anEnum - completion:^(AnEnumBox *_Nullable enumValue, FlutterError *_Nullable error) { - NSNumber *output = - enumValue == nil ? nil : [NSNumber numberWithInteger:enumValue.value]; - callback(wrapResult(output, error)); - }]; + AnEnumBox *arg_anEnum = arg_anEnumAsNumber == nil ? nil : [[AnEnumBox alloc] initWithValue:[arg_anEnumAsNumber integerValue]]; + [api echoAsyncNullableEnum:arg_anEnum completion:^(AnEnumBox *_Nullable enumValue, FlutterError *_Nullable error) { + NSNumber *output = enumValue == nil ? nil : [NSNumber numberWithInteger:enumValue.value]; + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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)); @@ -1701,19 +1483,15 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterThrowError" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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)); }]; }]; @@ -1722,16 +1500,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterThrowErrorFromVoid" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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)); @@ -1742,463 +1517,366 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoAllTypes" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoAllNullableTypes" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllNullableTypes:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoAllNullableTypes:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllNullableTypes:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoAllNullableTypes:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAllNullableTypes:arg_everything - completion:^(AllNullableTypes *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoAllNullableTypes:arg_everything completion:^(AllNullableTypes *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterSendMultipleNullableTypes" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoBool" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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; BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; - [api callFlutterEchoBool:arg_aBool - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoBool:arg_aBool completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoInt" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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; NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; - [api callFlutterEchoInt:arg_anInt - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoInt:arg_anInt completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoDouble" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; - [api callFlutterEchoDouble:arg_aDouble - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoDouble:arg_aDouble completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoUint8List" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoList" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoMap" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoEnum" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoEnum:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoEnum:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoEnum:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoEnum:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AnEnum arg_anEnum = [GetNullableObjectAtIndex(args, 0) integerValue]; - [api callFlutterEchoEnum:arg_anEnum - completion:^(AnEnumBox *_Nullable enumValue, FlutterError *_Nullable error) { - NSNumber *output = - enumValue == nil ? nil : [NSNumber numberWithInteger:enumValue.value]; - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoEnum:arg_anEnum completion:^(AnEnumBox *_Nullable enumValue, FlutterError *_Nullable error) { + NSNumber *output = enumValue == nil ? nil : [NSNumber numberWithInteger:enumValue.value]; + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoNullableBool" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoNullableInt" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoNullableDouble" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoNullableString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoNullableUint8List" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoNullableList" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoNullableMap" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoNullableEnum" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableEnum:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableEnum:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableEnum:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableEnum:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_anEnumAsNumber = GetNullableObjectAtIndex(args, 0); - AnEnumBox *arg_anEnum = - arg_anEnumAsNumber == nil - ? nil - : [[AnEnumBox alloc] initWithValue:[arg_anEnumAsNumber integerValue]]; - [api callFlutterEchoNullableEnum:arg_anEnum - completion:^(AnEnumBox *_Nullable enumValue, - FlutterError *_Nullable error) { - NSNumber *output = - enumValue == nil ? nil - : [NSNumber numberWithInteger:enumValue.value]; - callback(wrapResult(output, error)); - }]; + AnEnumBox *arg_anEnum = arg_anEnumAsNumber == nil ? nil : [[AnEnumBox alloc] initWithValue:[arg_anEnumAsNumber integerValue]]; + [api callFlutterEchoNullableEnum:arg_anEnum completion:^(AnEnumBox *_Nullable enumValue, FlutterError *_Nullable error) { + NSNumber *output = enumValue == nil ? nil : [NSNumber numberWithInteger:enumValue.value]; + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -2210,13 +1888,13 @@ @interface FlutterIntegrationCoreApiCodecReader : FlutterStandardReader @implementation FlutterIntegrationCoreApiCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 128: + case 128: return [AllClassesWrapper fromList:[self readValue]]; - case 129: + case 129: return [AllNullableTypes 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]; @@ -2261,8 +1939,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; @@ -2282,597 +1959,523 @@ - (instancetype)initWithBinaryMessenger:(NSObject *)bina return self; } - (void)noopWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop"; + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:nil reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; } - (void)throwErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError"; + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - id output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:nil reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + id output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } - (void)throwErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid"; + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)echoAllTypes:(AllTypes *)arg_everything - completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:nil reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; +} +- (void)echoAllTypes:(AllTypes *)arg_everything completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_everything ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - AllTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoAllNullableTypes:(nullable AllNullableTypes *)arg_everything - completion: - (void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_everything ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + AllTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoAllNullableTypes:(nullable AllNullableTypes *)arg_everything completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_everything ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - AllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool - anInt:(nullable NSNumber *)arg_aNullableInt - aString:(nullable NSString *)arg_aNullableString - completion:(void (^)(AllNullableTypes *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - @"sendMultipleNullableTypes"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_everything ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + AllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool anInt:(nullable NSNumber *)arg_aNullableInt aString:(nullable NSString *)arg_aNullableString completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ - arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], - arg_aNullableString ?: [NSNull null] - ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - AllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoBool:(BOOL)arg_aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], arg_aNullableString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + AllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoBool:(BOOL)arg_aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ @(arg_aBool) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoInt:(NSInteger)arg_anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[@(arg_aBool)] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoInt:(NSInteger)arg_anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ @(arg_anInt) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoDouble:(double)arg_aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[@(arg_anInt)] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoDouble:(double)arg_aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ @(arg_aDouble) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoString:(NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[@(arg_aDouble)] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoString:(NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoUint8List:(FlutterStandardTypedData *)arg_aList - completion: - (void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoUint8List:(FlutterStandardTypedData *)arg_aList completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aList ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FlutterStandardTypedData *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoList:(NSArray *)arg_aList - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aList ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + FlutterStandardTypedData *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoList:(NSArray *)arg_aList completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aList ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoMap:(NSDictionary *)arg_aMap - completion: - (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aList ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoMap:(NSDictionary *)arg_aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSDictionary *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoEnum:(AnEnum)arg_anEnum - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aMap ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoEnum:(AnEnum)arg_anEnum completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ [NSNumber numberWithInteger:arg_anEnum] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *outputAsNumber = reply[0] == [NSNull null] ? nil : reply[0]; - AnEnumBox *output = - outputAsNumber == nil - ? nil - : [[AnEnumBox alloc] initWithValue:[outputAsNumber integerValue]]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableBool:(nullable NSNumber *)arg_aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[[NSNumber numberWithInteger:arg_anEnum]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *outputAsNumber = reply[0] == [NSNull null] ? nil : reply[0]; + AnEnumBox *output = outputAsNumber == nil ? nil : [[AnEnumBox alloc] initWithValue:[outputAsNumber integerValue]]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNamedDefaultString:(NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNamedDefaultString"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aBool ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableInt:(nullable NSNumber *)arg_anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableBool:(nullable NSNumber *)arg_aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_anInt ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aBool ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableInt:(nullable NSNumber *)arg_anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aDouble ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableString:(nullable NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_anInt ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_aList - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - @"echoNullableUint8List"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aDouble ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableString:(nullable NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aList ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FlutterStandardTypedData *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableList:(nullable NSArray *)arg_aList - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_aList completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aList ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableMap:(nullable NSDictionary *)arg_aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aList ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + FlutterStandardTypedData *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableList:(nullable NSArray *)arg_aList completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSDictionary *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableEnum:(nullable AnEnumBox *)arg_anEnum - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aList ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableMap:(nullable NSDictionary *)arg_aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_anEnum == nil ? [NSNull null] - : [NSNumber numberWithInteger:arg_anEnum.value] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *outputAsNumber = reply[0] == [NSNull null] ? nil : reply[0]; - AnEnumBox *output = - outputAsNumber == nil - ? nil - : [[AnEnumBox alloc] initWithValue:[outputAsNumber integerValue]]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aMap ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableEnum:(nullable AnEnumBox *)arg_anEnum completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum"; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_anEnum == nil ? [NSNull null] : [NSNumber numberWithInteger:arg_anEnum.value]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *outputAsNumber = reply[0] == [NSNull null] ? nil : reply[0]; + AnEnumBox *output = outputAsNumber == nil ? nil : [[AnEnumBox alloc] initWithValue:[outputAsNumber integerValue]]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNamedNullableString:(nullable NSString *)arg_aNullableString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNamedNullableString"; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aNullableString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } - (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync"; + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)echoAsyncString:(NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:nil reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; +} +- (void)echoAsyncString:(NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } @end @@ -2882,16 +2485,15 @@ - (void)echoAsyncString:(NSString *)arg_aString return sSharedObject; } -void SetUpHostTrivialApi(id binaryMessenger, - NSObject *api) { +void SetUpHostTrivialApi(id binaryMessenger, NSObject *api) { { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop" binaryMessenger:binaryMessenger - codec:HostTrivialApiGetCodec()]; + 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]; @@ -2910,34 +2512,32 @@ void SetUpHostTrivialApi(id binaryMessenger, void SetUpHostSmallApi(id binaryMessenger, NSObject *api) { { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo" binaryMessenger:binaryMessenger - codec:HostSmallApiGetCodec()]; + 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]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid" binaryMessenger:binaryMessenger - codec:HostSmallApiGetCodec()]; + codec:HostSmallApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(voidVoidWithCompletion:)], - @"HostSmallApi api (%@) doesn't respond to @selector(voidVoidWithCompletion:)", - api); + NSCAssert([api respondsToSelector:@selector(voidVoidWithCompletion:)], @"HostSmallApi api (%@) doesn't respond to @selector(voidVoidWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api voidVoidWithCompletion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -2953,7 +2553,7 @@ @interface FlutterSmallApiCodecReader : FlutterStandardReader @implementation FlutterSmallApiCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 128: + case 128: return [TestMessage fromList:[self readValue]]; default: return [super readValueOfType:type]; @@ -2989,8 +2589,7 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { static FlutterStandardMessageCodec *sSharedObject = nil; static dispatch_once_t sPred = 0; dispatch_once(&sPred, ^{ - FlutterSmallApiCodecReaderWriter *readerWriter = - [[FlutterSmallApiCodecReaderWriter alloc] init]; + FlutterSmallApiCodecReaderWriter *readerWriter = [[FlutterSmallApiCodecReaderWriter alloc] init]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; }); return sSharedObject; @@ -3009,51 +2608,45 @@ - (instancetype)initWithBinaryMessenger:(NSObject *)bina } return self; } -- (void)echoWrappedList:(TestMessage *)arg_msg - completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList"; +- (void)echoWrappedList:(TestMessage *)arg_msg completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterSmallApiGetCodec()]; - [channel sendMessage:@[ arg_msg ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - TestMessage *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoString:(NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterSmallApiGetCodec()]; + [channel sendMessage:@[arg_msg ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + TestMessage *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoString:(NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterSmallApiGetCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterSmallApiGetCodec()]; + [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } @end + diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.h b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.h index 782c3794a13b..4f8377e52bfc 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.h +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.h @@ -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, do not edit directly. // See also: https://pub.dev/packages/pigeon @@ -35,70 +35,68 @@ typedef NS_ENUM(NSUInteger, AnEnum) { @interface AllTypes : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithABool:(BOOL)aBool - anInt:(NSInteger)anInt - anInt64:(NSInteger)anInt64 - aDouble:(double)aDouble - aByteArray:(FlutterStandardTypedData *)aByteArray - a4ByteArray:(FlutterStandardTypedData *)a4ByteArray - a8ByteArray:(FlutterStandardTypedData *)a8ByteArray - aFloatArray:(FlutterStandardTypedData *)aFloatArray - aList:(NSArray *)aList - aMap:(NSDictionary *)aMap - anEnum:(AnEnum)anEnum - aString:(NSString *)aString - anObject:(id)anObject; -@property(nonatomic, assign) BOOL aBool; -@property(nonatomic, assign) NSInteger anInt; -@property(nonatomic, assign) NSInteger anInt64; -@property(nonatomic, assign) double aDouble; -@property(nonatomic, strong) FlutterStandardTypedData *aByteArray; -@property(nonatomic, strong) FlutterStandardTypedData *a4ByteArray; -@property(nonatomic, strong) FlutterStandardTypedData *a8ByteArray; -@property(nonatomic, strong) FlutterStandardTypedData *aFloatArray; -@property(nonatomic, copy) NSArray *aList; -@property(nonatomic, copy) NSDictionary *aMap; ++ (instancetype)makeWithABool:(BOOL )aBool + anInt:(NSInteger )anInt + anInt64:(NSInteger )anInt64 + aDouble:(double )aDouble + aByteArray:(FlutterStandardTypedData *)aByteArray + a4ByteArray:(FlutterStandardTypedData *)a4ByteArray + a8ByteArray:(FlutterStandardTypedData *)a8ByteArray + aFloatArray:(FlutterStandardTypedData *)aFloatArray + aList:(NSArray *)aList + aMap:(NSDictionary *)aMap + anEnum:(AnEnum)anEnum + aString:(NSString *)aString + anObject:(id )anObject; +@property(nonatomic, assign) BOOL aBool; +@property(nonatomic, assign) NSInteger anInt; +@property(nonatomic, assign) NSInteger anInt64; +@property(nonatomic, assign) double aDouble; +@property(nonatomic, strong) FlutterStandardTypedData * aByteArray; +@property(nonatomic, strong) FlutterStandardTypedData * a4ByteArray; +@property(nonatomic, strong) FlutterStandardTypedData * a8ByteArray; +@property(nonatomic, strong) FlutterStandardTypedData * aFloatArray; +@property(nonatomic, copy) NSArray * aList; +@property(nonatomic, copy) NSDictionary * aMap; @property(nonatomic, assign) AnEnum anEnum; -@property(nonatomic, copy) NSString *aString; -@property(nonatomic, strong) id anObject; +@property(nonatomic, copy) NSString * aString; +@property(nonatomic, strong) id anObject; @end /// A class containing all supported nullable types. @interface AllNullableTypes : NSObject + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - aNullableList:(nullable NSArray *)aNullableList - aNullableMap:(nullable NSDictionary *)aNullableMap - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable AnEnumBox *)aNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject; -@property(nonatomic, strong, nullable) NSNumber *aNullableBool; -@property(nonatomic, strong, nullable) NSNumber *aNullableInt; -@property(nonatomic, strong, nullable) NSNumber *aNullableInt64; -@property(nonatomic, strong, nullable) NSNumber *aNullableDouble; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable4ByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable8ByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableFloatArray; -@property(nonatomic, copy, nullable) NSArray *aNullableList; -@property(nonatomic, copy, nullable) NSDictionary *aNullableMap; -@property(nonatomic, copy, nullable) NSArray *> *nullableNestedList; -@property(nonatomic, copy, nullable) - NSDictionary *nullableMapWithAnnotations; -@property(nonatomic, copy, nullable) NSDictionary *nullableMapWithObject; -@property(nonatomic, strong, nullable) AnEnumBox *aNullableEnum; -@property(nonatomic, copy, nullable) NSString *aNullableString; -@property(nonatomic, strong, nullable) id aNullableObject; + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + aNullableList:(nullable NSArray *)aNullableList + aNullableMap:(nullable NSDictionary *)aNullableMap + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations:(nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(nullable AnEnumBox *)aNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id )aNullableObject; +@property(nonatomic, strong, nullable) NSNumber * aNullableBool; +@property(nonatomic, strong, nullable) NSNumber * aNullableInt; +@property(nonatomic, strong, nullable) NSNumber * aNullableInt64; +@property(nonatomic, strong, nullable) NSNumber * aNullableDouble; +@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullableByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullable4ByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullable8ByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullableFloatArray; +@property(nonatomic, copy, nullable) NSArray * aNullableList; +@property(nonatomic, copy, nullable) NSDictionary * aNullableMap; +@property(nonatomic, copy, nullable) NSArray *> * nullableNestedList; +@property(nonatomic, copy, nullable) NSDictionary * nullableMapWithAnnotations; +@property(nonatomic, copy, nullable) NSDictionary * nullableMapWithObject; +@property(nonatomic, strong, nullable) AnEnumBox * aNullableEnum; +@property(nonatomic, copy, nullable) NSString * aNullableString; +@property(nonatomic, strong, nullable) id aNullableObject; @end /// A class for testing nested class handling. @@ -110,15 +108,15 @@ typedef NS_ENUM(NSUInteger, AnEnum) { /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithAllNullableTypes:(AllNullableTypes *)allNullableTypes - allTypes:(nullable AllTypes *)allTypes; -@property(nonatomic, strong) AllNullableTypes *allNullableTypes; -@property(nonatomic, strong, nullable) AllTypes *allTypes; + allTypes:(nullable AllTypes *)allTypes; +@property(nonatomic, strong) AllNullableTypes * allNullableTypes; +@property(nonatomic, strong, nullable) AllTypes * allTypes; @end /// A data class containing a List, used in unit tests. @interface TestMessage : NSObject + (instancetype)makeWithTestList:(nullable NSArray *)testList; -@property(nonatomic, copy, nullable) NSArray *testList; +@property(nonatomic, copy, nullable) NSArray * testList; @end /// The codec used by HostIntegrationCoreApi. @@ -133,8 +131,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; /// Returns an error from a void function, to test error handling. @@ -156,13 +153,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`. @@ -170,18 +165,15 @@ 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 map to test nested class serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable AllClassesWrapper *)echoClassWrapper:(AllClassesWrapper *)wrapper - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable AllClassesWrapper *)echoClassWrapper:(AllClassesWrapper *)wrapper error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed enum to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. @@ -189,209 +181,124 @@ NSObject *HostIntegrationCoreApiGetCodec(void); /// Returns the default string. /// /// @return `nil` only when `error != nil`. -- (nullable NSString *)echoNamedDefaultString:(NSString *)aString - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)echoNamedDefaultString:(NSString *)aString error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in double. /// /// @return `nil` only when `error != nil`. -- (nullable NSNumber *)echoOptionalDefaultDouble:(double)aDouble - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoOptionalDefaultDouble:(double)aDouble error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in int. /// /// @return `nil` only when `error != nil`. -- (nullable NSNumber *)echoRequiredInt:(NSInteger)anInt - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoRequiredInt:(NSInteger)anInt error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed object, to test serialization and deserialization. -- (nullable AllNullableTypes *)echoAllNullableTypes:(nullable AllNullableTypes *)everything - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable AllNullableTypes *)echoAllNullableTypes:(nullable AllNullableTypes *)everything error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. -- (nullable NSString *)extractNestedNullableStringFrom:(AllClassesWrapper *)wrapper - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)extractNestedNullableStringFrom:(AllClassesWrapper *)wrapper error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. /// /// @return `nil` only when `error != nil`. -- (nullable AllClassesWrapper *) - createNestedObjectWithNullableString:(nullable NSString *)nullableString - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable AllClassesWrapper *)createNestedObjectWithNullableString:(nullable NSString *)nullableString error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in arguments of multiple types. /// /// @return `nil` only when `error != nil`. -- (nullable AllNullableTypes *)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - error:(FlutterError *_Nullable *_Nonnull) - error; +- (nullable AllNullableTypes *)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in int. -- (nullable NSNumber *)echoNullableInt:(nullable NSNumber *)aNullableInt - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoNullableInt:(nullable NSNumber *)aNullableInt error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in double. -- (nullable NSNumber *)echoNullableDouble:(nullable NSNumber *)aNullableDouble - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoNullableDouble:(nullable NSNumber *)aNullableDouble error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in boolean. -- (nullable NSNumber *)echoNullableBool:(nullable NSNumber *)aNullableBool - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoNullableBool:(nullable NSNumber *)aNullableBool error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in string. -- (nullable NSString *)echoNullableString:(nullable NSString *)aNullableString - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)echoNullableString:(nullable NSString *)aNullableString error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in Uint8List. -- (nullable FlutterStandardTypedData *) - echoNullableUint8List:(nullable FlutterStandardTypedData *)aNullableUint8List - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FlutterStandardTypedData *)echoNullableUint8List:(nullable FlutterStandardTypedData *)aNullableUint8List error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in generic Object. -- (nullable id)echoNullableObject:(nullable id)aNullableObject - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable id)echoNullableObject:(nullable id)aNullableObject error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed list, to test serialization and deserialization. -- (nullable NSArray *)echoNullableList:(nullable NSArray *)aNullableList - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSArray *)echoNullableList:(nullable NSArray *)aNullableList error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed map, to test serialization and deserialization. -- (nullable NSDictionary *)echoNullableMap: - (nullable NSDictionary *)aNullableMap - error:(FlutterError *_Nullable *_Nonnull)error; -- (AnEnumBox *_Nullable)echoNullableEnum:(nullable AnEnumBox *)anEnumBoxed - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSDictionary *)echoNullableMap:(nullable NSDictionary *)aNullableMap error:(FlutterError *_Nullable *_Nonnull)error; +- (AnEnumBox *_Nullable)echoNullableEnum:(nullable AnEnumBox *)anEnumBoxed error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in int. -- (nullable NSNumber *)echoOptionalNullableInt:(nullable NSNumber *)aNullableInt - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoOptionalNullableInt:(nullable NSNumber *)aNullableInt error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in string. -- (nullable NSString *)echoNamedNullableString:(nullable NSString *)aNullableString - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)echoNamedNullableString:(nullable NSString *)aNullableString error:(FlutterError *_Nullable *_Nonnull)error; /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. - (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion; /// Returns passed in int asynchronously. -- (void)echoAsyncInt:(NSInteger)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncInt:(NSInteger)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in double asynchronously. -- (void)echoAsyncDouble:(double)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncDouble:(double)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in boolean asynchronously. -- (void)echoAsyncBool:(BOOL)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncBool:(BOOL)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed string asynchronously. -- (void)echoAsyncString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in Uint8List asynchronously. -- (void)echoAsyncUint8List:(FlutterStandardTypedData *)aUint8List - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncUint8List:(FlutterStandardTypedData *)aUint8List completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in generic Object asynchronously. -- (void)echoAsyncObject:(id)anObject - completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncObject:(id)anObject completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; /// Returns the passed list, to test asynchronous serialization and deserialization. -- (void)echoAsyncList:(NSArray *)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 asynchronous serialization and deserialization. -- (void)echoAsyncMap:(NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncMap:(NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed enum, to test asynchronous serialization and deserialization. -- (void)echoAsyncEnum:(AnEnum)anEnum - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncEnum:(AnEnum)anEnum completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; /// Responds with an error from an async function returning a value. - (void)throwAsyncErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; /// Responds with an error from an async void function. - (void)throwAsyncErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; /// Responds with a Flutter error from an async function returning a value. -- (void)throwAsyncFlutterErrorWithCompletion:(void (^)(id _Nullable, - FlutterError *_Nullable))completion; +- (void)throwAsyncFlutterErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; /// Returns the passed object, to test async serialization and deserialization. -- (void)echoAsyncAllTypes:(AllTypes *)everything - completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncAllTypes:(AllTypes *)everything completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAsyncNullableAllNullableTypes:(nullable AllNullableTypes *)everything - completion:(void (^)(AllNullableTypes *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncNullableAllNullableTypes:(nullable AllNullableTypes *)everything completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in int asynchronously. -- (void)echoAsyncNullableInt:(nullable NSNumber *)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableInt:(nullable NSNumber *)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in double asynchronously. -- (void)echoAsyncNullableDouble:(nullable NSNumber *)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableDouble:(nullable NSNumber *)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in boolean asynchronously. -- (void)echoAsyncNullableBool:(nullable NSNumber *)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableBool:(nullable NSNumber *)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed string asynchronously. -- (void)echoAsyncNullableString:(nullable NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableString:(nullable NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in Uint8List asynchronously. -- (void)echoAsyncNullableUint8List:(nullable FlutterStandardTypedData *)aUint8List - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncNullableUint8List:(nullable FlutterStandardTypedData *)aUint8List completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in generic Object asynchronously. -- (void)echoAsyncNullableObject:(nullable id)anObject - completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableObject:(nullable id)anObject completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; /// Returns the passed list, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableList:(nullable NSArray *)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 asynchronous serialization and deserialization. -- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed enum, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableEnum:(nullable AnEnumBox *)anEnumBoxed - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableEnum:(nullable AnEnumBox *)anEnumBoxed completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; - (void)callFlutterNoopWithCompletion:(void (^)(FlutterError *_Nullable))completion; -- (void)callFlutterThrowErrorWithCompletion:(void (^)(id _Nullable, - FlutterError *_Nullable))completion; +- (void)callFlutterThrowErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; - (void)callFlutterThrowErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; -- (void)callFlutterEchoAllTypes:(AllTypes *)everything - completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoAllNullableTypes:(nullable AllNullableTypes *)everything - completion:(void (^)(AllNullableTypes *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterSendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - completion:(void (^)(AllNullableTypes *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoBool:(BOOL)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoInt:(NSInteger)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoDouble:(double)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoUint8List:(FlutterStandardTypedData *)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)callFlutterEchoEnum:(AnEnum)anEnum - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableBool:(nullable NSNumber *)aBool - completion: - (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableInt:(nullable NSNumber *)anInt - completion: - (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableDouble:(nullable NSNumber *)aDouble - completion: - (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableString:(nullable NSString *)aString - completion: - (void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableUint8List:(nullable FlutterStandardTypedData *)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)callFlutterEchoNullableEnum:(nullable AnEnumBox *)anEnumBoxed - completion: - (void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoAllTypes:(AllTypes *)everything completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoAllNullableTypes:(nullable AllNullableTypes *)everything completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterSendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoBool:(BOOL)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoInt:(NSInteger)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoDouble:(double)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoUint8List:(FlutterStandardTypedData *)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)callFlutterEchoEnum:(AnEnum)anEnum completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableBool:(nullable NSNumber *)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableInt:(nullable NSNumber *)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableDouble:(nullable NSNumber *)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableString:(nullable NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableUint8List:(nullable FlutterStandardTypedData *)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)callFlutterEchoNullableEnum:(nullable AnEnumBox *)anEnumBoxed completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; @end -extern void SetUpHostIntegrationCoreApi(id binaryMessenger, - NSObject *_Nullable api); +extern void SetUpHostIntegrationCoreApi(id binaryMessenger, NSObject *_Nullable api); /// The codec used by FlutterIntegrationCoreApi. NSObject *FlutterIntegrationCoreApiGetCodec(void); @@ -408,78 +315,54 @@ 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:(nullable AllNullableTypes *)everything - completion: - (void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAllNullableTypes:(nullable AllNullableTypes *)everything completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. -- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - completion:(void (^)(AllNullableTypes *_Nullable, - FlutterError *_Nullable))completion; +- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed boolean, to test serialization and deserialization. -- (void)echoBool:(BOOL)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoBool:(BOOL)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed int, to test serialization and deserialization. -- (void)echoInt:(NSInteger)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoInt:(NSInteger)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed double, to test serialization and deserialization. -- (void)echoDouble:(double)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoDouble:(double)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed string, to test serialization and deserialization. -- (void)echoString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed byte list, to test serialization and deserialization. -- (void)echoUint8List:(FlutterStandardTypedData *)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 enum to test serialization and deserialization. -- (void)echoEnum:(AnEnum)anEnum - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoEnum:(AnEnum)anEnum completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +/// Returns the default string. +- (void)echoNamedDefaultString:(NSString *)aString completion:(void (^)(NSString *_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; /// Returns the passed enum to test serialization and deserialization. -- (void)echoNullableEnum:(nullable AnEnumBox *)anEnumBoxed - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableEnum:(nullable AnEnumBox *)anEnumBoxed completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed in string. +- (void)echoNamedNullableString:(nullable NSString *)aNullableString completion:(void (^)(NSString *_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. @@ -490,21 +373,18 @@ NSObject *HostTrivialApiGetCodec(void); - (void)noopWithError:(FlutterError *_Nullable *_Nonnull)error; @end -extern void SetUpHostTrivialApi(id binaryMessenger, - NSObject *_Nullable api); +extern void SetUpHostTrivialApi(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 SetUpHostSmallApi(id binaryMessenger, - NSObject *_Nullable api); +extern void SetUpHostSmallApi(id binaryMessenger, NSObject *_Nullable api); /// The codec used by FlutterSmallApi. NSObject *FlutterSmallApiGetCodec(void); @@ -512,10 +392,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)echoString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoWrappedList:(TestMessage *)msg completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion; +- (void)echoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; @end NS_ASSUME_NONNULL_END diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.m index 0cc5b059c04f..664facc2ae15 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.m +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.m @@ -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, do not edit directly. // See also: https://pub.dev/packages/pigeon @@ -27,12 +27,7 @@ } static FlutterError *createConnectionError(NSString *channelName) { - return [FlutterError - errorWithCode:@"channel-error" - message:[NSString stringWithFormat:@"%@/%@/%@", - @"Unable to establish connection on channel: '", - channelName, @"'."] - details:@""]; + return [FlutterError errorWithCode:@"channel-error" message:[NSString stringWithFormat:@"%@/%@/%@", @"Unable to establish connection on channel: '", channelName, @"'."] details:@""]; } static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { @@ -75,20 +70,20 @@ - (NSArray *)toList; @end @implementation AllTypes -+ (instancetype)makeWithABool:(BOOL)aBool - anInt:(NSInteger)anInt - anInt64:(NSInteger)anInt64 - aDouble:(double)aDouble - aByteArray:(FlutterStandardTypedData *)aByteArray - a4ByteArray:(FlutterStandardTypedData *)a4ByteArray - a8ByteArray:(FlutterStandardTypedData *)a8ByteArray - aFloatArray:(FlutterStandardTypedData *)aFloatArray - aList:(NSArray *)aList - aMap:(NSDictionary *)aMap - anEnum:(AnEnum)anEnum - aString:(NSString *)aString - anObject:(id)anObject { - AllTypes *pigeonResult = [[AllTypes alloc] init]; ++ (instancetype)makeWithABool:(BOOL )aBool + anInt:(NSInteger )anInt + anInt64:(NSInteger )anInt64 + aDouble:(double )aDouble + aByteArray:(FlutterStandardTypedData *)aByteArray + a4ByteArray:(FlutterStandardTypedData *)a4ByteArray + a8ByteArray:(FlutterStandardTypedData *)a8ByteArray + aFloatArray:(FlutterStandardTypedData *)aFloatArray + aList:(NSArray *)aList + aMap:(NSDictionary *)aMap + anEnum:(AnEnum)anEnum + aString:(NSString *)aString + anObject:(id )anObject { + AllTypes* pigeonResult = [[AllTypes alloc] init]; pigeonResult.aBool = aBool; pigeonResult.anInt = anInt; pigeonResult.anInt64 = anInt64; @@ -145,23 +140,22 @@ - (NSArray *)toList { @implementation AllNullableTypes + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - aNullableList:(nullable NSArray *)aNullableList - aNullableMap:(nullable NSDictionary *)aNullableMap - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable AnEnumBox *)aNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject { - AllNullableTypes *pigeonResult = [[AllNullableTypes alloc] init]; + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + aNullableList:(nullable NSArray *)aNullableList + aNullableMap:(nullable NSDictionary *)aNullableMap + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations:(nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(nullable AnEnumBox *)aNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id )aNullableObject { + AllNullableTypes* pigeonResult = [[AllNullableTypes alloc] init]; pigeonResult.aNullableBool = aNullableBool; pigeonResult.aNullableInt = aNullableInt; pigeonResult.aNullableInt64 = aNullableInt64; @@ -196,10 +190,7 @@ + (AllNullableTypes *)fromList:(NSArray *)list { pigeonResult.nullableMapWithAnnotations = GetNullableObjectAtIndex(list, 11); pigeonResult.nullableMapWithObject = GetNullableObjectAtIndex(list, 12); NSNumber *aNullableEnumAsNumber = GetNullableObjectAtIndex(list, 13); - AnEnumBox *aNullableEnum = - aNullableEnumAsNumber == nil - ? nil - : [[AnEnumBox alloc] initWithValue:[aNullableEnumAsNumber integerValue]]; + AnEnumBox *aNullableEnum = aNullableEnumAsNumber == nil ? nil : [[AnEnumBox alloc] initWithValue:[aNullableEnumAsNumber integerValue]]; pigeonResult.aNullableEnum = aNullableEnum; pigeonResult.aNullableString = GetNullableObjectAtIndex(list, 14); pigeonResult.aNullableObject = GetNullableObjectAtIndex(list, 15); @@ -223,8 +214,7 @@ - (NSArray *)toList { self.nullableNestedList ?: [NSNull null], self.nullableMapWithAnnotations ?: [NSNull null], self.nullableMapWithObject ?: [NSNull null], - (self.aNullableEnum == nil ? [NSNull null] - : [NSNumber numberWithInteger:self.aNullableEnum.value]), + (self.aNullableEnum == nil ? [NSNull null] : [NSNumber numberWithInteger:self.aNullableEnum.value]), self.aNullableString ?: [NSNull null], self.aNullableObject ?: [NSNull null], ]; @@ -233,16 +223,15 @@ - (NSArray *)toList { @implementation AllClassesWrapper + (instancetype)makeWithAllNullableTypes:(AllNullableTypes *)allNullableTypes - allTypes:(nullable AllTypes *)allTypes { - AllClassesWrapper *pigeonResult = [[AllClassesWrapper alloc] init]; + allTypes:(nullable AllTypes *)allTypes { + AllClassesWrapper* pigeonResult = [[AllClassesWrapper alloc] init]; pigeonResult.allNullableTypes = allNullableTypes; pigeonResult.allTypes = allTypes; return pigeonResult; } + (AllClassesWrapper *)fromList:(NSArray *)list { AllClassesWrapper *pigeonResult = [[AllClassesWrapper alloc] init]; - pigeonResult.allNullableTypes = - [AllNullableTypes nullableFromList:(GetNullableObjectAtIndex(list, 0))]; + pigeonResult.allNullableTypes = [AllNullableTypes nullableFromList:(GetNullableObjectAtIndex(list, 0))]; pigeonResult.allTypes = [AllTypes nullableFromList:(GetNullableObjectAtIndex(list, 1))]; return pigeonResult; } @@ -259,7 +248,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; } @@ -283,13 +272,13 @@ @interface HostIntegrationCoreApiCodecReader : FlutterStandardReader @implementation HostIntegrationCoreApiCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 128: + case 128: return [AllClassesWrapper fromList:[self readValue]]; - case 129: + case 129: return [AllNullableTypes 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]; @@ -334,26 +323,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 SetUpHostIntegrationCoreApi(id binaryMessenger, - NSObject *api) { +void SetUpHostIntegrationCoreApi(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.pigeon_integration_tests.HostIntegrationCoreApi.noop" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -365,16 +351,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -388,16 +371,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns an error, to test error handling. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -409,16 +389,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns an error from a void function, to test error handling. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"throwErrorFromVoid" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -430,16 +407,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns a Flutter error, to test error handling. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"throwFlutterError" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwFlutterErrorWithError:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwFlutterErrorWithError:)", - api); + NSCAssert([api respondsToSelector:@selector(throwFlutterErrorWithError:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(throwFlutterErrorWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; id output = [api throwFlutterErrorWithError:&error]; @@ -451,15 +425,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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; NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; @@ -473,15 +445,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns passed in double. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; @@ -495,15 +465,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in boolean. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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; BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; @@ -517,15 +485,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in string. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -539,16 +505,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in Uint8List. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -562,15 +525,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in generic Object. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -584,15 +545,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed list, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -606,15 +565,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed map, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -628,16 +585,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed map to test nested class serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoClassWrapper" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoClassWrapper:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoClassWrapper:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoClassWrapper:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoClassWrapper:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllClassesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); @@ -651,20 +605,18 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed enum to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoEnum:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoEnum:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoEnum:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoEnum:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AnEnum arg_anEnum = [GetNullableObjectAtIndex(args, 0) integerValue]; FlutterError *error; - AnEnumBox *enumBox = [api echoEnum:arg_anEnum error:&error]; + AnEnumBox * enumBox = [api echoEnum:arg_anEnum error:&error]; NSNumber *output = enumBox == nil ? nil : [NSNumber numberWithInteger:enumBox.value]; callback(wrapResult(output, error)); }]; @@ -674,16 +626,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the default string. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoNamedDefaultString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNamedDefaultString:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNamedDefaultString:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNamedDefaultString:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNamedDefaultString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); @@ -697,16 +646,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns passed in double. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoOptionalDefaultDouble" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoOptionalDefaultDouble:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoOptionalDefaultDouble:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoOptionalDefaultDouble:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoOptionalDefaultDouble:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; @@ -720,16 +666,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoRequiredInt:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoRequiredInt:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoRequiredInt:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoRequiredInt:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; @@ -743,16 +686,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAllNullableTypes" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -767,16 +707,13 @@ void SetUpHostIntegrationCoreApi(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.pigeon_integration_tests.HostIntegrationCoreApi." - @"extractNestedNullableString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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; AllClassesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); @@ -791,22 +728,18 @@ void SetUpHostIntegrationCoreApi(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.pigeon_integration_tests.HostIntegrationCoreApi." - @"createNestedNullableString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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; - AllClassesWrapper *output = [api createNestedObjectWithNullableString:arg_nullableString - error:&error]; + AllClassesWrapper *output = [api createNestedObjectWithNullableString:arg_nullableString error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -815,27 +748,20 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns passed in arguments of multiple types. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"sendMultipleNullableTypes" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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 { @@ -844,16 +770,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -867,16 +790,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns passed in double. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoNullableDouble" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -890,16 +810,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in boolean. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoNullableBool" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -913,16 +830,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in string. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoNullableString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -936,22 +850,18 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in Uint8List. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoNullableUint8List" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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 { @@ -960,16 +870,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in generic Object. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoNullableObject" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -983,16 +890,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed list, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoNullableList" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -1006,16 +910,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed map, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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); @@ -1028,25 +929,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoNullableEnum" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoNullableEnum:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableEnum:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNullableEnum:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableEnum:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_anEnumAsNumber = GetNullableObjectAtIndex(args, 0); - AnEnumBox *arg_anEnum = - arg_anEnumAsNumber == nil - ? nil - : [[AnEnumBox alloc] initWithValue:[arg_anEnumAsNumber integerValue]]; + AnEnumBox *arg_anEnum = arg_anEnumAsNumber == nil ? nil : [[AnEnumBox alloc] initWithValue:[arg_anEnumAsNumber integerValue]]; FlutterError *error; - AnEnumBox *enumBox = [api echoNullableEnum:arg_anEnum error:&error]; + AnEnumBox * enumBox = [api echoNullableEnum:arg_anEnum error:&error]; NSNumber *output = enumBox == nil ? nil : [NSNumber numberWithInteger:enumBox.value]; callback(wrapResult(output, error)); }]; @@ -1056,16 +951,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoOptionalNullableInt" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoOptionalNullableInt:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoOptionalNullableInt:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoOptionalNullableInt:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoOptionalNullableInt:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 0); @@ -1079,16 +971,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in string. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoNamedNullableString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNamedNullableString:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNamedNullableString:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNamedNullableString:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNamedNullableString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 0); @@ -1103,16 +992,13 @@ void SetUpHostIntegrationCoreApi(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.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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)); @@ -1124,23 +1010,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns passed in int asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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; NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; - [api echoAsyncInt:arg_anInt - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncInt:arg_anInt completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1148,23 +1030,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns passed in double asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; - [api echoAsyncDouble:arg_aDouble - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncDouble:arg_aDouble completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1172,23 +1050,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in boolean asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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; BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; - [api echoAsyncBool:arg_aBool - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncBool:arg_aBool completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1196,23 +1070,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed string asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1220,24 +1090,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in Uint8List asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAsyncUint8List" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1245,23 +1110,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in generic Object asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1269,23 +1130,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed list, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1293,24 +1150,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed map, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1318,25 +1170,20 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed enum, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncEnum:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncEnum:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncEnum:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncEnum:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AnEnum arg_anEnum = [GetNullableObjectAtIndex(args, 0) integerValue]; - [api echoAsyncEnum:arg_anEnum - completion:^(AnEnumBox *_Nullable enumValue, FlutterError *_Nullable error) { - NSNumber *output = - enumValue == nil ? nil : [NSNumber numberWithInteger:enumValue.value]; - callback(wrapResult(output, error)); - }]; + [api echoAsyncEnum:arg_anEnum completion:^(AnEnumBox *_Nullable enumValue, FlutterError *_Nullable error) { + NSNumber *output = enumValue == nil ? nil : [NSNumber numberWithInteger:enumValue.value]; + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1344,16 +1191,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Responds with an error from an async function returning a value. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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)); @@ -1365,16 +1209,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Responds with an error from an async void function. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"throwAsyncErrorFromVoid" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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)); @@ -1386,19 +1227,15 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Responds with a Flutter error from an async function returning a value. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"throwAsyncFlutterError" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwAsyncFlutterErrorWithCompletion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwAsyncFlutterErrorWithCompletion:)", - api); + NSCAssert([api respondsToSelector:@selector(throwAsyncFlutterErrorWithCompletion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(throwAsyncFlutterErrorWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api throwAsyncFlutterErrorWithCompletion:^(id _Nullable output, - FlutterError *_Nullable error) { + [api throwAsyncFlutterErrorWithCompletion:^(id _Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; }]; @@ -1408,23 +1245,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed object, to test async serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAsyncAllTypes" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1432,24 +1265,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAsyncNullableAllNullableTypes" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1457,23 +1285,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns passed in int asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAsyncNullableInt" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1481,23 +1305,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns passed in double asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAsyncNullableDouble" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1505,23 +1325,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in boolean asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAsyncNullableBool" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1529,23 +1345,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed string asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAsyncNullableString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1553,24 +1365,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in Uint8List asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAsyncNullableUint8List" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1578,23 +1385,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed in generic Object asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAsyncNullableObject" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1602,23 +1405,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed list, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAsyncNullableList" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1626,24 +1425,19 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed map, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAsyncNullableMap" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; @@ -1651,46 +1445,34 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } /// Returns the passed enum, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"echoAsyncNullableEnum" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableEnum:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableEnum:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableEnum:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableEnum:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_anEnumAsNumber = GetNullableObjectAtIndex(args, 0); - AnEnumBox *arg_anEnum = - arg_anEnumAsNumber == nil - ? nil - : [[AnEnumBox alloc] initWithValue:[arg_anEnumAsNumber integerValue]]; - [api - echoAsyncNullableEnum:arg_anEnum - completion:^(AnEnumBox *_Nullable enumValue, FlutterError *_Nullable error) { - NSNumber *output = - enumValue == nil ? nil : [NSNumber numberWithInteger:enumValue.value]; - callback(wrapResult(output, error)); - }]; + AnEnumBox *arg_anEnum = arg_anEnumAsNumber == nil ? nil : [[AnEnumBox alloc] initWithValue:[arg_anEnumAsNumber integerValue]]; + [api echoAsyncNullableEnum:arg_anEnum completion:^(AnEnumBox *_Nullable enumValue, FlutterError *_Nullable error) { + NSNumber *output = enumValue == nil ? nil : [NSNumber numberWithInteger:enumValue.value]; + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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)); @@ -1701,19 +1483,15 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterThrowError" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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)); }]; }]; @@ -1722,16 +1500,13 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterThrowErrorFromVoid" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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)); @@ -1742,463 +1517,366 @@ void SetUpHostIntegrationCoreApi(id binaryMessenger, } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoAllTypes" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoAllNullableTypes" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllNullableTypes:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoAllNullableTypes:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllNullableTypes:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoAllNullableTypes:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAllNullableTypes:arg_everything - completion:^(AllNullableTypes *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoAllNullableTypes:arg_everything completion:^(AllNullableTypes *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterSendMultipleNullableTypes" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoBool" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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; BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; - [api callFlutterEchoBool:arg_aBool - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoBool:arg_aBool completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoInt" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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; NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; - [api callFlutterEchoInt:arg_anInt - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoInt:arg_anInt completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoDouble" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; - [api callFlutterEchoDouble:arg_aDouble - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoDouble:arg_aDouble completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoUint8List" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoList" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoMap" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoEnum" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoEnum:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoEnum:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoEnum:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoEnum:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AnEnum arg_anEnum = [GetNullableObjectAtIndex(args, 0) integerValue]; - [api callFlutterEchoEnum:arg_anEnum - completion:^(AnEnumBox *_Nullable enumValue, FlutterError *_Nullable error) { - NSNumber *output = - enumValue == nil ? nil : [NSNumber numberWithInteger:enumValue.value]; - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoEnum:arg_anEnum completion:^(AnEnumBox *_Nullable enumValue, FlutterError *_Nullable error) { + NSNumber *output = enumValue == nil ? nil : [NSNumber numberWithInteger:enumValue.value]; + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoNullableBool" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoNullableInt" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoNullableDouble" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoNullableString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoNullableUint8List" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoNullableList" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoNullableMap" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.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]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterEchoNullableEnum" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableEnum:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableEnum:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableEnum:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableEnum:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_anEnumAsNumber = GetNullableObjectAtIndex(args, 0); - AnEnumBox *arg_anEnum = - arg_anEnumAsNumber == nil - ? nil - : [[AnEnumBox alloc] initWithValue:[arg_anEnumAsNumber integerValue]]; - [api callFlutterEchoNullableEnum:arg_anEnum - completion:^(AnEnumBox *_Nullable enumValue, - FlutterError *_Nullable error) { - NSNumber *output = - enumValue == nil ? nil - : [NSNumber numberWithInteger:enumValue.value]; - callback(wrapResult(output, error)); - }]; + AnEnumBox *arg_anEnum = arg_anEnumAsNumber == nil ? nil : [[AnEnumBox alloc] initWithValue:[arg_anEnumAsNumber integerValue]]; + [api callFlutterEchoNullableEnum:arg_anEnum completion:^(AnEnumBox *_Nullable enumValue, FlutterError *_Nullable error) { + NSNumber *output = enumValue == nil ? nil : [NSNumber numberWithInteger:enumValue.value]; + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -2210,13 +1888,13 @@ @interface FlutterIntegrationCoreApiCodecReader : FlutterStandardReader @implementation FlutterIntegrationCoreApiCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 128: + case 128: return [AllClassesWrapper fromList:[self readValue]]; - case 129: + case 129: return [AllNullableTypes 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]; @@ -2261,8 +1939,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; @@ -2282,597 +1959,523 @@ - (instancetype)initWithBinaryMessenger:(NSObject *)bina return self; } - (void)noopWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop"; + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:nil reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; } - (void)throwErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError"; + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - id output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:nil reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + id output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } - (void)throwErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid"; + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)echoAllTypes:(AllTypes *)arg_everything - completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:nil reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; +} +- (void)echoAllTypes:(AllTypes *)arg_everything completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_everything ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - AllTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoAllNullableTypes:(nullable AllNullableTypes *)arg_everything - completion: - (void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_everything ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + AllTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoAllNullableTypes:(nullable AllNullableTypes *)arg_everything completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_everything ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - AllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool - anInt:(nullable NSNumber *)arg_aNullableInt - aString:(nullable NSString *)arg_aNullableString - completion:(void (^)(AllNullableTypes *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - @"sendMultipleNullableTypes"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_everything ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + AllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool anInt:(nullable NSNumber *)arg_aNullableInt aString:(nullable NSString *)arg_aNullableString completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ - arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], - arg_aNullableString ?: [NSNull null] - ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - AllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoBool:(BOOL)arg_aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], arg_aNullableString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + AllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoBool:(BOOL)arg_aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ @(arg_aBool) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoInt:(NSInteger)arg_anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[@(arg_aBool)] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoInt:(NSInteger)arg_anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ @(arg_anInt) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoDouble:(double)arg_aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[@(arg_anInt)] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoDouble:(double)arg_aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ @(arg_aDouble) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoString:(NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[@(arg_aDouble)] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoString:(NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoUint8List:(FlutterStandardTypedData *)arg_aList - completion: - (void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoUint8List:(FlutterStandardTypedData *)arg_aList completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aList ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FlutterStandardTypedData *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoList:(NSArray *)arg_aList - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aList ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + FlutterStandardTypedData *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoList:(NSArray *)arg_aList completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aList ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoMap:(NSDictionary *)arg_aMap - completion: - (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aList ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoMap:(NSDictionary *)arg_aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSDictionary *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoEnum:(AnEnum)arg_anEnum - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aMap ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoEnum:(AnEnum)arg_anEnum completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ [NSNumber numberWithInteger:arg_anEnum] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *outputAsNumber = reply[0] == [NSNull null] ? nil : reply[0]; - AnEnumBox *output = - outputAsNumber == nil - ? nil - : [[AnEnumBox alloc] initWithValue:[outputAsNumber integerValue]]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableBool:(nullable NSNumber *)arg_aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[[NSNumber numberWithInteger:arg_anEnum]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *outputAsNumber = reply[0] == [NSNull null] ? nil : reply[0]; + AnEnumBox *output = outputAsNumber == nil ? nil : [[AnEnumBox alloc] initWithValue:[outputAsNumber integerValue]]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNamedDefaultString:(NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNamedDefaultString"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aBool ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableInt:(nullable NSNumber *)arg_anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableBool:(nullable NSNumber *)arg_aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_anInt ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aBool ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableInt:(nullable NSNumber *)arg_anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aDouble ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableString:(nullable NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_anInt ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_aList - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - @"echoNullableUint8List"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aDouble ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableString:(nullable NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aList ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FlutterStandardTypedData *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableList:(nullable NSArray *)arg_aList - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_aList completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aList ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableMap:(nullable NSDictionary *)arg_aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aList ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + FlutterStandardTypedData *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableList:(nullable NSArray *)arg_aList completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSDictionary *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableEnum:(nullable AnEnumBox *)arg_anEnum - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aList ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableMap:(nullable NSDictionary *)arg_aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_anEnum == nil ? [NSNull null] - : [NSNumber numberWithInteger:arg_anEnum.value] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *outputAsNumber = reply[0] == [NSNull null] ? nil : reply[0]; - AnEnumBox *output = - outputAsNumber == nil - ? nil - : [[AnEnumBox alloc] initWithValue:[outputAsNumber integerValue]]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aMap ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableEnum:(nullable AnEnumBox *)arg_anEnum completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum"; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_anEnum == nil ? [NSNull null] : [NSNumber numberWithInteger:arg_anEnum.value]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *outputAsNumber = reply[0] == [NSNull null] ? nil : reply[0]; + AnEnumBox *output = outputAsNumber == nil ? nil : [[AnEnumBox alloc] initWithValue:[outputAsNumber integerValue]]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNamedNullableString:(nullable NSString *)arg_aNullableString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNamedNullableString"; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aNullableString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } - (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync"; + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)echoAsyncString:(NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString"; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:nil reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; +} +- (void)echoAsyncString:(NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } @end @@ -2882,16 +2485,15 @@ - (void)echoAsyncString:(NSString *)arg_aString return sSharedObject; } -void SetUpHostTrivialApi(id binaryMessenger, - NSObject *api) { +void SetUpHostTrivialApi(id binaryMessenger, NSObject *api) { { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop" binaryMessenger:binaryMessenger - codec:HostTrivialApiGetCodec()]; + 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]; @@ -2910,34 +2512,32 @@ void SetUpHostTrivialApi(id binaryMessenger, void SetUpHostSmallApi(id binaryMessenger, NSObject *api) { { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo" binaryMessenger:binaryMessenger - codec:HostSmallApiGetCodec()]; + 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]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid" binaryMessenger:binaryMessenger - codec:HostSmallApiGetCodec()]; + codec:HostSmallApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(voidVoidWithCompletion:)], - @"HostSmallApi api (%@) doesn't respond to @selector(voidVoidWithCompletion:)", - api); + NSCAssert([api respondsToSelector:@selector(voidVoidWithCompletion:)], @"HostSmallApi api (%@) doesn't respond to @selector(voidVoidWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api voidVoidWithCompletion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -2953,7 +2553,7 @@ @interface FlutterSmallApiCodecReader : FlutterStandardReader @implementation FlutterSmallApiCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 128: + case 128: return [TestMessage fromList:[self readValue]]; default: return [super readValueOfType:type]; @@ -2989,8 +2589,7 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { static FlutterStandardMessageCodec *sSharedObject = nil; static dispatch_once_t sPred = 0; dispatch_once(&sPred, ^{ - FlutterSmallApiCodecReaderWriter *readerWriter = - [[FlutterSmallApiCodecReaderWriter alloc] init]; + FlutterSmallApiCodecReaderWriter *readerWriter = [[FlutterSmallApiCodecReaderWriter alloc] init]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; }); return sSharedObject; @@ -3009,51 +2608,45 @@ - (instancetype)initWithBinaryMessenger:(NSObject *)bina } return self; } -- (void)echoWrappedList:(TestMessage *)arg_msg - completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList"; +- (void)echoWrappedList:(TestMessage *)arg_msg completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterSmallApiGetCodec()]; - [channel sendMessage:@[ arg_msg ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - TestMessage *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoString:(NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterSmallApiGetCodec()]; + [channel sendMessage:@[arg_msg ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + TestMessage *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoString:(NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { NSString *channelName = @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString"; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FlutterSmallApiGetCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FlutterSmallApiGetCodec()]; + [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } @end + diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart index 6815f461c943..0a89ea00d655 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 @@ -2577,6 +2577,9 @@ abstract class FlutterIntegrationCoreApi { /// Returns the passed enum to test serialization and deserialization. AnEnum echoEnum(AnEnum anEnum); + /// Returns the default string. + String echoNamedDefaultString({String aString = 'default'}); + /// Returns the passed boolean, to test serialization and deserialization. bool? echoNullableBool(bool? aBool); @@ -2601,6 +2604,9 @@ abstract class FlutterIntegrationCoreApi { /// Returns the passed enum to test serialization and deserialization. AnEnum? echoNullableEnum(AnEnum? anEnum); + /// Returns the passed in string. + String? echoNamedNullableString({String? aNullableString}); + /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. Future noopAsync(); @@ -2988,6 +2994,35 @@ abstract class FlutterIntegrationCoreApi { }); } } + { + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNamedDefaultString', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + __pigeon_channel.setMessageHandler(null); + } else { + __pigeon_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNamedDefaultString 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.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNamedDefaultString was null, expected non-null String.'); + try { + final String output = + api.echoNamedDefaultString(aString: arg_aString!); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } { final BasicMessageChannel __pigeon_channel = BasicMessageChannel< Object?>( @@ -3199,6 +3234,33 @@ abstract class FlutterIntegrationCoreApi { }); } } + { + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNamedNullableString', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + __pigeon_channel.setMessageHandler(null); + } else { + __pigeon_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNamedNullableString was null.'); + final List args = (message as List?)!; + final String? arg_aNullableString = (args[0] as String?); + try { + final String? output = api.echoNamedNullableString( + aNullableString: arg_aNullableString); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } { final BasicMessageChannel __pigeon_channel = BasicMessageChannel< Object?>( 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 798d66849895..99df98894532 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 @@ -2735,6 +2735,32 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { } } } + /** Returns the default string. */ + fun echoNamedDefaultString(aStringArg: String, callback: (Result) -> Unit) { + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNamedDefaultString" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(aStringArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + CoreTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as String + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } /** Returns the passed boolean, to test serialization and deserialization. */ fun echoNullableBool(aBoolArg: Boolean?, callback: (Result) -> Unit) { val channelName = @@ -2890,6 +2916,25 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { } } } + /** Returns the passed in string. */ + fun echoNamedNullableString(aNullableStringArg: String?, callback: (Result) -> Unit) { + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNamedNullableString" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(aNullableStringArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as String? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } /** * A no-op function taking no arguments and returning no value, to sanity test basic asynchronous * calling. 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 773b6e5c12e1..0645690c36eb 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 @@ -1866,6 +1866,8 @@ protocol FlutterIntegrationCoreApiProtocol { func echo(_ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], FlutterError>) -> Void) /// Returns the passed enum to test serialization and deserialization. func echo(_ anEnumArg: AnEnum, completion: @escaping (Result) -> Void) + /// Returns the default string. + func echoNamedDefault(_ aStringArg: String, completion: @escaping (Result) -> Void) /// Returns the passed boolean, to test serialization and deserialization. func echoNullable(_ aBoolArg: Bool?, completion: @escaping (Result) -> Void) /// Returns the passed int, to test serialization and deserialization. @@ -1882,6 +1884,8 @@ protocol FlutterIntegrationCoreApiProtocol { func echoNullable(_ aMapArg: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, FlutterError>) -> Void) /// Returns the passed enum to test serialization and deserialization. func echoNullable(_ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void) + /// Returns the passed in string. + func echoNamed(_ aNullableStringArg: String?, completion: @escaping (Result) -> Void) /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. func noopAsync(completion: @escaping (Result) -> Void) @@ -2197,6 +2201,28 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } } + /// Returns the default string. + func echoNamedDefault(_ aStringArg: String, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNamedDefaultString" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([aStringArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName:channelName))) + return + } + if (listResponse.count > 1) { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(FlutterError(code: code, message: message, details: details))); + } else if (listResponse[0] == nil) { + completion(.failure(FlutterError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! String + completion(.success(result)) + } + } + } /// Returns the passed boolean, to test serialization and deserialization. func echoNullable(_ aBoolArg: Bool?, completion: @escaping (Result) -> Void) { let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool" @@ -2357,6 +2383,26 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } } + /// Returns the passed in string. + func echoNamed(_ aNullableStringArg: String?, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNamedNullableString" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([aNullableStringArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName:channelName))) + return + } + if (listResponse.count > 1) { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(FlutterError(code: code, message: message, details: details))); + } else { + let result: String? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. func noopAsync(completion: @escaping (Result) -> Void) { 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 773b6e5c12e1..0645690c36eb 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 @@ -1866,6 +1866,8 @@ protocol FlutterIntegrationCoreApiProtocol { func echo(_ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], FlutterError>) -> Void) /// Returns the passed enum to test serialization and deserialization. func echo(_ anEnumArg: AnEnum, completion: @escaping (Result) -> Void) + /// Returns the default string. + func echoNamedDefault(_ aStringArg: String, completion: @escaping (Result) -> Void) /// Returns the passed boolean, to test serialization and deserialization. func echoNullable(_ aBoolArg: Bool?, completion: @escaping (Result) -> Void) /// Returns the passed int, to test serialization and deserialization. @@ -1882,6 +1884,8 @@ protocol FlutterIntegrationCoreApiProtocol { func echoNullable(_ aMapArg: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, FlutterError>) -> Void) /// Returns the passed enum to test serialization and deserialization. func echoNullable(_ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void) + /// Returns the passed in string. + func echoNamed(_ aNullableStringArg: String?, completion: @escaping (Result) -> Void) /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. func noopAsync(completion: @escaping (Result) -> Void) @@ -2197,6 +2201,28 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } } + /// Returns the default string. + func echoNamedDefault(_ aStringArg: String, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNamedDefaultString" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([aStringArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName:channelName))) + return + } + if (listResponse.count > 1) { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(FlutterError(code: code, message: message, details: details))); + } else if (listResponse[0] == nil) { + completion(.failure(FlutterError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! String + completion(.success(result)) + } + } + } /// Returns the passed boolean, to test serialization and deserialization. func echoNullable(_ aBoolArg: Bool?, completion: @escaping (Result) -> Void) { let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool" @@ -2357,6 +2383,26 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } } + /// Returns the passed in string. + func echoNamed(_ aNullableStringArg: String?, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNamedNullableString" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([aNullableStringArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName:channelName))) + return + } + if (listResponse.count > 1) { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(FlutterError(code: code, message: message, details: details))); + } else { + let result: String? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. func noopAsync(completion: @escaping (Result) -> Void) { 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 2ca7340b0ceb..554d7f7ceb79 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, do not edit directly. // See also: https://pub.dev/packages/pigeon @@ -26,51 +26,77 @@ using flutter::EncodableMap; using flutter::EncodableValue; FlutterError CreateConnectionError(const std::string channel_name) { - return FlutterError( - "channel-error", - "Unable to establish connection on channel: '" + channel_name + "'.", - EncodableValue("")); + return FlutterError( + "channel-error", + "Unable to establish connection on channel: '" + channel_name + "'.", + EncodableValue("")); } // AllTypes -AllTypes::AllTypes(bool a_bool, int64_t an_int, int64_t an_int64, - double a_double, const std::vector& a_byte_array, - const std::vector& a4_byte_array, - const std::vector& a8_byte_array, - const std::vector& a_float_array, - const EncodableList& a_list, const EncodableMap& a_map, - const AnEnum& an_enum, const std::string& a_string, - const EncodableValue& an_object) - : a_bool_(a_bool), - an_int_(an_int), - an_int64_(an_int64), - a_double_(a_double), - a_byte_array_(a_byte_array), - a4_byte_array_(a4_byte_array), - a8_byte_array_(a8_byte_array), - a_float_array_(a_float_array), - a_list_(a_list), - a_map_(a_map), - an_enum_(an_enum), - a_string_(a_string), - an_object_(an_object) {} +AllTypes::AllTypes( + bool a_bool, + int64_t an_int, + int64_t an_int64, + double a_double, + const std::vector& a_byte_array, + const std::vector& a4_byte_array, + const std::vector& a8_byte_array, + const std::vector& a_float_array, + const EncodableList& a_list, + const EncodableMap& a_map, + const AnEnum& an_enum, + const std::string& a_string, + const EncodableValue& an_object) + : a_bool_(a_bool), + an_int_(an_int), + an_int64_(an_int64), + a_double_(a_double), + a_byte_array_(a_byte_array), + a4_byte_array_(a4_byte_array), + a8_byte_array_(a8_byte_array), + a_float_array_(a_float_array), + a_list_(a_list), + a_map_(a_map), + an_enum_(an_enum), + a_string_(a_string), + an_object_(an_object) {} -bool AllTypes::a_bool() const { return a_bool_; } +bool AllTypes::a_bool() const { + return a_bool_; +} + +void AllTypes::set_a_bool(bool value_arg) { + a_bool_ = value_arg; +} + + +int64_t AllTypes::an_int() const { + return an_int_; +} + +void AllTypes::set_an_int(int64_t value_arg) { + an_int_ = value_arg; +} -void AllTypes::set_a_bool(bool value_arg) { a_bool_ = value_arg; } -int64_t AllTypes::an_int() const { return an_int_; } +int64_t AllTypes::an_int64() const { + return an_int64_; +} -void AllTypes::set_an_int(int64_t value_arg) { an_int_ = value_arg; } +void AllTypes::set_an_int64(int64_t value_arg) { + an_int64_ = value_arg; +} -int64_t AllTypes::an_int64() const { return an_int64_; } -void AllTypes::set_an_int64(int64_t value_arg) { an_int64_ = value_arg; } +double AllTypes::a_double() const { + return a_double_; +} -double AllTypes::a_double() const { return a_double_; } +void AllTypes::set_a_double(double value_arg) { + a_double_ = value_arg; +} -void AllTypes::set_a_double(double value_arg) { a_double_ = value_arg; } const std::vector& AllTypes::a_byte_array() const { return a_byte_array_; @@ -80,6 +106,7 @@ void AllTypes::set_a_byte_array(const std::vector& value_arg) { a_byte_array_ = value_arg; } + const std::vector& AllTypes::a4_byte_array() const { return a4_byte_array_; } @@ -88,6 +115,7 @@ void AllTypes::set_a4_byte_array(const std::vector& value_arg) { a4_byte_array_ = value_arg; } + const std::vector& AllTypes::a8_byte_array() const { return a8_byte_array_; } @@ -96,6 +124,7 @@ void AllTypes::set_a8_byte_array(const std::vector& value_arg) { a8_byte_array_ = value_arg; } + const std::vector& AllTypes::a_float_array() const { return a_float_array_; } @@ -104,32 +133,52 @@ 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_; } + +const EncodableList& AllTypes::a_list() const { + return a_list_; +} 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; } +const EncodableMap& AllTypes::a_map() const { + return a_map_; +} + +void AllTypes::set_a_map(const EncodableMap& value_arg) { + a_map_ = value_arg; +} + + +const AnEnum& AllTypes::an_enum() const { + return an_enum_; +} -const AnEnum& AllTypes::an_enum() const { return an_enum_; } +void AllTypes::set_an_enum(const AnEnum& value_arg) { + an_enum_ = value_arg; +} -void AllTypes::set_an_enum(const AnEnum& value_arg) { an_enum_ = value_arg; } -const std::string& AllTypes::a_string() const { return a_string_; } +const std::string& AllTypes::a_string() const { + return a_string_; +} void AllTypes::set_a_string(std::string_view value_arg) { a_string_ = value_arg; } -const EncodableValue& AllTypes::an_object() const { return an_object_; } + +const EncodableValue& AllTypes::an_object() const { + return an_object_; +} void AllTypes::set_an_object(const EncodableValue& value_arg) { an_object_ = value_arg; } + EncodableList AllTypes::ToEncodableList() const { EncodableList list; list.reserve(13); @@ -151,13 +200,19 @@ EncodableList AllTypes::ToEncodableList() const { AllTypes AllTypes::FromEncodableList(const EncodableList& list) { AllTypes decoded( - std::get(list[0]), list[1].LongValue(), list[2].LongValue(), - std::get(list[3]), std::get>(list[4]), - std::get>(list[5]), - std::get>(list[6]), - std::get>(list[7]), std::get(list[8]), - std::get(list[9]), (AnEnum)(std::get(list[10])), - std::get(list[11]), list[12]); + std::get(list[0]), + list[1].LongValue(), + list[2].LongValue(), + std::get(list[3]), + std::get>(list[4]), + std::get>(list[5]), + std::get>(list[6]), + std::get>(list[7]), + std::get(list[8]), + std::get(list[9]), + (AnEnum)(std::get(list[10])), + std::get(list[11]), + list[12]); return decoded; } @@ -166,69 +221,38 @@ AllTypes AllTypes::FromEncodableList(const EncodableList& list) { AllNullableTypes::AllNullableTypes() {} AllNullableTypes::AllNullableTypes( - const bool* a_nullable_bool, const int64_t* a_nullable_int, - const int64_t* a_nullable_int64, const double* a_nullable_double, - const std::vector* a_nullable_byte_array, - const std::vector* a_nullable4_byte_array, - const std::vector* a_nullable8_byte_array, - const std::vector* a_nullable_float_array, - const EncodableList* a_nullable_list, const EncodableMap* a_nullable_map, - const EncodableList* nullable_nested_list, - const EncodableMap* nullable_map_with_annotations, - const EncodableMap* nullable_map_with_object, const AnEnum* a_nullable_enum, - const std::string* a_nullable_string, - const EncodableValue* a_nullable_object) - : a_nullable_bool_(a_nullable_bool ? std::optional(*a_nullable_bool) - : std::nullopt), - a_nullable_int_(a_nullable_int ? std::optional(*a_nullable_int) - : std::nullopt), - a_nullable_int64_(a_nullable_int64 - ? std::optional(*a_nullable_int64) - : std::nullopt), - a_nullable_double_(a_nullable_double - ? std::optional(*a_nullable_double) - : std::nullopt), - a_nullable_byte_array_( - a_nullable_byte_array - ? std::optional>(*a_nullable_byte_array) - : std::nullopt), - a_nullable4_byte_array_( - a_nullable4_byte_array - ? std::optional>(*a_nullable4_byte_array) - : std::nullopt), - a_nullable8_byte_array_( - a_nullable8_byte_array - ? std::optional>(*a_nullable8_byte_array) - : std::nullopt), - a_nullable_float_array_( - a_nullable_float_array - ? std::optional>(*a_nullable_float_array) - : std::nullopt), - a_nullable_list_(a_nullable_list - ? std::optional(*a_nullable_list) - : std::nullopt), - a_nullable_map_(a_nullable_map - ? std::optional(*a_nullable_map) - : std::nullopt), - nullable_nested_list_(nullable_nested_list ? std::optional( - *nullable_nested_list) - : std::nullopt), - nullable_map_with_annotations_( - nullable_map_with_annotations - ? std::optional(*nullable_map_with_annotations) - : std::nullopt), - nullable_map_with_object_( - nullable_map_with_object - ? std::optional(*nullable_map_with_object) - : std::nullopt), - a_nullable_enum_(a_nullable_enum ? std::optional(*a_nullable_enum) - : std::nullopt), - a_nullable_string_(a_nullable_string - ? std::optional(*a_nullable_string) - : std::nullopt), - a_nullable_object_(a_nullable_object - ? std::optional(*a_nullable_object) - : std::nullopt) {} + const bool* a_nullable_bool, + const int64_t* a_nullable_int, + const int64_t* a_nullable_int64, + const double* a_nullable_double, + const std::vector* a_nullable_byte_array, + const std::vector* a_nullable4_byte_array, + const std::vector* a_nullable8_byte_array, + const std::vector* a_nullable_float_array, + const EncodableList* a_nullable_list, + const EncodableMap* a_nullable_map, + const EncodableList* nullable_nested_list, + const EncodableMap* nullable_map_with_annotations, + const EncodableMap* nullable_map_with_object, + const AnEnum* a_nullable_enum, + const std::string* a_nullable_string, + const EncodableValue* a_nullable_object) + : a_nullable_bool_(a_nullable_bool ? std::optional(*a_nullable_bool) : std::nullopt), + a_nullable_int_(a_nullable_int ? std::optional(*a_nullable_int) : std::nullopt), + a_nullable_int64_(a_nullable_int64 ? std::optional(*a_nullable_int64) : std::nullopt), + a_nullable_double_(a_nullable_double ? std::optional(*a_nullable_double) : std::nullopt), + a_nullable_byte_array_(a_nullable_byte_array ? std::optional>(*a_nullable_byte_array) : std::nullopt), + a_nullable4_byte_array_(a_nullable4_byte_array ? std::optional>(*a_nullable4_byte_array) : std::nullopt), + a_nullable8_byte_array_(a_nullable8_byte_array ? std::optional>(*a_nullable8_byte_array) : std::nullopt), + a_nullable_float_array_(a_nullable_float_array ? std::optional>(*a_nullable_float_array) : std::nullopt), + a_nullable_list_(a_nullable_list ? std::optional(*a_nullable_list) : std::nullopt), + a_nullable_map_(a_nullable_map ? std::optional(*a_nullable_map) : std::nullopt), + nullable_nested_list_(nullable_nested_list ? std::optional(*nullable_nested_list) : std::nullopt), + nullable_map_with_annotations_(nullable_map_with_annotations ? std::optional(*nullable_map_with_annotations) : std::nullopt), + nullable_map_with_object_(nullable_map_with_object ? std::optional(*nullable_map_with_object) : std::nullopt), + a_nullable_enum_(a_nullable_enum ? std::optional(*a_nullable_enum) : std::nullopt), + a_nullable_string_(a_nullable_string ? std::optional(*a_nullable_string) : std::nullopt), + a_nullable_object_(a_nullable_object ? std::optional(*a_nullable_object) : std::nullopt) {} const bool* AllNullableTypes::a_nullable_bool() const { return a_nullable_bool_ ? &(*a_nullable_bool_) : nullptr; @@ -242,265 +266,225 @@ void AllNullableTypes::set_a_nullable_bool(bool value_arg) { a_nullable_bool_ = value_arg; } + const int64_t* AllNullableTypes::a_nullable_int() const { return a_nullable_int_ ? &(*a_nullable_int_) : nullptr; } void AllNullableTypes::set_a_nullable_int(const int64_t* value_arg) { - a_nullable_int_ = - value_arg ? std::optional(*value_arg) : std::nullopt; + a_nullable_int_ = value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_a_nullable_int(int64_t value_arg) { a_nullable_int_ = value_arg; } + const int64_t* AllNullableTypes::a_nullable_int64() const { return a_nullable_int64_ ? &(*a_nullable_int64_) : nullptr; } void AllNullableTypes::set_a_nullable_int64(const int64_t* value_arg) { - a_nullable_int64_ = - value_arg ? std::optional(*value_arg) : std::nullopt; + a_nullable_int64_ = value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_a_nullable_int64(int64_t value_arg) { a_nullable_int64_ = value_arg; } + const double* AllNullableTypes::a_nullable_double() const { return a_nullable_double_ ? &(*a_nullable_double_) : nullptr; } void AllNullableTypes::set_a_nullable_double(const double* value_arg) { - a_nullable_double_ = - value_arg ? std::optional(*value_arg) : std::nullopt; + a_nullable_double_ = value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_a_nullable_double(double value_arg) { a_nullable_double_ = value_arg; } + const std::vector* AllNullableTypes::a_nullable_byte_array() const { return a_nullable_byte_array_ ? &(*a_nullable_byte_array_) : nullptr; } -void AllNullableTypes::set_a_nullable_byte_array( - const std::vector* value_arg) { - a_nullable_byte_array_ = value_arg - ? std::optional>(*value_arg) - : std::nullopt; +void AllNullableTypes::set_a_nullable_byte_array(const std::vector* value_arg) { + a_nullable_byte_array_ = value_arg ? std::optional>(*value_arg) : std::nullopt; } -void AllNullableTypes::set_a_nullable_byte_array( - const std::vector& value_arg) { +void AllNullableTypes::set_a_nullable_byte_array(const std::vector& value_arg) { a_nullable_byte_array_ = value_arg; } + const std::vector* AllNullableTypes::a_nullable4_byte_array() const { return a_nullable4_byte_array_ ? &(*a_nullable4_byte_array_) : nullptr; } -void AllNullableTypes::set_a_nullable4_byte_array( - const std::vector* value_arg) { - a_nullable4_byte_array_ = - value_arg ? std::optional>(*value_arg) - : std::nullopt; +void AllNullableTypes::set_a_nullable4_byte_array(const std::vector* value_arg) { + a_nullable4_byte_array_ = value_arg ? std::optional>(*value_arg) : std::nullopt; } -void AllNullableTypes::set_a_nullable4_byte_array( - const std::vector& value_arg) { +void AllNullableTypes::set_a_nullable4_byte_array(const std::vector& value_arg) { a_nullable4_byte_array_ = value_arg; } + const std::vector* AllNullableTypes::a_nullable8_byte_array() const { return a_nullable8_byte_array_ ? &(*a_nullable8_byte_array_) : nullptr; } -void AllNullableTypes::set_a_nullable8_byte_array( - const std::vector* value_arg) { - a_nullable8_byte_array_ = - value_arg ? std::optional>(*value_arg) - : std::nullopt; +void AllNullableTypes::set_a_nullable8_byte_array(const std::vector* value_arg) { + a_nullable8_byte_array_ = value_arg ? std::optional>(*value_arg) : std::nullopt; } -void AllNullableTypes::set_a_nullable8_byte_array( - const std::vector& value_arg) { +void AllNullableTypes::set_a_nullable8_byte_array(const std::vector& value_arg) { a_nullable8_byte_array_ = value_arg; } + const std::vector* AllNullableTypes::a_nullable_float_array() const { return a_nullable_float_array_ ? &(*a_nullable_float_array_) : nullptr; } -void AllNullableTypes::set_a_nullable_float_array( - const std::vector* value_arg) { - a_nullable_float_array_ = - value_arg ? std::optional>(*value_arg) : std::nullopt; +void AllNullableTypes::set_a_nullable_float_array(const std::vector* value_arg) { + a_nullable_float_array_ = value_arg ? std::optional>(*value_arg) : std::nullopt; } -void AllNullableTypes::set_a_nullable_float_array( - const std::vector& value_arg) { +void AllNullableTypes::set_a_nullable_float_array(const std::vector& value_arg) { a_nullable_float_array_ = value_arg; } + const EncodableList* AllNullableTypes::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; + 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; + 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 ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypes::set_nullable_nested_list( - const EncodableList& value_arg) { +void AllNullableTypes::set_nullable_nested_list(const EncodableList& value_arg) { nullable_nested_list_ = value_arg; } + const EncodableMap* AllNullableTypes::nullable_map_with_annotations() const { - return nullable_map_with_annotations_ ? &(*nullable_map_with_annotations_) - : nullptr; + return nullable_map_with_annotations_ ? &(*nullable_map_with_annotations_) : nullptr; } -void AllNullableTypes::set_nullable_map_with_annotations( - const EncodableMap* value_arg) { - nullable_map_with_annotations_ = - value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypes::set_nullable_map_with_annotations(const EncodableMap* value_arg) { + nullable_map_with_annotations_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypes::set_nullable_map_with_annotations( - const EncodableMap& value_arg) { +void AllNullableTypes::set_nullable_map_with_annotations(const EncodableMap& value_arg) { nullable_map_with_annotations_ = value_arg; } + const EncodableMap* AllNullableTypes::nullable_map_with_object() const { return nullable_map_with_object_ ? &(*nullable_map_with_object_) : nullptr; } -void AllNullableTypes::set_nullable_map_with_object( - const EncodableMap* value_arg) { - nullable_map_with_object_ = - value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypes::set_nullable_map_with_object(const EncodableMap* value_arg) { + nullable_map_with_object_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypes::set_nullable_map_with_object( - const EncodableMap& value_arg) { +void AllNullableTypes::set_nullable_map_with_object(const EncodableMap& value_arg) { nullable_map_with_object_ = value_arg; } + const AnEnum* AllNullableTypes::a_nullable_enum() const { return a_nullable_enum_ ? &(*a_nullable_enum_) : nullptr; } void AllNullableTypes::set_a_nullable_enum(const AnEnum* value_arg) { - a_nullable_enum_ = - value_arg ? std::optional(*value_arg) : std::nullopt; + a_nullable_enum_ = value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_a_nullable_enum(const AnEnum& value_arg) { a_nullable_enum_ = value_arg; } + const std::string* AllNullableTypes::a_nullable_string() const { return a_nullable_string_ ? &(*a_nullable_string_) : nullptr; } -void AllNullableTypes::set_a_nullable_string( - const std::string_view* value_arg) { - a_nullable_string_ = - value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypes::set_a_nullable_string(const std::string_view* value_arg) { + a_nullable_string_ = value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_a_nullable_string(std::string_view value_arg) { a_nullable_string_ = value_arg; } + const EncodableValue* AllNullableTypes::a_nullable_object() const { return a_nullable_object_ ? &(*a_nullable_object_) : nullptr; } void AllNullableTypes::set_a_nullable_object(const EncodableValue* value_arg) { - a_nullable_object_ = - value_arg ? std::optional(*value_arg) : std::nullopt; + a_nullable_object_ = value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_a_nullable_object(const EncodableValue& value_arg) { a_nullable_object_ = value_arg; } + EncodableList AllNullableTypes::ToEncodableList() const { EncodableList list; list.reserve(16); - list.push_back(a_nullable_bool_ ? EncodableValue(*a_nullable_bool_) - : EncodableValue()); - list.push_back(a_nullable_int_ ? EncodableValue(*a_nullable_int_) - : EncodableValue()); - list.push_back(a_nullable_int64_ ? EncodableValue(*a_nullable_int64_) - : EncodableValue()); - list.push_back(a_nullable_double_ ? EncodableValue(*a_nullable_double_) - : EncodableValue()); - list.push_back(a_nullable_byte_array_ - ? EncodableValue(*a_nullable_byte_array_) - : EncodableValue()); - list.push_back(a_nullable4_byte_array_ - ? EncodableValue(*a_nullable4_byte_array_) - : EncodableValue()); - list.push_back(a_nullable8_byte_array_ - ? EncodableValue(*a_nullable8_byte_array_) - : EncodableValue()); - list.push_back(a_nullable_float_array_ - ? EncodableValue(*a_nullable_float_array_) - : EncodableValue()); - list.push_back(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_int64_ ? EncodableValue(*a_nullable_int64_) : EncodableValue()); + list.push_back(a_nullable_double_ ? EncodableValue(*a_nullable_double_) : EncodableValue()); + list.push_back(a_nullable_byte_array_ ? EncodableValue(*a_nullable_byte_array_) : EncodableValue()); + list.push_back(a_nullable4_byte_array_ ? EncodableValue(*a_nullable4_byte_array_) : EncodableValue()); + list.push_back(a_nullable8_byte_array_ ? EncodableValue(*a_nullable8_byte_array_) : EncodableValue()); + list.push_back(a_nullable_float_array_ ? EncodableValue(*a_nullable_float_array_) : EncodableValue()); + list.push_back(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_object_ ? *a_nullable_object_ : EncodableValue()); return list; } -AllNullableTypes AllNullableTypes::FromEncodableList( - const EncodableList& list) { +AllNullableTypes AllNullableTypes::FromEncodableList(const EncodableList& list) { AllNullableTypes decoded; auto& encodable_a_nullable_bool = list[0]; if (!encodable_a_nullable_bool.IsNull()) { @@ -516,63 +500,51 @@ AllNullableTypes AllNullableTypes::FromEncodableList( } auto& encodable_a_nullable_double = list[3]; if (!encodable_a_nullable_double.IsNull()) { - decoded.set_a_nullable_double( - std::get(encodable_a_nullable_double)); + decoded.set_a_nullable_double(std::get(encodable_a_nullable_double)); } auto& encodable_a_nullable_byte_array = list[4]; if (!encodable_a_nullable_byte_array.IsNull()) { - decoded.set_a_nullable_byte_array( - std::get>(encodable_a_nullable_byte_array)); + decoded.set_a_nullable_byte_array(std::get>(encodable_a_nullable_byte_array)); } auto& encodable_a_nullable4_byte_array = list[5]; if (!encodable_a_nullable4_byte_array.IsNull()) { - decoded.set_a_nullable4_byte_array( - std::get>(encodable_a_nullable4_byte_array)); + decoded.set_a_nullable4_byte_array(std::get>(encodable_a_nullable4_byte_array)); } auto& encodable_a_nullable8_byte_array = list[6]; if (!encodable_a_nullable8_byte_array.IsNull()) { - decoded.set_a_nullable8_byte_array( - std::get>(encodable_a_nullable8_byte_array)); + decoded.set_a_nullable8_byte_array(std::get>(encodable_a_nullable8_byte_array)); } auto& encodable_a_nullable_float_array = list[7]; if (!encodable_a_nullable_float_array.IsNull()) { - decoded.set_a_nullable_float_array( - std::get>(encodable_a_nullable_float_array)); + decoded.set_a_nullable_float_array(std::get>(encodable_a_nullable_float_array)); } auto& encodable_a_nullable_list = list[8]; if (!encodable_a_nullable_list.IsNull()) { - decoded.set_a_nullable_list( - std::get(encodable_a_nullable_list)); + decoded.set_a_nullable_list(std::get(encodable_a_nullable_list)); } auto& encodable_a_nullable_map = list[9]; if (!encodable_a_nullable_map.IsNull()) { - decoded.set_a_nullable_map( - std::get(encodable_a_nullable_map)); + decoded.set_a_nullable_map(std::get(encodable_a_nullable_map)); } auto& encodable_nullable_nested_list = list[10]; if (!encodable_nullable_nested_list.IsNull()) { - decoded.set_nullable_nested_list( - std::get(encodable_nullable_nested_list)); + decoded.set_nullable_nested_list(std::get(encodable_nullable_nested_list)); } auto& encodable_nullable_map_with_annotations = list[11]; if (!encodable_nullable_map_with_annotations.IsNull()) { - decoded.set_nullable_map_with_annotations( - std::get(encodable_nullable_map_with_annotations)); + decoded.set_nullable_map_with_annotations(std::get(encodable_nullable_map_with_annotations)); } auto& encodable_nullable_map_with_object = list[12]; if (!encodable_nullable_map_with_object.IsNull()) { - decoded.set_nullable_map_with_object( - std::get(encodable_nullable_map_with_object)); + decoded.set_nullable_map_with_object(std::get(encodable_nullable_map_with_object)); } auto& encodable_a_nullable_enum = list[13]; if (!encodable_a_nullable_enum.IsNull()) { - decoded.set_a_nullable_enum( - (AnEnum)(std::get(encodable_a_nullable_enum))); + decoded.set_a_nullable_enum((AnEnum)(std::get(encodable_a_nullable_enum))); } auto& encodable_a_nullable_string = list[14]; if (!encodable_a_nullable_string.IsNull()) { - decoded.set_a_nullable_string( - std::get(encodable_a_nullable_string)); + decoded.set_a_nullable_string(std::get(encodable_a_nullable_string)); } auto& encodable_a_nullable_object = list[15]; if (!encodable_a_nullable_object.IsNull()) { @@ -584,23 +556,23 @@ AllNullableTypes AllNullableTypes::FromEncodableList( // AllClassesWrapper AllClassesWrapper::AllClassesWrapper(const AllNullableTypes& all_nullable_types) - : all_nullable_types_(all_nullable_types) {} + : all_nullable_types_(all_nullable_types) {} -AllClassesWrapper::AllClassesWrapper(const AllNullableTypes& all_nullable_types, - const AllTypes* all_types) - : all_nullable_types_(all_nullable_types), - all_types_(all_types ? std::optional(*all_types) - : std::nullopt) {} +AllClassesWrapper::AllClassesWrapper( + const AllNullableTypes& all_nullable_types, + const AllTypes* all_types) + : all_nullable_types_(all_nullable_types), + all_types_(all_types ? std::optional(*all_types) : std::nullopt) {} const AllNullableTypes& AllClassesWrapper::all_nullable_types() const { return all_nullable_types_; } -void AllClassesWrapper::set_all_nullable_types( - const AllNullableTypes& value_arg) { +void AllClassesWrapper::set_all_nullable_types(const AllNullableTypes& value_arg) { all_nullable_types_ = value_arg; } + const AllTypes* AllClassesWrapper::all_types() const { return all_types_ ? &(*all_types_) : nullptr; } @@ -613,23 +585,21 @@ void AllClassesWrapper::set_all_types(const AllTypes& value_arg) { all_types_ = value_arg; } + EncodableList AllClassesWrapper::ToEncodableList() const { EncodableList list; list.reserve(2); list.push_back(EncodableValue(all_nullable_types_.ToEncodableList())); - list.push_back(all_types_ ? EncodableValue(all_types_->ToEncodableList()) - : EncodableValue()); + list.push_back(all_types_ ? EncodableValue(all_types_->ToEncodableList()) : EncodableValue()); return list; } -AllClassesWrapper AllClassesWrapper::FromEncodableList( - const EncodableList& list) { +AllClassesWrapper AllClassesWrapper::FromEncodableList(const EncodableList& list) { AllClassesWrapper decoded( - AllNullableTypes::FromEncodableList(std::get(list[0]))); + AllNullableTypes::FromEncodableList(std::get(list[0]))); auto& encodable_all_types = list[1]; if (!encodable_all_types.IsNull()) { - decoded.set_all_types(AllTypes::FromEncodableList( - std::get(encodable_all_types))); + decoded.set_all_types(AllTypes::FromEncodableList(std::get(encodable_all_types))); } return decoded; } @@ -639,22 +609,21 @@ AllClassesWrapper AllClassesWrapper::FromEncodableList( TestMessage::TestMessage() {} TestMessage::TestMessage(const EncodableList* test_list) - : test_list_(test_list ? std::optional(*test_list) - : std::nullopt) {} + : test_list_(test_list ? std::optional(*test_list) : std::nullopt) {} const EncodableList* TestMessage::test_list() const { return test_list_ ? &(*test_list_) : nullptr; } void TestMessage::set_test_list(const EncodableList* value_arg) { - test_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; + test_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; } void TestMessage::set_test_list(const EncodableList& value_arg) { test_list_ = value_arg; } + EncodableList TestMessage::ToEncodableList() const { EncodableList list; list.reserve(1); @@ -671,61 +640,48 @@ TestMessage TestMessage::FromEncodableList(const EncodableList& list) { return decoded; } -HostIntegrationCoreApiCodecSerializer::HostIntegrationCoreApiCodecSerializer() { -} + +HostIntegrationCoreApiCodecSerializer::HostIntegrationCoreApiCodecSerializer() {} EncodableValue HostIntegrationCoreApiCodecSerializer::ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const { + uint8_t type, + flutter::ByteStreamReader* stream) const { switch (type) { case 128: - return CustomEncodableValue(AllClassesWrapper::FromEncodableList( - std::get(ReadValue(stream)))); + return CustomEncodableValue(AllClassesWrapper::FromEncodableList(std::get(ReadValue(stream)))); case 129: - return CustomEncodableValue(AllNullableTypes::FromEncodableList( - std::get(ReadValue(stream)))); + return CustomEncodableValue(AllNullableTypes::FromEncodableList(std::get(ReadValue(stream)))); case 130: - return CustomEncodableValue(AllTypes::FromEncodableList( - std::get(ReadValue(stream)))); + return CustomEncodableValue(AllTypes::FromEncodableList(std::get(ReadValue(stream)))); case 131: - return CustomEncodableValue(TestMessage::FromEncodableList( - std::get(ReadValue(stream)))); + return CustomEncodableValue(TestMessage::FromEncodableList(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)) { + const EncodableValue& value, + flutter::ByteStreamWriter* stream) const { + if (const CustomEncodableValue* custom_value = std::get_if(&value)) { if (custom_value->type() == typeid(AllClassesWrapper)) { 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(AllNullableTypes)) { 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; } } @@ -734,4009 +690,3028 @@ void HostIntegrationCoreApiCodecSerializer::WriteValue( /// The codec used by HostIntegrationCoreApi. const flutter::StandardMessageCodec& HostIntegrationCoreApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &HostIntegrationCoreApiCodecSerializer::GetInstance()); + 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) { +// 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.pigeon_integration_tests.HostIntegrationCoreApi." - "noop", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAllTypes", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "throwError", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "throwErrorFromVoid", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - "throwFlutterError", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError", &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - ErrorOr> output = - api->ThrowFlutterError(); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel->SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + ErrorOr> output = api->ThrowFlutterError(); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoInt", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoDouble", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoBool", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoString", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoUint8List", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoObject", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoList", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoMap", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoClassWrapper", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper", &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_wrapper_arg = args.at(0); - if (encodable_wrapper_arg.IsNull()) { - reply(WrapError("wrapper_arg unexpectedly null.")); - return; - } - const auto& wrapper_arg = std::any_cast( - std::get(encodable_wrapper_arg)); - ErrorOr output = - api->EchoClassWrapper(wrapper_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel->SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_wrapper_arg = args.at(0); + if (encodable_wrapper_arg.IsNull()) { + reply(WrapError("wrapper_arg unexpectedly null.")); + return; + } + const auto& wrapper_arg = std::any_cast(std::get(encodable_wrapper_arg)); + ErrorOr output = api->EchoClassWrapper(wrapper_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoEnum", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum", &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - if (encodable_an_enum_arg.IsNull()) { - reply(WrapError("an_enum_arg unexpectedly null.")); - return; - } - const AnEnum& an_enum_arg = - (AnEnum)encodable_an_enum_arg.LongValue(); - ErrorOr output = api->EchoEnum(an_enum_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue((int)std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel->SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_enum_arg = args.at(0); + if (encodable_an_enum_arg.IsNull()) { + reply(WrapError("an_enum_arg unexpectedly null.")); + return; + } + const AnEnum& an_enum_arg = (AnEnum)encodable_an_enum_arg.LongValue(); + ErrorOr output = api->EchoEnum(an_enum_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue((int) 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNamedDefaultString", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString", &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_string_arg = args.at(0); - if (encodable_a_string_arg.IsNull()) { - reply(WrapError("a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = - std::get(encodable_a_string_arg); - ErrorOr output = - api->EchoNamedDefaultString(a_string_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel->SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_string_arg = args.at(0); + if (encodable_a_string_arg.IsNull()) { + reply(WrapError("a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = std::get(encodable_a_string_arg); + ErrorOr output = api->EchoNamedDefaultString(a_string_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoOptionalDefaultDouble", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble", &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_double_arg = args.at(0); - if (encodable_a_double_arg.IsNull()) { - reply(WrapError("a_double_arg unexpectedly null.")); - return; - } - const auto& a_double_arg = - std::get(encodable_a_double_arg); - ErrorOr output = - api->EchoOptionalDefaultDouble(a_double_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel->SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_double_arg = args.at(0); + if (encodable_a_double_arg.IsNull()) { + reply(WrapError("a_double_arg unexpectedly null.")); + return; + } + const auto& a_double_arg = std::get(encodable_a_double_arg); + ErrorOr output = api->EchoOptionalDefaultDouble(a_double_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoRequiredInt", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt", &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_int_arg = args.at(0); - if (encodable_an_int_arg.IsNull()) { - reply(WrapError("an_int_arg unexpectedly null.")); - return; - } - const int64_t an_int_arg = encodable_an_int_arg.LongValue(); - ErrorOr output = api->EchoRequiredInt(an_int_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel->SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_int_arg = args.at(0); + if (encodable_an_int_arg.IsNull()) { + reply(WrapError("an_int_arg unexpectedly null.")); + return; + } + const int64_t an_int_arg = encodable_an_int_arg.LongValue(); + ErrorOr output = api->EchoRequiredInt(an_int_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAllNullableTypes", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "extractNestedNullableString", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "createNestedNullableString", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "sendMultipleNullableTypes", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableInt", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableDouble", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableBool", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableString", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableUint8List", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableObject", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableList", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableMap", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableEnum", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum", &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - const int64_t an_enum_arg_value = - encodable_an_enum_arg.IsNull() - ? 0 - : encodable_an_enum_arg.LongValue(); - const auto an_enum_arg = - encodable_an_enum_arg.IsNull() - ? std::nullopt - : std::make_optional( - static_cast(an_enum_arg_value)); - ErrorOr> output = api->EchoNullableEnum( - an_enum_arg ? &(*an_enum_arg) : nullptr); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue((int)std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel->SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_enum_arg = args.at(0); + const int64_t an_enum_arg_value = encodable_an_enum_arg.IsNull() ? 0 : encodable_an_enum_arg.LongValue(); + const auto an_enum_arg = encodable_an_enum_arg.IsNull() ? std::nullopt : std::make_optional(static_cast(an_enum_arg_value)); + ErrorOr> output = api->EchoNullableEnum(an_enum_arg ? &(*an_enum_arg) : nullptr); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue((int) 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoOptionalNullableInt", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt", &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_int_arg = args.at(0); - const int64_t a_nullable_int_arg_value = - encodable_a_nullable_int_arg.IsNull() - ? 0 - : encodable_a_nullable_int_arg.LongValue(); - const auto* a_nullable_int_arg = - encodable_a_nullable_int_arg.IsNull() - ? nullptr - : &a_nullable_int_arg_value; - ErrorOr> output = - api->EchoOptionalNullableInt(a_nullable_int_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel->SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_int_arg = args.at(0); + const int64_t a_nullable_int_arg_value = encodable_a_nullable_int_arg.IsNull() ? 0 : encodable_a_nullable_int_arg.LongValue(); + const auto* a_nullable_int_arg = encodable_a_nullable_int_arg.IsNull() ? nullptr : &a_nullable_int_arg_value; + ErrorOr> output = api->EchoOptionalNullableInt(a_nullable_int_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNamedNullableString", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString", &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_string_arg = args.at(0); - const auto* a_nullable_string_arg = - std::get_if(&encodable_a_nullable_string_arg); - ErrorOr> output = - api->EchoNamedNullableString(a_nullable_string_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel->SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_string_arg = args.at(0); + const auto* a_nullable_string_arg = std::get_if(&encodable_a_nullable_string_arg); + ErrorOr> output = api->EchoNamedNullableString(a_nullable_string_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "noopAsync", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncInt", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncDouble", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncBool", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncString", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncUint8List", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncObject", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncList", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncMap", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncEnum", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum", &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - if (encodable_an_enum_arg.IsNull()) { - reply(WrapError("an_enum_arg unexpectedly null.")); - return; - } - const AnEnum& an_enum_arg = - (AnEnum)encodable_an_enum_arg.LongValue(); - api->EchoAsyncEnum( - an_enum_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue((int)std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel->SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_enum_arg = args.at(0); + if (encodable_an_enum_arg.IsNull()) { + reply(WrapError("an_enum_arg unexpectedly null.")); + return; + } + const AnEnum& an_enum_arg = (AnEnum)encodable_an_enum_arg.LongValue(); + api->EchoAsyncEnum(an_enum_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue((int) 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.pigeon_integration_tests.HostIntegrationCoreApi." - "throwAsyncError", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "throwAsyncErrorFromVoid", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - "throwAsyncFlutterError", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError", &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - api->ThrowAsyncFlutterError( - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel->SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + api->ThrowAsyncFlutterError([reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); } + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncAllTypes", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableAllNullableTypes", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableInt", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableDouble", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableBool", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableString", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableUint8List", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableObject", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableList", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableMap", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableEnum", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum", &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - const int64_t an_enum_arg_value = - encodable_an_enum_arg.IsNull() - ? 0 - : encodable_an_enum_arg.LongValue(); - const auto an_enum_arg = - encodable_an_enum_arg.IsNull() - ? std::nullopt - : std::make_optional( - static_cast(an_enum_arg_value)); - api->EchoAsyncNullableEnum( - an_enum_arg ? &(*an_enum_arg) : nullptr, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue( - (int)std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel->SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_enum_arg = args.at(0); + const int64_t an_enum_arg_value = encodable_an_enum_arg.IsNull() ? 0 : encodable_an_enum_arg.LongValue(); + const auto an_enum_arg = encodable_an_enum_arg.IsNull() ? std::nullopt : std::make_optional(static_cast(an_enum_arg_value)); + api->EchoAsyncNullableEnum(an_enum_arg ? &(*an_enum_arg) : nullptr, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue((int) 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterNoop", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterThrowError", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterThrowErrorFromVoid", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoAllTypes", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoAllNullableTypes", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes", &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->CallFlutterEchoAllNullableTypes( - everything_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(CustomEncodableValue( - std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel->SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_everything_arg = args.at(0); + const auto* everything_arg = &(std::any_cast(std::get(encodable_everything_arg))); + api->CallFlutterEchoAllNullableTypes(everything_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(CustomEncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterSendMultipleNullableTypes", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoBool", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoInt", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoDouble", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoString", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoUint8List", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoList", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoMap", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoEnum", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum", &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - if (encodable_an_enum_arg.IsNull()) { - reply(WrapError("an_enum_arg unexpectedly null.")); - return; - } - const AnEnum& an_enum_arg = - (AnEnum)encodable_an_enum_arg.LongValue(); - api->CallFlutterEchoEnum( - an_enum_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue((int)std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel->SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_enum_arg = args.at(0); + if (encodable_an_enum_arg.IsNull()) { + reply(WrapError("an_enum_arg unexpectedly null.")); + return; + } + const AnEnum& an_enum_arg = (AnEnum)encodable_an_enum_arg.LongValue(); + api->CallFlutterEchoEnum(an_enum_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue((int) 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableBool", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableInt", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableDouble", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableString", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableUint8List", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableList", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); + 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.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableMap", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); + 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); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableEnum", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum", &GetCodec()); if (api != nullptr) { - channel->SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - const int64_t an_enum_arg_value = - encodable_an_enum_arg.IsNull() - ? 0 - : encodable_an_enum_arg.LongValue(); - const auto an_enum_arg = - encodable_an_enum_arg.IsNull() - ? std::nullopt - : std::make_optional( - static_cast(an_enum_arg_value)); - api->CallFlutterEchoNullableEnum( - an_enum_arg ? &(*an_enum_arg) : nullptr, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue( - (int)std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel->SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_enum_arg = args.at(0); + const int64_t an_enum_arg_value = encodable_an_enum_arg.IsNull() ? 0 : encodable_an_enum_arg.LongValue(); + const auto an_enum_arg = encodable_an_enum_arg.IsNull() ? std::nullopt : std::make_optional(static_cast(an_enum_arg_value)); + api->CallFlutterEchoNullableEnum(an_enum_arg ? &(*an_enum_arg) : nullptr, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue((int) 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.code()), - EncodableValue(error.message()), - error.details()}); + return EncodableValue(EncodableList{ + EncodableValue(error.code()), + EncodableValue(error.message()), + error.details() + }); } -FlutterIntegrationCoreApiCodecSerializer:: - FlutterIntegrationCoreApiCodecSerializer() {} + +FlutterIntegrationCoreApiCodecSerializer::FlutterIntegrationCoreApiCodecSerializer() {} EncodableValue FlutterIntegrationCoreApiCodecSerializer::ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const { + uint8_t type, + flutter::ByteStreamReader* stream) const { switch (type) { case 128: - return CustomEncodableValue(AllClassesWrapper::FromEncodableList( - std::get(ReadValue(stream)))); + return CustomEncodableValue(AllClassesWrapper::FromEncodableList(std::get(ReadValue(stream)))); case 129: - return CustomEncodableValue(AllNullableTypes::FromEncodableList( - std::get(ReadValue(stream)))); + return CustomEncodableValue(AllNullableTypes::FromEncodableList(std::get(ReadValue(stream)))); case 130: - return CustomEncodableValue(AllTypes::FromEncodableList( - std::get(ReadValue(stream)))); + return CustomEncodableValue(AllTypes::FromEncodableList(std::get(ReadValue(stream)))); case 131: - return CustomEncodableValue(TestMessage::FromEncodableList( - std::get(ReadValue(stream)))); + return CustomEncodableValue(TestMessage::FromEncodableList(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)) { + const EncodableValue& value, + flutter::ByteStreamWriter* stream) const { + if (const CustomEncodableValue* custom_value = std::get_if(&value)) { if (custom_value->type() == typeid(AllClassesWrapper)) { 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(AllNullableTypes)) { 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) - : binary_messenger_(binary_messenger) {} +// Generated class from Pigeon that represents Flutter messages that can be called from C++. +FlutterIntegrationCoreApi::FlutterIntegrationCoreApi(flutter::BinaryMessenger* binary_messenger) + : 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) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "noop"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(); - channel->Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - on_success(); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + on_success(); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::ThrowError( - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "throwError"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(); - channel->Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = &list_return_value->at(0); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto* return_value = &list_return_value->at(0); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::ThrowErrorFromVoid( - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "throwErrorFromVoid"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(); - channel->Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - on_success(); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + on_success(); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::EchoAllTypes( - const AllTypes& everything_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoAllTypes"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + const AllTypes& everything_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - CustomEncodableValue(everything_arg), + CustomEncodableValue(everything_arg), + }); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::any_cast(std::get(list_return_value->at(0))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel->Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = std::any_cast( - std::get(list_return_value->at(0))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoAllNullableTypes( - const AllNullableTypes* everything_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoAllNullableTypes"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + const AllNullableTypes* everything_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - everything_arg ? CustomEncodableValue(*everything_arg) : EncodableValue(), + everything_arg ? CustomEncodableValue(*everything_arg) : EncodableValue(), }); - channel->Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = &(std::any_cast( - std::get(list_return_value->at(0)))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto* return_value = &(std::any_cast(std::get(list_return_value->at(0)))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} void FlutterIntegrationCoreApi::SendMultipleNullableTypes( - const bool* a_nullable_bool_arg, const int64_t* a_nullable_int_arg, - const std::string* a_nullable_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "sendMultipleNullableTypes"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + const bool* a_nullable_bool_arg, + const int64_t* a_nullable_int_arg, + const std::string* a_nullable_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_nullable_bool_arg ? EncodableValue(*a_nullable_bool_arg) - : EncodableValue(), - a_nullable_int_arg ? EncodableValue(*a_nullable_int_arg) - : EncodableValue(), - a_nullable_string_arg ? EncodableValue(*a_nullable_string_arg) - : EncodableValue(), + a_nullable_bool_arg ? EncodableValue(*a_nullable_bool_arg) : EncodableValue(), + a_nullable_int_arg ? EncodableValue(*a_nullable_int_arg) : EncodableValue(), + a_nullable_string_arg ? EncodableValue(*a_nullable_string_arg) : EncodableValue(), + }); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::any_cast(std::get(list_return_value->at(0))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel->Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = std::any_cast( - std::get(list_return_value->at(0))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoBool( - bool a_bool_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoBool"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + bool a_bool_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_bool_arg), + EncodableValue(a_bool_arg), + }); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel->Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoInt( - int64_t an_int_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoInt"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + int64_t an_int_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(an_int_arg), + EncodableValue(an_int_arg), + }); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const int64_t return_value = list_return_value->at(0).LongValue(); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel->Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const int64_t return_value = list_return_value->at(0).LongValue(); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoDouble( - double a_double_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoDouble"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + double a_double_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_double_arg), + EncodableValue(a_double_arg), }); - channel->Send(encoded_api_arguments, [channel_name, - on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, - size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); + const auto* list_return_value = std::get_if(&encodable_return_value); if (list_return_value) { if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); } else { const auto& return_value = std::get(list_return_value->at(0)); on_success(return_value); } } else { on_error(CreateConnectionError(channel_name)); - } + } }); } void FlutterIntegrationCoreApi::EchoString( - const std::string& a_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoString"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + const std::string& a_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_string_arg), + EncodableValue(a_string_arg), + }); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel->Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoUint8List( - const std::vector& a_list_arg, - std::function&)>&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoUint8List"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + const std::vector& a_list_arg, + std::function&)>&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_list_arg), + EncodableValue(a_list_arg), + }); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::get>(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel->Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get>(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoList( - const EncodableList& a_list_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoList"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + const EncodableList& a_list_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_list_arg), + EncodableValue(a_list_arg), + }); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel->Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoMap( - const EncodableMap& a_map_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoMap"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + const EncodableMap& a_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_map_arg), + EncodableValue(a_map_arg), + }); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel->Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoEnum( - const AnEnum& an_enum_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoEnum"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + const AnEnum& an_enum_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue((int)an_enum_arg), + EncodableValue((int)an_enum_arg), + }); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const AnEnum& return_value = (AnEnum)list_return_value->at(0).LongValue(); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoNamedDefaultString( + const std::string& a_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNamedDefaultString"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(a_string_arg), + }); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel->Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const AnEnum& return_value = - (AnEnum)list_return_value->at(0).LongValue(); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoNullableBool( - const bool* a_bool_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableBool"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + const bool* a_bool_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_bool_arg ? EncodableValue(*a_bool_arg) : EncodableValue(), + a_bool_arg ? EncodableValue(*a_bool_arg) : EncodableValue(), }); - channel->Send(encoded_api_arguments, [channel_name, - on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, - size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); + const auto* list_return_value = std::get_if(&encodable_return_value); if (list_return_value) { if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); } else { const auto* return_value = std::get_if(&list_return_value->at(0)); on_success(return_value); } } else { on_error(CreateConnectionError(channel_name)); - } + } }); } void FlutterIntegrationCoreApi::EchoNullableInt( - const int64_t* an_int_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableInt"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + const int64_t* an_int_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - an_int_arg ? EncodableValue(*an_int_arg) : EncodableValue(), + an_int_arg ? EncodableValue(*an_int_arg) : EncodableValue(), }); - channel->Send(encoded_api_arguments, [channel_name, - on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, - size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); + const auto* list_return_value = std::get_if(&encodable_return_value); if (list_return_value) { if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); } else { - const int64_t return_value_value = - list_return_value->at(0).IsNull() - ? 0 - : list_return_value->at(0).LongValue(); - const auto* return_value = - list_return_value->at(0).IsNull() ? nullptr : &return_value_value; + const int64_t return_value_value = list_return_value->at(0).IsNull() ? 0 : list_return_value->at(0).LongValue(); + const auto* return_value = list_return_value->at(0).IsNull() ? nullptr : &return_value_value; on_success(return_value); } } else { on_error(CreateConnectionError(channel_name)); - } + } }); } void FlutterIntegrationCoreApi::EchoNullableDouble( - const double* a_double_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableDouble"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + const double* a_double_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_double_arg ? EncodableValue(*a_double_arg) : EncodableValue(), + a_double_arg ? EncodableValue(*a_double_arg) : EncodableValue(), + }); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto* return_value = std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel->Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoNullableString( - const std::string* a_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableString"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + const std::string* a_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_string_arg ? EncodableValue(*a_string_arg) : EncodableValue(), + a_string_arg ? EncodableValue(*a_string_arg) : EncodableValue(), + }); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto* return_value = std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel->Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoNullableUint8List( - const std::vector* a_list_arg, - std::function*)>&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableUint8List"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + const std::vector* a_list_arg, + std::function*)>&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &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, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto* return_value = std::get_if>(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel->Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if>(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoNullableList( - const EncodableList* a_list_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableList"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + const EncodableList* a_list_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &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, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto* return_value = std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel->Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoNullableMap( - const EncodableMap* a_map_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableMap"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + const EncodableMap* a_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_map_arg ? EncodableValue(*a_map_arg) : EncodableValue(), + a_map_arg ? EncodableValue(*a_map_arg) : EncodableValue(), + }); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto* return_value = std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel->Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoNullableEnum( - const AnEnum* an_enum_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableEnum"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + const AnEnum* an_enum_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - an_enum_arg ? EncodableValue((int)(*an_enum_arg)) : EncodableValue(), + an_enum_arg ? EncodableValue((int)(*an_enum_arg)) : EncodableValue(), }); - channel->Send(encoded_api_arguments, [channel_name, - on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, - size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); + const auto* list_return_value = std::get_if(&encodable_return_value); if (list_return_value) { if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); } else { - const int64_t return_value_value = - list_return_value->at(0).IsNull() - ? 0 - : list_return_value->at(0).LongValue(); + const int64_t return_value_value = list_return_value->at(0).IsNull() ? 0 : list_return_value->at(0).LongValue(); const AnEnum enum_return_value = (AnEnum)return_value_value; - const auto* return_value = - list_return_value->at(0).IsNull() ? nullptr : &enum_return_value; + const auto* return_value = list_return_value->at(0).IsNull() ? nullptr : &enum_return_value; on_success(return_value); } } else { on_error(CreateConnectionError(channel_name)); - } + } + }); +} + +void FlutterIntegrationCoreApi::EchoNamedNullableString( + const std::string* a_nullable_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNamedNullableString"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + a_nullable_string_arg ? EncodableValue(*a_nullable_string_arg) : EncodableValue(), + }); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto* return_value = std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); } void FlutterIntegrationCoreApi::NoopAsync( - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "noopAsync"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(); - channel->Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - on_success(); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + on_success(); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::EchoAsyncString( - const std::string& a_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoAsyncString"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + const std::string& a_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_string_arg), + EncodableValue(a_string_arg), + }); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel->Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } /// The codec used by HostTrivialApi. const flutter::StandardMessageCodec& HostTrivialApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &flutter::StandardCodecSerializer::GetInstance()); + 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) { +// 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.pigeon_integration_tests.HostTrivialApi.noop", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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); } @@ -4744,86 +3719,77 @@ void HostTrivialApi::SetUp(flutter::BinaryMessenger* binary_messenger, } EncodableValue HostTrivialApi::WrapError(std::string_view error_message) { - return EncodableValue( - EncodableList{EncodableValue(std::string(error_message)), - EncodableValue("Error"), EncodableValue()}); + return EncodableValue(EncodableList{ + EncodableValue(std::string(error_message)), + EncodableValue("Error"), + EncodableValue() + }); } EncodableValue HostTrivialApi::WrapError(const FlutterError& error) { - return EncodableValue(EncodableList{EncodableValue(error.code()), - EncodableValue(error.message()), - error.details()}); + return EncodableValue(EncodableList{ + EncodableValue(error.code()), + EncodableValue(error.message()), + error.details() + }); } /// The codec used by HostSmallApi. const flutter::StandardMessageCodec& HostSmallApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &flutter::StandardCodecSerializer::GetInstance()); + 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) { +// 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.pigeon_integration_tests.HostSmallApi.echo", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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())); - } - }); + 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.pigeon_integration_tests.HostSmallApi.voidVoid", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.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); } @@ -4831,129 +3797,106 @@ void HostSmallApi::SetUp(flutter::BinaryMessenger* binary_messenger, } EncodableValue HostSmallApi::WrapError(std::string_view error_message) { - return EncodableValue( - EncodableList{EncodableValue(std::string(error_message)), - EncodableValue("Error"), EncodableValue()}); + return EncodableValue(EncodableList{ + EncodableValue(std::string(error_message)), + EncodableValue("Error"), + EncodableValue() + }); } EncodableValue HostSmallApi::WrapError(const FlutterError& error) { - return EncodableValue(EncodableList{EncodableValue(error.code()), - EncodableValue(error.message()), - error.details()}); + return EncodableValue(EncodableList{ + EncodableValue(error.code()), + EncodableValue(error.message()), + error.details() + }); } + FlutterSmallApiCodecSerializer::FlutterSmallApiCodecSerializer() {} EncodableValue FlutterSmallApiCodecSerializer::ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const { + uint8_t type, + flutter::ByteStreamReader* stream) const { switch (type) { case 128: - return CustomEncodableValue(TestMessage::FromEncodableList( - std::get(ReadValue(stream)))); + return CustomEncodableValue(TestMessage::FromEncodableList(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)) { + 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) - : binary_messenger_(binary_messenger) {} + : 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) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi." - "echoWrappedList"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + const TestMessage& msg_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - CustomEncodableValue(msg_arg), + CustomEncodableValue(msg_arg), + }); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::any_cast(std::get(list_return_value->at(0))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel->Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = std::any_cast( - std::get(list_return_value->at(0))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterSmallApi::EchoString( - const std::string& a_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString"; - auto channel = std::make_unique>( - binary_messenger_, channel_name, &GetCodec()); + const std::string& a_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString"; + auto channel = std::make_unique>(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_string_arg), + EncodableValue(a_string_arg), + }); + channel->Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel->Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } } // namespace core_tests_pigeontest diff --git a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h index 53c3320b3cf1..373a4b02cc7f 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, 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,8 +41,7 @@ class FlutterError { flutter::EncodableValue details_; }; -template -class ErrorOr { +template class ErrorOr { public: ErrorOr(const T& rhs) : v_(rhs) {} ErrorOr(const T&& rhs) : v_(std::move(rhs)) {} @@ -65,7 +64,12 @@ class ErrorOr { std::variant v_; }; -enum class AnEnum { one = 0, two = 1, three = 2 }; + +enum class AnEnum { + one = 0, + two = 1, + three = 2 +}; // A class containing all supported types. // @@ -73,15 +77,20 @@ enum class AnEnum { one = 0, two = 1, three = 2 }; class AllTypes { public: // Constructs an object setting all fields. - explicit AllTypes(bool a_bool, int64_t an_int, int64_t an_int64, - double a_double, const std::vector& a_byte_array, - const std::vector& a4_byte_array, - const std::vector& a8_byte_array, - const std::vector& a_float_array, - const flutter::EncodableList& a_list, - const flutter::EncodableMap& a_map, const AnEnum& an_enum, - const std::string& a_string, - const flutter::EncodableValue& an_object); + explicit AllTypes( + bool a_bool, + int64_t an_int, + int64_t an_int64, + double a_double, + const std::vector& a_byte_array, + const std::vector& a4_byte_array, + const std::vector& a8_byte_array, + const std::vector& a_float_array, + const flutter::EncodableList& a_list, + const flutter::EncodableMap& a_map, + const AnEnum& an_enum, + const std::string& a_string, + const flutter::EncodableValue& an_object); bool a_bool() const; void set_a_bool(bool value_arg); @@ -122,6 +131,7 @@ class AllTypes { const flutter::EncodableValue& an_object() const; void set_an_object(const flutter::EncodableValue& value_arg); + private: static AllTypes FromEncodableList(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -150,8 +160,10 @@ class AllTypes { AnEnum an_enum_; std::string a_string_; flutter::EncodableValue an_object_; + }; + // A class containing all supported nullable types. // // Generated class from Pigeon that represents data sent in messages. @@ -162,19 +174,22 @@ class AllNullableTypes { // Constructs an object setting all fields. explicit AllNullableTypes( - const bool* a_nullable_bool, const int64_t* a_nullable_int, - const int64_t* a_nullable_int64, const double* a_nullable_double, - const std::vector* a_nullable_byte_array, - const std::vector* a_nullable4_byte_array, - const std::vector* a_nullable8_byte_array, - const std::vector* a_nullable_float_array, - const flutter::EncodableList* a_nullable_list, - const flutter::EncodableMap* a_nullable_map, - const flutter::EncodableList* nullable_nested_list, - const flutter::EncodableMap* nullable_map_with_annotations, - const flutter::EncodableMap* nullable_map_with_object, - const AnEnum* a_nullable_enum, const std::string* a_nullable_string, - const flutter::EncodableValue* a_nullable_object); + const bool* a_nullable_bool, + const int64_t* a_nullable_int, + const int64_t* a_nullable_int64, + const double* a_nullable_double, + const std::vector* a_nullable_byte_array, + const std::vector* a_nullable4_byte_array, + const std::vector* a_nullable8_byte_array, + const std::vector* a_nullable_float_array, + const flutter::EncodableList* a_nullable_list, + const flutter::EncodableMap* a_nullable_map, + const flutter::EncodableList* nullable_nested_list, + const flutter::EncodableMap* nullable_map_with_annotations, + const flutter::EncodableMap* nullable_map_with_object, + const AnEnum* a_nullable_enum, + const std::string* a_nullable_string, + const flutter::EncodableValue* a_nullable_object); const bool* a_nullable_bool() const; void set_a_nullable_bool(const bool* value_arg); @@ -221,10 +236,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); @@ -242,6 +255,7 @@ class AllNullableTypes { void set_a_nullable_object(const flutter::EncodableValue* value_arg); void set_a_nullable_object(const flutter::EncodableValue& value_arg); + private: static AllNullableTypes FromEncodableList(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -273,8 +287,10 @@ class AllNullableTypes { std::optional a_nullable_enum_; std::optional a_nullable_string_; std::optional a_nullable_object_; + }; + // A class for testing nested class handling. // // This is needed to test nested nullable and non-nullable classes, @@ -288,8 +304,9 @@ class AllClassesWrapper { explicit AllClassesWrapper(const AllNullableTypes& all_nullable_types); // Constructs an object setting all fields. - explicit AllClassesWrapper(const AllNullableTypes& all_nullable_types, - const AllTypes* all_types); + explicit AllClassesWrapper( + const AllNullableTypes& all_nullable_types, + const AllTypes* all_types); const AllNullableTypes& all_nullable_types() const; void set_all_nullable_types(const AllNullableTypes& value_arg); @@ -298,9 +315,9 @@ class AllClassesWrapper { void set_all_types(const AllTypes* value_arg); void set_all_types(const AllTypes& value_arg); + private: - static AllClassesWrapper FromEncodableList( - const flutter::EncodableList& list); + static AllClassesWrapper FromEncodableList(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; friend class HostIntegrationCoreApi; friend class HostIntegrationCoreApiCodecSerializer; @@ -315,8 +332,10 @@ class AllClassesWrapper { friend class CoreTestsTest; AllNullableTypes all_nullable_types_; std::optional all_types_; + }; + // A data class containing a List, used in unit tests. // // Generated class from Pigeon that represents data sent in messages. @@ -332,6 +351,7 @@ class TestMessage { void set_test_list(const flutter::EncodableList* value_arg); void set_test_list(const flutter::EncodableList& value_arg); + private: static TestMessage FromEncodableList(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -347,10 +367,10 @@ class TestMessage { friend class FlutterSmallApiCodecSerializer; friend class CoreTestsTest; std::optional test_list_; + }; -class HostIntegrationCoreApiCodecSerializer - : public flutter::StandardCodecSerializer { +class HostIntegrationCoreApiCodecSerializer : public flutter::StandardCodecSerializer { public: HostIntegrationCoreApiCodecSerializer(); inline static HostIntegrationCoreApiCodecSerializer& GetInstance() { @@ -358,19 +378,21 @@ class HostIntegrationCoreApiCodecSerializer return sInstance; } - void WriteValue(const flutter::EncodableValue& value, - flutter::ByteStreamWriter* stream) const override; + void WriteValue( + const flutter::EncodableValue& value, + flutter::ByteStreamWriter* stream) const override; protected: flutter::EncodableValue ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const override; + uint8_t type, + flutter::ByteStreamReader* stream) const override; + }; // The core interface that each host language plugin must implement in // platform_test integration tests. // -// Generated interface from Pigeon that represents a handler of messages from -// Flutter. +// Generated interface from Pigeon that represents a handler of messages from Flutter. class HostIntegrationCoreApi { public: HostIntegrationCoreApi(const HostIntegrationCoreApi&) = delete; @@ -386,8 +408,7 @@ class HostIntegrationCoreApi { // Returns an error from a void function, to test error handling. virtual std::optional ThrowErrorFromVoid() = 0; // Returns a Flutter error, to test error handling. - virtual ErrorOr> - ThrowFlutterError() = 0; + virtual ErrorOr> ThrowFlutterError() = 0; // Returns passed in int. virtual ErrorOr EchoInt(int64_t an_int) = 0; // Returns passed in double. @@ -397,263 +418,223 @@ 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; - // Returns the passed map to test nested class serialization and - // deserialization. - virtual ErrorOr EchoClassWrapper( - const AllClassesWrapper& wrapper) = 0; + virtual ErrorOr EchoMap(const flutter::EncodableMap& a_map) = 0; + // Returns the passed map to test nested class serialization and deserialization. + virtual ErrorOr EchoClassWrapper(const AllClassesWrapper& wrapper) = 0; // Returns the passed enum to test serialization and deserialization. virtual ErrorOr EchoEnum(const AnEnum& an_enum) = 0; // Returns the default string. - virtual ErrorOr EchoNamedDefaultString( - const std::string& a_string) = 0; + virtual ErrorOr EchoNamedDefaultString(const std::string& a_string) = 0; // Returns passed in double. virtual ErrorOr EchoOptionalDefaultDouble(double a_double) = 0; // Returns passed in int. virtual ErrorOr EchoRequiredInt(int64_t an_int) = 0; // Returns the passed object, to test serialization and deserialization. - virtual ErrorOr> EchoAllNullableTypes( - const AllNullableTypes* everything) = 0; + virtual ErrorOr> EchoAllNullableTypes(const AllNullableTypes* everything) = 0; // Returns the inner `aString` value from the wrapped object, to test // sending of nested objects. - virtual ErrorOr> ExtractNestedNullableString( - const AllClassesWrapper& wrapper) = 0; + virtual ErrorOr> ExtractNestedNullableString(const AllClassesWrapper& wrapper) = 0; // Returns the inner `aString` value from the wrapped object, to test // sending of nested objects. - virtual ErrorOr CreateNestedNullableString( - const std::string* nullable_string) = 0; + virtual ErrorOr CreateNestedNullableString(const std::string* nullable_string) = 0; // Returns passed in arguments of multiple types. virtual ErrorOr SendMultipleNullableTypes( - const bool* a_nullable_bool, const int64_t* a_nullable_int, - const std::string* a_nullable_string) = 0; + const bool* a_nullable_bool, + const int64_t* a_nullable_int, + const std::string* a_nullable_string) = 0; // Returns passed in int. - virtual ErrorOr> EchoNullableInt( - const int64_t* a_nullable_int) = 0; + virtual ErrorOr> EchoNullableInt(const int64_t* a_nullable_int) = 0; // Returns passed in double. - virtual ErrorOr> EchoNullableDouble( - const double* a_nullable_double) = 0; + virtual ErrorOr> EchoNullableDouble(const double* a_nullable_double) = 0; // Returns the passed in boolean. - virtual ErrorOr> EchoNullableBool( - const bool* a_nullable_bool) = 0; + virtual ErrorOr> EchoNullableBool(const bool* a_nullable_bool) = 0; // Returns the passed in string. - virtual ErrorOr> EchoNullableString( - const std::string* a_nullable_string) = 0; + virtual ErrorOr> EchoNullableString(const std::string* a_nullable_string) = 0; // Returns the passed in Uint8List. - virtual ErrorOr>> EchoNullableUint8List( - const std::vector* a_nullable_uint8_list) = 0; + virtual ErrorOr>> EchoNullableUint8List(const std::vector* a_nullable_uint8_list) = 0; // Returns the passed in generic Object. - virtual ErrorOr> EchoNullableObject( - const flutter::EncodableValue* a_nullable_object) = 0; + virtual ErrorOr> EchoNullableObject(const flutter::EncodableValue* a_nullable_object) = 0; // Returns the passed list, to test serialization and deserialization. - virtual ErrorOr> EchoNullableList( - const flutter::EncodableList* a_nullable_list) = 0; + virtual ErrorOr> EchoNullableList(const flutter::EncodableList* a_nullable_list) = 0; // Returns the passed map, to test serialization and deserialization. - virtual ErrorOr> EchoNullableMap( - const flutter::EncodableMap* a_nullable_map) = 0; - virtual ErrorOr> EchoNullableEnum( - const AnEnum* an_enum) = 0; + virtual ErrorOr> EchoNullableMap(const flutter::EncodableMap* a_nullable_map) = 0; + virtual ErrorOr> EchoNullableEnum(const AnEnum* an_enum) = 0; // Returns passed in int. - virtual ErrorOr> EchoOptionalNullableInt( - const int64_t* a_nullable_int) = 0; + virtual ErrorOr> EchoOptionalNullableInt(const int64_t* a_nullable_int) = 0; // Returns the passed in string. - virtual ErrorOr> EchoNamedNullableString( - const std::string* a_nullable_string) = 0; + virtual ErrorOr> EchoNamedNullableString(const std::string* a_nullable_string) = 0; // A no-op function taking no arguments and returning no value, to sanity // test basic asynchronous calling. - virtual void NoopAsync( - std::function reply)> result) = 0; + virtual void NoopAsync(std::function reply)> result) = 0; // Returns passed in int asynchronously. virtual void EchoAsyncInt( - int64_t an_int, std::function reply)> result) = 0; + int64_t an_int, + std::function reply)> result) = 0; // Returns passed in double asynchronously. virtual void EchoAsyncDouble( - double a_double, std::function reply)> result) = 0; + double a_double, + std::function reply)> result) = 0; // Returns the passed in boolean asynchronously. virtual void EchoAsyncBool( - bool a_bool, std::function reply)> result) = 0; + bool a_bool, + std::function reply)> result) = 0; // Returns the passed string asynchronously. virtual void EchoAsyncString( - const std::string& a_string, - std::function reply)> result) = 0; + const std::string& a_string, + std::function reply)> result) = 0; // Returns the passed in Uint8List asynchronously. virtual void EchoAsyncUint8List( - const std::vector& a_uint8_list, - std::function> reply)> result) = 0; + const std::vector& a_uint8_list, + std::function> reply)> result) = 0; // Returns the passed in generic Object asynchronously. virtual void EchoAsyncObject( - const flutter::EncodableValue& an_object, - std::function reply)> result) = 0; - // Returns the passed list, to test asynchronous serialization and - // deserialization. + const flutter::EncodableValue& an_object, + std::function reply)> result) = 0; + // Returns the passed list, to test asynchronous serialization and deserialization. virtual void EchoAsyncList( - const flutter::EncodableList& a_list, - std::function reply)> result) = 0; - // Returns the passed map, to test asynchronous serialization and - // deserialization. + const flutter::EncodableList& a_list, + std::function reply)> result) = 0; + // Returns the passed map, to test asynchronous serialization and deserialization. virtual void EchoAsyncMap( - const flutter::EncodableMap& a_map, - std::function reply)> result) = 0; - // Returns the passed enum, to test asynchronous serialization and - // deserialization. + const flutter::EncodableMap& a_map, + std::function reply)> result) = 0; + // Returns the passed enum, to test asynchronous serialization and deserialization. virtual void EchoAsyncEnum( - const AnEnum& an_enum, - std::function reply)> result) = 0; + const AnEnum& an_enum, + std::function reply)> result) = 0; // Responds with an error from an async function returning a value. - virtual void ThrowAsyncError( - std::function> reply)> - result) = 0; + virtual void ThrowAsyncError(std::function> reply)> result) = 0; // Responds with an error from an async void function. - virtual void ThrowAsyncErrorFromVoid( - std::function reply)> result) = 0; + virtual void ThrowAsyncErrorFromVoid(std::function reply)> result) = 0; // Responds with a Flutter error from an async function returning a value. - virtual void ThrowAsyncFlutterError( - std::function> reply)> - result) = 0; + virtual void ThrowAsyncFlutterError(std::function> reply)> result) = 0; // Returns the passed object, to test async serialization and deserialization. virtual void EchoAsyncAllTypes( - const AllTypes& everything, - std::function reply)> result) = 0; + const AllTypes& everything, + std::function reply)> result) = 0; // Returns the passed object, to test serialization and deserialization. virtual void EchoAsyncNullableAllNullableTypes( - const AllNullableTypes* everything, - std::function> reply)> - result) = 0; + const AllNullableTypes* everything, + std::function> reply)> result) = 0; // Returns passed in int asynchronously. virtual void EchoAsyncNullableInt( - const int64_t* an_int, - std::function> reply)> result) = 0; + const int64_t* an_int, + std::function> reply)> result) = 0; // Returns passed in double asynchronously. virtual void EchoAsyncNullableDouble( - const double* a_double, - std::function> reply)> result) = 0; + const double* a_double, + std::function> reply)> result) = 0; // Returns the passed in boolean asynchronously. virtual void EchoAsyncNullableBool( - const bool* a_bool, - std::function> reply)> result) = 0; + const bool* a_bool, + std::function> reply)> result) = 0; // Returns the passed string asynchronously. virtual void EchoAsyncNullableString( - const std::string* a_string, - std::function> reply)> - result) = 0; + const std::string* a_string, + std::function> reply)> result) = 0; // Returns the passed in Uint8List asynchronously. virtual void EchoAsyncNullableUint8List( - const std::vector* a_uint8_list, - std::function>> reply)> - result) = 0; + const std::vector* a_uint8_list, + std::function>> reply)> result) = 0; // Returns the passed in generic Object asynchronously. virtual void EchoAsyncNullableObject( - const flutter::EncodableValue* an_object, - std::function> reply)> - result) = 0; - // Returns the passed list, to test asynchronous serialization and - // deserialization. + const flutter::EncodableValue* an_object, + std::function> reply)> result) = 0; + // Returns the passed list, to test asynchronous serialization and deserialization. virtual void EchoAsyncNullableList( - const flutter::EncodableList* a_list, - std::function> reply)> - result) = 0; - // Returns the passed map, to test asynchronous serialization and - // deserialization. + const flutter::EncodableList* a_list, + std::function> reply)> result) = 0; + // Returns the passed map, to test asynchronous serialization and deserialization. virtual void EchoAsyncNullableMap( - const flutter::EncodableMap* a_map, - std::function> reply)> - result) = 0; - // Returns the passed enum, to test asynchronous serialization and - // deserialization. + const flutter::EncodableMap* a_map, + std::function> reply)> result) = 0; + // Returns the passed enum, to test asynchronous serialization and deserialization. virtual void EchoAsyncNullableEnum( - const AnEnum* an_enum, - std::function> reply)> result) = 0; - virtual void CallFlutterNoop( - std::function reply)> result) = 0; - virtual void CallFlutterThrowError( - std::function> reply)> - result) = 0; - virtual void CallFlutterThrowErrorFromVoid( - std::function reply)> result) = 0; + const AnEnum* an_enum, + std::function> reply)> result) = 0; + virtual void CallFlutterNoop(std::function reply)> result) = 0; + virtual void CallFlutterThrowError(std::function> reply)> result) = 0; + virtual void CallFlutterThrowErrorFromVoid(std::function reply)> result) = 0; virtual void CallFlutterEchoAllTypes( - const AllTypes& everything, - std::function reply)> result) = 0; + const AllTypes& everything, + std::function reply)> result) = 0; virtual void CallFlutterEchoAllNullableTypes( - const AllNullableTypes* everything, - std::function> reply)> - result) = 0; + const AllNullableTypes* everything, + std::function> reply)> result) = 0; virtual void CallFlutterSendMultipleNullableTypes( - const bool* a_nullable_bool, const int64_t* a_nullable_int, - const std::string* a_nullable_string, - std::function reply)> result) = 0; + const bool* a_nullable_bool, + const int64_t* a_nullable_int, + const std::string* a_nullable_string, + std::function reply)> result) = 0; virtual void CallFlutterEchoBool( - bool a_bool, std::function reply)> result) = 0; + bool a_bool, + std::function reply)> result) = 0; virtual void CallFlutterEchoInt( - int64_t an_int, std::function reply)> result) = 0; + int64_t an_int, + std::function reply)> result) = 0; virtual void CallFlutterEchoDouble( - double a_double, std::function reply)> result) = 0; + double a_double, + std::function reply)> result) = 0; virtual void CallFlutterEchoString( - const std::string& a_string, - std::function reply)> result) = 0; + const std::string& a_string, + std::function reply)> result) = 0; virtual void CallFlutterEchoUint8List( - const std::vector& a_list, - std::function> reply)> result) = 0; + const std::vector& a_list, + std::function> reply)> result) = 0; virtual void CallFlutterEchoList( - const flutter::EncodableList& a_list, - std::function reply)> result) = 0; + const flutter::EncodableList& a_list, + std::function reply)> result) = 0; virtual void CallFlutterEchoMap( - const flutter::EncodableMap& a_map, - std::function reply)> result) = 0; + const flutter::EncodableMap& a_map, + std::function reply)> result) = 0; virtual void CallFlutterEchoEnum( - const AnEnum& an_enum, - std::function reply)> result) = 0; + const AnEnum& an_enum, + std::function reply)> result) = 0; virtual void CallFlutterEchoNullableBool( - const bool* a_bool, - std::function> reply)> result) = 0; + const bool* a_bool, + std::function> reply)> result) = 0; virtual void CallFlutterEchoNullableInt( - const int64_t* an_int, - std::function> reply)> result) = 0; + const int64_t* an_int, + std::function> reply)> result) = 0; virtual void CallFlutterEchoNullableDouble( - const double* a_double, - std::function> reply)> result) = 0; + const double* a_double, + std::function> reply)> result) = 0; virtual void CallFlutterEchoNullableString( - const std::string* a_string, - std::function> reply)> - result) = 0; + const std::string* a_string, + std::function> reply)> result) = 0; virtual void CallFlutterEchoNullableUint8List( - const std::vector* a_list, - std::function>> reply)> - result) = 0; + const std::vector* a_list, + std::function>> reply)> result) = 0; virtual void CallFlutterEchoNullableList( - const flutter::EncodableList* a_list, - std::function> reply)> - result) = 0; + const flutter::EncodableList* a_list, + std::function> reply)> result) = 0; virtual void CallFlutterEchoNullableMap( - const flutter::EncodableMap* a_map, - std::function> reply)> - result) = 0; + const flutter::EncodableMap* a_map, + std::function> reply)> result) = 0; virtual void CallFlutterEchoNullableEnum( - const AnEnum* an_enum, - std::function> reply)> result) = 0; + const AnEnum* an_enum, + std::function> reply)> result) = 0; // 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: FlutterIntegrationCoreApiCodecSerializer(); inline static FlutterIntegrationCoreApiCodecSerializer& GetInstance() { @@ -661,124 +642,157 @@ class FlutterIntegrationCoreApiCodecSerializer return sInstance; } - void WriteValue(const flutter::EncodableValue& value, - flutter::ByteStreamWriter* stream) const override; + void WriteValue( + const flutter::EncodableValue& value, + flutter::ByteStreamWriter* stream) const override; protected: flutter::EncodableValue ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const override; + uint8_t type, + flutter::ByteStreamReader* stream) const override; + }; // The core interface that the Dart platform_test code implements for host // integration tests to call into. // -// Generated class from Pigeon that represents Flutter messages that can be -// called from C++. +// Generated class from Pigeon that represents Flutter messages that can be called from C++. class FlutterIntegrationCoreApi { public: FlutterIntegrationCoreApi(flutter::BinaryMessenger* binary_messenger); static const flutter::StandardMessageCodec& GetCodec(); // A no-op function taking no arguments and returning no value, to sanity // test basic calling. - void Noop(std::function&& on_success, - std::function&& on_error); + void Noop( + std::function&& on_success, + std::function&& on_error); // Responds with an error from an async function returning a value. void ThrowError( - std::function&& on_success, - std::function&& on_error); + std::function&& on_success, + std::function&& on_error); // Responds with an error from an async void function. - void ThrowErrorFromVoid(std::function&& on_success, - std::function&& on_error); + void ThrowErrorFromVoid( + std::function&& on_success, + std::function&& on_error); // Returns the passed object, to test serialization and deserialization. - void EchoAllTypes(const AllTypes& everything, - std::function&& on_success, - std::function&& on_error); + void EchoAllTypes( + const AllTypes& everything, + std::function&& on_success, + std::function&& on_error); // Returns the passed object, to test serialization and deserialization. void EchoAllNullableTypes( - const AllNullableTypes* everything, - std::function&& on_success, - std::function&& on_error); + const AllNullableTypes* everything, + std::function&& on_success, + std::function&& on_error); // Returns passed in arguments of multiple types. // // Tests multiple-arity FlutterApi handling. void SendMultipleNullableTypes( - const bool* a_nullable_bool, const int64_t* a_nullable_int, - const std::string* a_nullable_string, - std::function&& on_success, - std::function&& on_error); + const bool* a_nullable_bool, + const int64_t* a_nullable_int, + const std::string* a_nullable_string, + std::function&& on_success, + std::function&& on_error); // Returns the passed 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); + 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 enum to test serialization and deserialization. - void EchoEnum(const AnEnum& an_enum, - std::function&& on_success, - std::function&& on_error); + void EchoEnum( + const AnEnum& an_enum, + std::function&& on_success, + std::function&& on_error); + // Returns the default string. + void EchoNamedDefaultString( + const std::string& a_string, + 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); + 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); + 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); + const flutter::EncodableMap* a_map, + std::function&& on_success, + std::function&& on_error); // Returns the passed enum to test serialization and deserialization. - void EchoNullableEnum(const AnEnum* an_enum, - std::function&& on_success, - std::function&& on_error); + void EchoNullableEnum( + const AnEnum* an_enum, + std::function&& on_success, + std::function&& on_error); + // Returns the passed in string. + void EchoNamedNullableString( + const std::string* a_nullable_string, + std::function&& on_success, + std::function&& on_error); // A no-op function taking no arguments and returning no value, to sanity // test basic asynchronous calling. - void NoopAsync(std::function&& on_success, - std::function&& on_error); + void NoopAsync( + std::function&& on_success, + std::function&& on_error); // Returns the passed in generic Object asynchronously. - void EchoAsyncString(const std::string& a_string, - std::function&& on_success, - std::function&& on_error); + void EchoAsyncString( + const std::string& a_string, + std::function&& on_success, + std::function&& on_error); private: flutter::BinaryMessenger* binary_messenger_; @@ -786,8 +800,7 @@ class FlutterIntegrationCoreApi { // An API that can be implemented for minimal, compile-only tests. // -// Generated interface from Pigeon that represents a handler of messages from -// Flutter. +// Generated interface from Pigeon that represents a handler of messages from Flutter. class HostTrivialApi { public: HostTrivialApi(const HostTrivialApi&) = delete; @@ -797,41 +810,42 @@ 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: @@ -841,28 +855,32 @@ class FlutterSmallApiCodecSerializer : public flutter::StandardCodecSerializer { return sInstance; } - void WriteValue(const flutter::EncodableValue& value, - flutter::ByteStreamWriter* stream) const override; + void WriteValue( + const flutter::EncodableValue& value, + flutter::ByteStreamWriter* stream) const override; protected: flutter::EncodableValue ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const override; + uint8_t type, + flutter::ByteStreamReader* stream) const override; + }; // A simple API called in some unit tests. // -// Generated class from Pigeon that represents Flutter messages that can be -// called from C++. +// Generated class from Pigeon that represents Flutter messages that can be called from C++. class FlutterSmallApi { public: FlutterSmallApi(flutter::BinaryMessenger* binary_messenger); static const flutter::StandardMessageCodec& GetCodec(); - void EchoWrappedList(const TestMessage& msg, - std::function&& on_success, - std::function&& on_error); - void EchoString(const std::string& a_string, - std::function&& on_success, - std::function&& on_error); + void EchoWrappedList( + const TestMessage& msg, + std::function&& on_success, + std::function&& on_error); + void EchoString( + const std::string& a_string, + std::function&& on_success, + std::function&& on_error); private: flutter::BinaryMessenger* binary_messenger_;