diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/.gitignore b/packages/pigeon/platform_tests/alternate_language_test_plugin/darwin/.gitignore similarity index 100% rename from packages/pigeon/platform_tests/alternate_language_test_plugin/ios/.gitignore rename to packages/pigeon/platform_tests/alternate_language_test_plugin/darwin/.gitignore diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/.gitignore b/packages/pigeon/platform_tests/alternate_language_test_plugin/darwin/Classes/.gitignore similarity index 51% rename from packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/.gitignore rename to packages/pigeon/platform_tests/alternate_language_test_plugin/darwin/Classes/.gitignore index 55a15533a3f..3edd8a721ec 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/.gitignore +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/darwin/Classes/.gitignore @@ -1,4 +1,4 @@ -# TODO(stuartmorgan): Remove this once more of the files that macOS doesn't +# TODO(stuartmorgan): Remove this once more of the files that iOS/macOS don't # use have been eliminated via test consolidation. *.gen.h *.gen.m diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/AlternateLanguageTestPlugin.h b/packages/pigeon/platform_tests/alternate_language_test_plugin/darwin/Classes/AlternateLanguageTestPlugin.h similarity index 90% rename from packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/AlternateLanguageTestPlugin.h rename to packages/pigeon/platform_tests/alternate_language_test_plugin/darwin/Classes/AlternateLanguageTestPlugin.h index 104ee200c11..e3d6932e113 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/AlternateLanguageTestPlugin.h +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/darwin/Classes/AlternateLanguageTestPlugin.h @@ -2,7 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#if TARGET_OS_OSX #import +#else +#import +#endif #import "CoreTests.gen.h" diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/AlternateLanguageTestPlugin.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/darwin/Classes/AlternateLanguageTestPlugin.m similarity index 100% rename from packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/AlternateLanguageTestPlugin.m rename to packages/pigeon/platform_tests/alternate_language_test_plugin/darwin/Classes/AlternateLanguageTestPlugin.m 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/darwin/Classes/CoreTests.gen.h similarity index 100% rename from packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.h rename to packages/pigeon/platform_tests/alternate_language_test_plugin/darwin/Classes/CoreTests.gen.h 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/darwin/Classes/CoreTests.gen.m similarity index 100% rename from packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m rename to packages/pigeon/platform_tests/alternate_language_test_plugin/darwin/Classes/CoreTests.gen.m diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/alternate_language_test_plugin.podspec b/packages/pigeon/platform_tests/alternate_language_test_plugin/darwin/alternate_language_test_plugin.podspec similarity index 82% rename from packages/pigeon/platform_tests/alternate_language_test_plugin/ios/alternate_language_test_plugin.podspec rename to packages/pigeon/platform_tests/alternate_language_test_plugin/darwin/alternate_language_test_plugin.podspec index 5ca6da69e3a..3599cd09f49 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/alternate_language_test_plugin.podspec +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/darwin/alternate_language_test_plugin.podspec @@ -15,13 +15,14 @@ A plugin to test Pigeon generation for secondary languages (e.g., Java, Objectiv s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/pigeon' } s.source_files = 'Classes/**/*' s.public_header_files = 'Classes/**/*.h' - s.dependency 'Flutter' - s.platform = :ios, '12.0' + s.ios.dependency 'Flutter' + s.osx.dependency 'FlutterMacOS' + s.ios.deployment_target = '12.0' + s.osx.deployment_target = '10.14' s.xcconfig = { 'LIBRARY_SEARCH_PATHS' => '$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)/ $(SDKROOT)/usr/lib/swift', 'LD_RUNPATH_SEARCH_PATHS' => '/usr/lib/swift', } - - # Flutter.framework does not contain a i386 slice. - s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } + s.swift_version = '5.0' end diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Assets/.gitkeep b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Assets/.gitkeep deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/.gitignore b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/.gitignore deleted file mode 100644 index a00d32beecc..00000000000 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -# TODO(stuartmorgan): Remove this, so that review will show the effects of -# changes on generated files. This will need a way to avoid unnecessary churn, -# such as a flag to suppress version stamp generation. -*.gen.h -*.gen.m -!CoreTests.gen.* \ No newline at end of file diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/AlternateLanguageTestPlugin.h b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/AlternateLanguageTestPlugin.h deleted file mode 100644 index de949488ae5..00000000000 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/AlternateLanguageTestPlugin.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import - -#import "CoreTests.gen.h" - -@interface AlternateLanguageTestPlugin : NSObject -@end - -@interface AlternateLanguageTestAPIWithSuffix : NSObject -+ (void)registerWithRegistrar:(NSObject *)registrar - suffix:(NSString *)suffix; -@end diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/AlternateLanguageTestPlugin.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/AlternateLanguageTestPlugin.m deleted file mode 100644 index 4f2b9d69450..00000000000 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/AlternateLanguageTestPlugin.m +++ /dev/null @@ -1,1170 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "AlternateLanguageTestPlugin.h" - -#import "CoreTests.gen.h" - -@interface AlternateLanguageTestPlugin () -@property(nonatomic) FLTFlutterSmallApi *flutterSmallApiOne; -@property(nonatomic) FLTFlutterSmallApi *flutterSmallApiTwo; -@property(nonatomic) FLTFlutterIntegrationCoreApi *flutterAPI; -@end - -/// This plugin handles the native side of the integration tests in example/integration_test/. -@implementation AlternateLanguageTestPlugin -+ (void)registerWithRegistrar:(NSObject *)registrar { - AlternateLanguageTestPlugin *plugin = [[AlternateLanguageTestPlugin alloc] init]; - SetUpFLTHostIntegrationCoreApi([registrar messenger], plugin); - [AlternateLanguageTestAPIWithSuffix registerWithRegistrar:registrar suffix:@"suffixOne"]; - [AlternateLanguageTestAPIWithSuffix registerWithRegistrar:registrar suffix:@"suffixTwo"]; - plugin.flutterAPI = - [[FLTFlutterIntegrationCoreApi alloc] initWithBinaryMessenger:[registrar messenger]]; - plugin.flutterSmallApiOne = - [[FLTFlutterSmallApi alloc] initWithBinaryMessenger:[registrar messenger] - messageChannelSuffix:@"suffixOne"]; - plugin.flutterSmallApiTwo = - [[FLTFlutterSmallApi alloc] initWithBinaryMessenger:[registrar messenger] - messageChannelSuffix:@"suffixTwo"]; -} - -#pragma mark HostIntegrationCoreApi implementation - -- (void)noopWithError:(FlutterError *_Nullable *_Nonnull)error { -} - -- (nullable FLTAllTypes *)echoAllTypes:(FLTAllTypes *)everything - error:(FlutterError *_Nullable *_Nonnull)error { - return everything; -} - -- (nullable FLTAllNullableTypes *)echoAllNullableTypes:(nullable FLTAllNullableTypes *)everything - error:(FlutterError *_Nullable *_Nonnull)error { - return everything; -} - -- (nullable FLTAllNullableTypesWithoutRecursion *) - echoAllNullableTypesWithoutRecursion:(nullable FLTAllNullableTypesWithoutRecursion *)everything - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - return everything; -} - -- (nullable id)throwErrorWithError:(FlutterError *_Nullable *_Nonnull)error { - *error = [FlutterError errorWithCode:@"An error" message:nil details:nil]; - return nil; -} - -- (void)throwErrorFromVoidWithError:(FlutterError *_Nullable *_Nonnull)error { - *error = [FlutterError errorWithCode:@"An error" message:nil details:nil]; -} - -- (nullable id)throwFlutterErrorWithError:(FlutterError *_Nullable *_Nonnull)error { - *error = [FlutterError errorWithCode:@"code" message:@"message" details:@"details"]; - return nil; -} - -- (nullable NSNumber *)echoInt:(NSInteger)anInt error:(FlutterError *_Nullable *_Nonnull)error { - return @(anInt); -} - -- (nullable NSNumber *)echoDouble:(double)aDouble error:(FlutterError *_Nullable *_Nonnull)error { - return @(aDouble); -} - -- (nullable NSNumber *)echoBool:(BOOL)aBool error:(FlutterError *_Nullable *_Nonnull)error { - return @(aBool); -} - -- (nullable NSString *)echoString:(NSString *)aString - error:(FlutterError *_Nullable *_Nonnull)error { - return aString; -} - -- (nullable FlutterStandardTypedData *)echoUint8List:(FlutterStandardTypedData *)aUint8List - error:(FlutterError *_Nullable *_Nonnull)error { - return aUint8List; -} - -- (nullable id)echoObject:(id)anObject error:(FlutterError *_Nullable *_Nonnull)error { - return anObject; -} - -- (nullable NSArray *)echoList:(NSArray *)list - error:(FlutterError *_Nullable *_Nonnull)error { - return list; -} - -- (nullable NSArray *)echoEnumList:(NSArray *)enumList - error:(FlutterError *_Nullable *_Nonnull)error { - return enumList; -} - -- (nullable NSArray *) - echoClassList:(NSArray *)classList - error:(FlutterError *_Nullable *_Nonnull)error { - return classList; -} - -- (nullable NSArray *) - echoNonNullEnumList:(nonnull NSArray *)enumList - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - return enumList; -} - -- (nullable NSArray *) - echoNonNullClassList:(nonnull NSArray *)classList - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - return classList; -} - -- (nullable NSDictionary *)echoMap:(NSDictionary *)map - error:(FlutterError *_Nullable *_Nonnull)error { - return map; -} - -- (nullable NSDictionary *) - echoStringMap:(NSDictionary *)stringMap - error:(FlutterError *_Nullable *_Nonnull)error { - return stringMap; -} - -- (nullable NSDictionary *) - echoIntMap:(NSDictionary *)intMap - error:(FlutterError *_Nullable *_Nonnull)error { - return intMap; -} - -- (nullable NSDictionary *) - echoEnumMap:(NSDictionary *)enumMap - error:(FlutterError *_Nullable *_Nonnull)error { - return enumMap; -} - -- (nullable NSDictionary *) - echoClassMap:(NSDictionary *)classMap - error:(FlutterError *_Nullable *_Nonnull)error { - return classMap; -} - -- (nullable NSDictionary *) - echoNonNullStringMap:(nonnull NSDictionary *)stringMap - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - return stringMap; -} - -- (nullable NSDictionary *) - echoNonNullIntMap:(nonnull NSDictionary *)intMap - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - return intMap; -} - -- (nullable NSDictionary *) - echoNonNullEnumMap:(nonnull NSDictionary *)enumMap - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - return enumMap; -} - -- (nullable NSDictionary *) - echoNonNullClassMap:(nonnull NSDictionary *)classMap - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - return classMap; -} - -- (nullable FLTAllClassesWrapper *)echoClassWrapper:(FLTAllClassesWrapper *)wrapper - error:(FlutterError *_Nullable *_Nonnull)error { - return wrapper; -} - -- (FLTAnEnumBox *_Nullable)echoEnum:(FLTAnEnum)anEnum - error:(FlutterError *_Nullable *_Nonnull)error { - return [[FLTAnEnumBox alloc] initWithValue:anEnum]; -} - -- (FLTAnotherEnumBox *_Nullable)echoAnotherEnum:(FLTAnotherEnum)anotherEnum - error:(FlutterError *_Nullable *_Nonnull)error { - return [[FLTAnotherEnumBox alloc] initWithValue:anotherEnum]; -} - -- (nullable NSString *)echoNamedDefaultString:(NSString *)aString - error:(FlutterError *_Nullable *_Nonnull)error { - return aString; -} - -- (nullable NSNumber *)echoOptionalDefaultDouble:(double)aDouble - error:(FlutterError *_Nullable *_Nonnull)error { - return @(aDouble); -} - -- (nullable NSNumber *)echoRequiredInt:(NSInteger)anInt - error:(FlutterError *_Nullable *_Nonnull)error { - return @(anInt); -} - -- (nullable NSString *)extractNestedNullableStringFrom:(FLTAllClassesWrapper *)wrapper - error:(FlutterError *_Nullable *_Nonnull)error { - return wrapper.allNullableTypes.aNullableString; -} - -- (nullable FLTAllClassesWrapper *) - createNestedObjectWithNullableString:(nullable NSString *)nullableString - error:(FlutterError *_Nullable *_Nonnull)error { - FLTAllNullableTypes *innerObject = [[FLTAllNullableTypes alloc] init]; - innerObject.aNullableString = nullableString; - return [FLTAllClassesWrapper makeWithAllNullableTypes:innerObject - allNullableTypesWithoutRecursion:nil - allTypes:nil - classList:@[] - nullableClassList:nil - classMap:@{} - nullableClassMap:nil]; -} - -- (nullable FLTAllNullableTypes *) - sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - error:(FlutterError *_Nullable *_Nonnull)error { - FLTAllNullableTypes *someTypes = [[FLTAllNullableTypes alloc] init]; - someTypes.aNullableBool = aNullableBool; - someTypes.aNullableInt = aNullableInt; - someTypes.aNullableString = aNullableString; - return someTypes; -} - -- (nullable FLTAllNullableTypesWithoutRecursion *) - sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - error: - (FlutterError *_Nullable __autoreleasing *_Nonnull) - error { - FLTAllNullableTypesWithoutRecursion *someTypes = - [[FLTAllNullableTypesWithoutRecursion alloc] init]; - someTypes.aNullableBool = aNullableBool; - someTypes.aNullableInt = aNullableInt; - someTypes.aNullableString = aNullableString; - return someTypes; -} - -- (nullable NSNumber *)echoNullableInt:(nullable NSNumber *)aNullableInt - error:(FlutterError *_Nullable *_Nonnull)error { - return aNullableInt; -} - -- (nullable NSNumber *)echoNullableDouble:(nullable NSNumber *)aNullableDouble - error:(FlutterError *_Nullable *_Nonnull)error { - return aNullableDouble; -} - -- (nullable NSNumber *)echoNullableBool:(nullable NSNumber *)aNullableBool - error:(FlutterError *_Nullable *_Nonnull)error { - return aNullableBool; -} - -- (nullable NSString *)echoNullableString:(nullable NSString *)aNullableString - error:(FlutterError *_Nullable *_Nonnull)error { - return aNullableString; -} - -- (nullable FlutterStandardTypedData *) - echoNullableUint8List:(nullable FlutterStandardTypedData *)aNullableUint8List - error:(FlutterError *_Nullable *_Nonnull)error { - return aNullableUint8List; -} - -- (nullable id)echoNullableObject:(nullable id)aNullableObject - error:(FlutterError *_Nullable *_Nonnull)error { - return aNullableObject; -} - -- (nullable NSArray *)echoNullableList:(nullable NSArray *)aNullableList - error:(FlutterError *_Nullable *_Nonnull)error { - return aNullableList; -} - -- (nullable NSArray *) - echoNullableEnumList:(nullable NSArray *)enumList - error:(FlutterError *_Nullable *_Nonnull)error { - return enumList; -} - -- (nullable NSArray *) - echoNullableClassList:(nullable NSArray *)classList - error:(FlutterError *_Nullable *_Nonnull)error { - return classList; -} - -- (nullable NSArray *) - echoNullableNonNullEnumList:(nullable NSArray *)enumList - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - return enumList; -} - -- (nullable NSArray *) - echoNullableNonNullClassList:(nullable NSArray *)classList - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - return classList; -} - -- (nullable NSDictionary *)echoNullableMap:(nullable NSDictionary *)map - error:(FlutterError *_Nullable *_Nonnull)error { - return map; -} - -- (nullable NSDictionary *) - echoNullableStringMap:(nullable NSDictionary *)stringMap - error:(FlutterError *_Nullable *_Nonnull)error { - return stringMap; -} - -- (nullable NSDictionary *) - echoNullableIntMap:(nullable NSDictionary *)intMap - error:(FlutterError *_Nullable *_Nonnull)error { - return intMap; -} - -- (nullable NSDictionary *) - echoNullableEnumMap:(nullable NSDictionary *)enumMap - error:(FlutterError *_Nullable *_Nonnull)error { - return enumMap; -} - -- (nullable NSDictionary *) - echoNullableClassMap:(nullable NSDictionary *)classMap - error:(FlutterError *_Nullable *_Nonnull)error { - return classMap; -} - -- (nullable NSDictionary *) - echoNullableNonNullStringMap:(nullable NSDictionary *)stringMap - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - return stringMap; -} - -- (nullable NSDictionary *) - echoNullableNonNullIntMap:(nullable NSDictionary *)intMap - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - return intMap; -} - -- (nullable NSDictionary *) - echoNullableNonNullEnumMap:(nullable NSDictionary *)enumMap - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - return enumMap; -} - -- (nullable NSDictionary *) - echoNullableNonNullClassMap:(nullable NSDictionary *)classMap - error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - return classMap; -} - -- (FLTAnEnumBox *_Nullable)echoNullableEnum:(nullable FLTAnEnumBox *)AnEnumBoxed - error:(FlutterError *_Nullable *_Nonnull)error { - return AnEnumBoxed; -} - -- (FLTAnotherEnumBox *_Nullable)echoAnotherNullableEnum: - (nullable FLTAnotherEnumBox *)AnotherEnumBoxed - error:(FlutterError *_Nullable *_Nonnull)error { - return AnotherEnumBoxed; -} - -- (nullable NSNumber *)echoOptionalNullableInt:(nullable NSNumber *)aNullableInt - error:(FlutterError *_Nullable *_Nonnull)error { - return aNullableInt; -} - -- (nullable NSString *)echoNamedNullableString:(nullable NSString *)aNullableString - error:(FlutterError *_Nullable *_Nonnull)error { - return aNullableString; -} - -- (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion { - completion(nil); -} - -- (void)throwAsyncErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion { - completion(nil, [FlutterError errorWithCode:@"An error" message:nil details:nil]); -} - -- (void)throwAsyncErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion { - completion([FlutterError errorWithCode:@"An error" message:nil details:nil]); -} - -- (void)throwAsyncFlutterErrorWithCompletion:(void (^)(id _Nullable, - FlutterError *_Nullable))completion { - completion(nil, [FlutterError errorWithCode:@"code" message:@"message" details:@"details"]); -} - -- (void)echoAsyncAllTypes:(FLTAllTypes *)everything - completion:(void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion { - completion(everything, nil); -} - -- (void)echoAsyncNullableAllNullableTypes:(nullable FLTAllNullableTypes *)everything - completion:(void (^)(FLTAllNullableTypes *_Nullable, - FlutterError *_Nullable))completion { - completion(everything, nil); -} - -- (void) - echoAsyncNullableAllNullableTypesWithoutRecursion: - (nullable FLTAllNullableTypesWithoutRecursion *)everything - completion: - (nonnull void (^)( - FLTAllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion { - completion(everything, nil); -} - -- (void)echoAsyncInt:(NSInteger)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - completion(@(anInt), nil); -} - -- (void)echoAsyncDouble:(double)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - completion(@(aDouble), nil); -} - -- (void)echoAsyncBool:(BOOL)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - completion(@(aBool), nil); -} - -- (void)echoAsyncString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - completion(aString, nil); -} - -- (void)echoAsyncUint8List:(FlutterStandardTypedData *)aUint8List - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion { - completion(aUint8List, nil); -} - -- (void)echoAsyncObject:(id)anObject - completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion { - completion(anObject, nil); -} - -- (void)echoAsyncList:(NSArray *)list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - completion(list, nil); -} - -- (void)echoAsyncEnumList:(NSArray *)enumList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion { - completion(enumList, nil); -} - -- (void)echoAsyncClassList:(NSArray *)classList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion { - completion(classList, nil); -} - -- (void)echoAsyncMap:(NSDictionary *)map - completion: - (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - completion(map, nil); -} - -- (void)echoAsyncStringMap:(NSDictionary *)stringMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - completion(stringMap, nil); -} - -- (void)echoAsyncIntMap:(NSDictionary *)intMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - completion(intMap, nil); -} - -- (void)echoAsyncEnumMap:(NSDictionary *)enumMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - completion(enumMap, nil); -} - -- (void)echoAsyncClassMap:(NSDictionary *)classMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - completion(classMap, nil); -} - -- (void)echoAsyncEnum:(FLTAnEnum)anEnum - completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion { - completion([[FLTAnEnumBox alloc] initWithValue:anEnum], nil); -} - -- (void)echoAnotherAsyncEnum:(FLTAnotherEnum)anotherEnum - completion: - (void (^)(FLTAnotherEnumBox *_Nullable, FlutterError *_Nullable))completion { - completion([[FLTAnotherEnumBox alloc] initWithValue:anotherEnum], nil); -} - -- (void)echoAsyncNullableInt:(nullable NSNumber *)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - completion(anInt, nil); -} - -- (void)echoAsyncNullableDouble:(nullable NSNumber *)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - completion(aDouble, nil); -} - -- (void)echoAsyncNullableBool:(nullable NSNumber *)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - completion(aBool, nil); -} - -- (void)echoAsyncNullableString:(nullable NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - completion(aString, nil); -} - -- (void)echoAsyncNullableUint8List:(nullable FlutterStandardTypedData *)aUint8List - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion { - completion(aUint8List, nil); -} - -- (void)echoAsyncNullableObject:(nullable id)anObject - completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion { - completion(anObject, nil); -} - -- (void)echoAsyncNullableList:(nullable NSArray *)list - completion: - (void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - completion(list, nil); -} - -- (void)echoAsyncNullableEnumList:(nullable NSArray *)enumList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion { - completion(enumList, nil); -} - -- (void)echoAsyncNullableClassList:(nullable NSArray *)classList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion { - completion(classList, nil); -} - -- (void)echoAsyncNullableMap:(nullable NSDictionary *)map - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - completion(map, nil); -} - -- (void)echoAsyncNullableStringMap:(nullable NSDictionary *)stringMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - completion(stringMap, nil); -} - -- (void)echoAsyncNullableIntMap:(nullable NSDictionary *)intMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - completion(intMap, nil); -} - -- (void)echoAsyncNullableEnumMap:(nullable NSDictionary *)enumMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - completion(enumMap, nil); -} - -- (void) - echoAsyncNullableClassMap:(nullable NSDictionary *)classMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - completion(classMap, nil); -} - -- (void)echoAsyncNullableEnum:(nullable FLTAnEnumBox *)AnEnumBoxed - completion: - (void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion { - completion(AnEnumBoxed, nil); -} - -- (void)echoAnotherAsyncNullableEnum:(nullable FLTAnotherEnumBox *)AnotherEnumBoxed - completion:(void (^)(FLTAnotherEnumBox *_Nullable, - FlutterError *_Nullable))completion { - completion(AnotherEnumBoxed, nil); -} - -- (nullable NSNumber *)defaultIsMainThreadWithError:(FlutterError *_Nullable *_Nonnull)error { - // Using boxing on an inline expression results in the Dart side receiving an int, so - // force the right type via numberWithBool. - return [NSNumber numberWithBool:NSThread.isMainThread]; -} - -- (nullable NSNumber *)taskQueueIsBackgroundThreadWithError: - (FlutterError *_Nullable *_Nonnull)error { - // Using boxing on an inline expression results in the Dart side receiving an int, so - // force the right type via numberWithBool. - return [NSNumber numberWithBool:!NSThread.isMainThread]; -} - -- (void)callFlutterNoopWithCompletion:(void (^)(FlutterError *_Nullable))completion { - [self.flutterAPI noopWithCompletion:^(FlutterError *error) { - completion(error); - }]; -} - -- (void)callFlutterThrowErrorWithCompletion:(void (^)(id _Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI throwErrorWithCompletion:^(id value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterThrowErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion { - [self.flutterAPI throwErrorFromVoidWithCompletion:^(FlutterError *error) { - completion(error); - }]; -} - -- (void)callFlutterEchoAllTypes:(FLTAllTypes *)everything - completion: - (void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion { - [self.flutterAPI echoAllTypes:everything - completion:^(FLTAllTypes *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterSendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - completion:(void (^)(FLTAllNullableTypes *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI - sendMultipleNullableTypesABool:aNullableBool - anInt:aNullableInt - aString:aNullableString - completion:^(FLTAllNullableTypes *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterSendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString: - (nullable NSString *)aNullableString - completion: - (nonnull void (^)( - FLTAllNullableTypesWithoutRecursion - *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI - sendMultipleNullableTypesWithoutRecursionABool:aNullableBool - anInt:aNullableInt - aString:aNullableString - completion:^(FLTAllNullableTypesWithoutRecursion *value, - FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoBool:(BOOL)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - [self.flutterAPI echoBool:aBool - completion:^(NSNumber *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoInt:(NSInteger)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - [self.flutterAPI echoInt:anInt - completion:^(NSNumber *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoDouble:(double)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - [self.flutterAPI echoDouble:aDouble - completion:^(NSNumber *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - [self.flutterAPI echoString:aString - completion:^(NSString *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoUint8List:(FlutterStandardTypedData *)list - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI echoUint8List:list - completion:^(FlutterStandardTypedData *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoList:(NSArray *)list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - [self.flutterAPI echoList:list - completion:^(NSArray *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoEnumList:(NSArray *)enumList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI echoEnumList:enumList - completion:^(NSArray *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoClassList:(NSArray *)classList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI echoClassList:classList - completion:^(NSArray *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoNonNullEnumList:(nonnull NSArray *)enumList - completion:(nonnull void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI echoNonNullEnumList:enumList - completion:^(NSArray *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoNonNullClassList:(nonnull NSArray *)classList - completion:(nonnull void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI - echoNonNullClassList:classList - completion:^(NSArray *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoMap:(NSDictionary *)map - completion: - (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - [self.flutterAPI echoMap:map - completion:^(NSDictionary *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoStringMap:(NSDictionary *)stringMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI - echoStringMap:stringMap - completion:^(NSDictionary *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoIntMap:(NSDictionary *)intMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI echoIntMap:intMap - completion:^(NSDictionary *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoEnumMap:(NSDictionary *)enumMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI - echoEnumMap:enumMap - completion:^(NSDictionary *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoClassMap:(NSDictionary *)classMap - completion: - (void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI - echoClassMap:classMap - completion:^(NSDictionary *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoNonNullStringMap:(nonnull NSDictionary *)stringMap - completion: - (nonnull void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI - echoNonNullStringMap:stringMap - completion:^(NSDictionary *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoNonNullIntMap:(nonnull NSDictionary *)intMap - completion: - (nonnull void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI - echoNonNullIntMap:intMap - completion:^(NSDictionary *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoNonNullEnumMap: - (nonnull NSDictionary *)enumMap - completion:(nonnull void (^)( - NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI echoNonNullEnumMap:enumMap - completion:^(NSDictionary *value, - FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoNonNullClassMap: - (nonnull NSDictionary *)classMap - completion: - (nonnull void (^)( - NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI echoNonNullClassMap:classMap - completion:^(NSDictionary *value, - FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoEnum:(FLTAnEnum)anEnum - completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion { - [self.flutterAPI echoEnum:anEnum - completion:^(FLTAnEnumBox *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoAnotherEnum:(FLTAnotherEnum)anotherEnum - completion:(void (^)(FLTAnotherEnumBox *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI echoAnotherEnum:anotherEnum - completion:^(FLTAnotherEnumBox *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoAllNullableTypes:(nullable FLTAllNullableTypes *)everything - completion:(void (^)(FLTAllNullableTypes *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI echoAllNullableTypes:everything - completion:^(FLTAllNullableTypes *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoAllNullableTypesWithoutRecursion: - (nullable FLTAllNullableTypesWithoutRecursion *)everything - completion: - (nonnull void (^)( - FLTAllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI - echoAllNullableTypesWithoutRecursion:everything - completion:^(FLTAllNullableTypesWithoutRecursion *value, - FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoNullableBool:(nullable NSNumber *)aBool - completion: - (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - [self.flutterAPI echoNullableBool:aBool - completion:^(NSNumber *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoNullableInt:(nullable NSNumber *)anInt - completion: - (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - [self.flutterAPI echoNullableInt:anInt - completion:^(NSNumber *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoNullableDouble:(nullable NSNumber *)aDouble - completion: - (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - [self.flutterAPI echoNullableDouble:aDouble - completion:^(NSNumber *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoNullableString:(nullable NSString *)aString - completion: - (void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - [self.flutterAPI echoNullableString:aString - completion:^(NSString *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoNullableUint8List:(nullable FlutterStandardTypedData *)list - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI echoNullableUint8List:list - completion:^(FlutterStandardTypedData *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoNullableList:(nullable NSArray *)list - completion: - (void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - [self.flutterAPI echoNullableList:list - completion:^(NSArray *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoNullableEnumList:(nullable NSArray *)enumList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI echoNullableEnumList:enumList - completion:^(NSArray *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoNullableClassList:(nullable NSArray *)classList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI - echoNullableClassList:classList - completion:^(NSArray *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoNullableNonNullEnumList:(nullable NSArray *)enumList - completion: - (nonnull void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI - echoNullableNonNullEnumList:enumList - completion:^(NSArray *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoNullableNonNullClassList:(nullable NSArray *)classList - completion:(nonnull void (^)( - NSArray *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI - echoNullableNonNullClassList:classList - completion:^(NSArray *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)map - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI echoNullableMap:map - completion:^(NSDictionary *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoNullableStringMap:(nullable NSDictionary *)stringMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI - echoNullableStringMap:stringMap - completion:^(NSDictionary *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoNullableIntMap:(nullable NSDictionary *)intMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI - echoNullableIntMap:intMap - completion:^(NSDictionary *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoNullableEnumMap: - (nullable NSDictionary *)enumMap - completion: - (void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI echoNullableEnumMap:enumMap - completion:^(NSDictionary *value, - FlutterError *error) { - completion(value, error); - }]; -} - -- (void) - callFlutterEchoNullableClassMap: - (nullable NSDictionary *)classMap - completion: - (void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI echoNullableClassMap:classMap - completion:^(NSDictionary *value, - FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoNullableNonNullStringMap: - (nullable NSDictionary *)stringMap - completion:(nonnull void (^)( - NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI echoNullableNonNullStringMap:stringMap - completion:^(NSDictionary *value, - FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoNullableNonNullIntMap:(nullable NSDictionary *)intMap - completion:(nonnull void (^)( - NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI echoNullableNonNullIntMap:intMap - completion:^(NSDictionary *value, - FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoNullableNonNullEnumMap: - (nullable NSDictionary *)enumMap - completion: - (nonnull void (^)( - NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI echoNullableNonNullEnumMap:enumMap - completion:^(NSDictionary *value, - FlutterError *error) { - completion(value, error); - }]; -} - -- (void) - callFlutterEchoNullableNonNullClassMap: - (nullable NSDictionary *)classMap - completion: - (nonnull void (^)( - NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI - echoNullableNonNullClassMap:classMap - completion:^(NSDictionary *value, - FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoNullableEnum:(nullable FLTAnEnumBox *)AnEnumBoxed - completion:(void (^)(FLTAnEnumBox *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI echoNullableEnum:AnEnumBoxed - completion:^(FLTAnEnumBox *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterEchoAnotherNullableEnum:(nullable FLTAnotherEnumBox *)AnotherEnumBoxed - completion:(void (^)(FLTAnotherEnumBox *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI echoAnotherNullableEnum:AnotherEnumBoxed - completion:^(FLTAnotherEnumBox *value, FlutterError *error) { - completion(value, error); - }]; -} - -- (void)callFlutterSmallApiEchoString:(nonnull NSString *)aString - completion:(nonnull void (^)(NSString *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterSmallApiOne - echoString:aString - completion:^(NSString *valueOne, FlutterError *error) { - [self.flutterSmallApiTwo - echoString:aString - completion:^(NSString *valueTwo, FlutterError *error) { - if ([valueOne isEqualToString:valueTwo]) { - completion(valueTwo, error); - } else { - completion( - nil, - [FlutterError - errorWithCode:@"Responses do not match" - message:[NSString stringWithFormat: - @"%@%@%@%@", - @"Multi-instance responses were not matching: ", - valueOne, @", ", valueTwo] - details:nil]); - } - }]; - }]; -} - -- (FLTUnusedClass *)checkIfUnusedClassGenerated { - return [[FLTUnusedClass alloc] init]; -} - -@end - -@interface AlternateLanguageTestAPIWithSuffix () -@end - -@implementation AlternateLanguageTestAPIWithSuffix -+ (void)registerWithRegistrar:(NSObject *)registrar - suffix:(NSString *)suffix { - AlternateLanguageTestAPIWithSuffix *api = [[AlternateLanguageTestAPIWithSuffix alloc] init]; - SetUpFLTHostSmallApiWithSuffix([registrar messenger], api, suffix); -} - -#pragma mark HostSmallAPI implementation - -- (void)echoString:(nonnull NSString *)aString - completion:(nonnull void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - completion(aString, nil); -} - -- (void)voidVoidWithCompletion:(nonnull void (^)(FlutterError *_Nullable))completion { - completion(nil); -} - -@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 deleted file mode 100644 index 3a7b01778b9..00000000000 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.h +++ /dev/null @@ -1,1134 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// -// Autogenerated from Pigeon, do not edit directly. -// See also: https://pub.dev/packages/pigeon - -#import - -@protocol FlutterBinaryMessenger; -@protocol FlutterMessageCodec; -@class FlutterError; -@class FlutterStandardTypedData; - -NS_ASSUME_NONNULL_BEGIN - -typedef NS_ENUM(NSUInteger, FLTAnEnum) { - FLTAnEnumOne = 0, - FLTAnEnumTwo = 1, - FLTAnEnumThree = 2, - FLTAnEnumFortyTwo = 3, - FLTAnEnumFourHundredTwentyTwo = 4, -}; - -/// Wrapper for FLTAnEnum to allow for nullability. -@interface FLTAnEnumBox : NSObject -@property(nonatomic, assign) FLTAnEnum value; -- (instancetype)initWithValue:(FLTAnEnum)value; -@end - -typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { - FLTAnotherEnumJustInCase = 0, -}; - -/// Wrapper for FLTAnotherEnum to allow for nullability. -@interface FLTAnotherEnumBox : NSObject -@property(nonatomic, assign) FLTAnotherEnum value; -- (instancetype)initWithValue:(FLTAnotherEnum)value; -@end - -@class FLTUnusedClass; -@class FLTAllTypes; -@class FLTAllNullableTypes; -@class FLTAllNullableTypesWithoutRecursion; -@class FLTAllClassesWrapper; -@class FLTTestMessage; - -@interface FLTUnusedClass : NSObject -+ (instancetype)makeWithAField:(nullable id)aField; -@property(nonatomic, strong, nullable) id aField; -@end - -/// A class containing all supported types. -@interface FLTAllTypes : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithABool:(BOOL)aBool - anInt:(NSInteger)anInt - anInt64:(NSInteger)anInt64 - aDouble:(double)aDouble - aByteArray:(FlutterStandardTypedData *)aByteArray - a4ByteArray:(FlutterStandardTypedData *)a4ByteArray - a8ByteArray:(FlutterStandardTypedData *)a8ByteArray - aFloatArray:(FlutterStandardTypedData *)aFloatArray - anEnum:(FLTAnEnum)anEnum - anotherEnum:(FLTAnotherEnum)anotherEnum - aString:(NSString *)aString - anObject:(id)anObject - list:(NSArray *)list - stringList:(NSArray *)stringList - intList:(NSArray *)intList - doubleList:(NSArray *)doubleList - boolList:(NSArray *)boolList - enumList:(NSArray *)enumList - objectList:(NSArray *)objectList - listList:(NSArray *> *)listList - mapList:(NSArray *> *)mapList - map:(NSDictionary *)map - stringMap:(NSDictionary *)stringMap - intMap:(NSDictionary *)intMap - enumMap:(NSDictionary *)enumMap - objectMap:(NSDictionary *)objectMap - listMap:(NSDictionary *> *)listMap - mapMap:(NSDictionary *> *)mapMap; -@property(nonatomic, assign) BOOL aBool; -@property(nonatomic, assign) NSInteger anInt; -@property(nonatomic, assign) NSInteger anInt64; -@property(nonatomic, assign) double aDouble; -@property(nonatomic, strong) FlutterStandardTypedData *aByteArray; -@property(nonatomic, strong) FlutterStandardTypedData *a4ByteArray; -@property(nonatomic, strong) FlutterStandardTypedData *a8ByteArray; -@property(nonatomic, strong) FlutterStandardTypedData *aFloatArray; -@property(nonatomic, assign) FLTAnEnum anEnum; -@property(nonatomic, assign) FLTAnotherEnum anotherEnum; -@property(nonatomic, copy) NSString *aString; -@property(nonatomic, strong) id anObject; -@property(nonatomic, copy) NSArray *list; -@property(nonatomic, copy) NSArray *stringList; -@property(nonatomic, copy) NSArray *intList; -@property(nonatomic, copy) NSArray *doubleList; -@property(nonatomic, copy) NSArray *boolList; -@property(nonatomic, copy) NSArray *enumList; -@property(nonatomic, copy) NSArray *objectList; -@property(nonatomic, copy) NSArray *> *listList; -@property(nonatomic, copy) NSArray *> *mapList; -@property(nonatomic, copy) NSDictionary *map; -@property(nonatomic, copy) NSDictionary *stringMap; -@property(nonatomic, copy) NSDictionary *intMap; -@property(nonatomic, copy) NSDictionary *enumMap; -@property(nonatomic, copy) NSDictionary *objectMap; -@property(nonatomic, copy) NSDictionary *> *listMap; -@property(nonatomic, copy) NSDictionary *> *mapMap; -@end - -/// A class containing all supported nullable types. -@interface FLTAllNullableTypes : NSObject -+ (instancetype) - makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum - anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject - allNullableTypes:(nullable FLTAllNullableTypes *)allNullableTypes - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - enumList:(nullable NSArray *)enumList - objectList:(nullable NSArray *)objectList - listList:(nullable NSArray *> *)listList - mapList:(nullable NSArray *> *)mapList - recursiveClassList:(nullable NSArray *)recursiveClassList - map:(nullable NSDictionary *)map - stringMap:(nullable NSDictionary *)stringMap - intMap:(nullable NSDictionary *)intMap - enumMap:(nullable NSDictionary *)enumMap - objectMap:(nullable NSDictionary *)objectMap - listMap:(nullable NSDictionary *> *)listMap - mapMap:(nullable NSDictionary *> *)mapMap - recursiveClassMap: - (nullable NSDictionary *)recursiveClassMap; -@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, strong, nullable) FLTAnEnumBox *aNullableEnum; -@property(nonatomic, strong, nullable) FLTAnotherEnumBox *anotherNullableEnum; -@property(nonatomic, copy, nullable) NSString *aNullableString; -@property(nonatomic, strong, nullable) id aNullableObject; -@property(nonatomic, strong, nullable) FLTAllNullableTypes *allNullableTypes; -@property(nonatomic, copy, nullable) NSArray *list; -@property(nonatomic, copy, nullable) NSArray *stringList; -@property(nonatomic, copy, nullable) NSArray *intList; -@property(nonatomic, copy, nullable) NSArray *doubleList; -@property(nonatomic, copy, nullable) NSArray *boolList; -@property(nonatomic, copy, nullable) NSArray *enumList; -@property(nonatomic, copy, nullable) NSArray *objectList; -@property(nonatomic, copy, nullable) NSArray *> *listList; -@property(nonatomic, copy, nullable) NSArray *> *mapList; -@property(nonatomic, copy, nullable) NSArray *recursiveClassList; -@property(nonatomic, copy, nullable) NSDictionary *map; -@property(nonatomic, copy, nullable) NSDictionary *stringMap; -@property(nonatomic, copy, nullable) NSDictionary *intMap; -@property(nonatomic, copy, nullable) NSDictionary *enumMap; -@property(nonatomic, copy, nullable) NSDictionary *objectMap; -@property(nonatomic, copy, nullable) NSDictionary *> *listMap; -@property(nonatomic, copy, nullable) NSDictionary *> *mapMap; -@property(nonatomic, copy, nullable) - NSDictionary *recursiveClassMap; -@end - -/// The primary purpose for this class is to ensure coverage of Swift structs -/// with nullable items, as the primary [AllNullableTypes] class is being used to -/// test Swift classes. -@interface FLTAllNullableTypesWithoutRecursion : NSObject -+ (instancetype) - makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum - anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - enumList:(nullable NSArray *)enumList - objectList:(nullable NSArray *)objectList - listList:(nullable NSArray *> *)listList - mapList:(nullable NSArray *> *)mapList - map:(nullable NSDictionary *)map - stringMap:(nullable NSDictionary *)stringMap - intMap:(nullable NSDictionary *)intMap - enumMap:(nullable NSDictionary *)enumMap - objectMap:(nullable NSDictionary *)objectMap - listMap:(nullable NSDictionary *> *)listMap - mapMap:(nullable NSDictionary *> *)mapMap; -@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, strong, nullable) FLTAnEnumBox *aNullableEnum; -@property(nonatomic, strong, nullable) FLTAnotherEnumBox *anotherNullableEnum; -@property(nonatomic, copy, nullable) NSString *aNullableString; -@property(nonatomic, strong, nullable) id aNullableObject; -@property(nonatomic, copy, nullable) NSArray *list; -@property(nonatomic, copy, nullable) NSArray *stringList; -@property(nonatomic, copy, nullable) NSArray *intList; -@property(nonatomic, copy, nullable) NSArray *doubleList; -@property(nonatomic, copy, nullable) NSArray *boolList; -@property(nonatomic, copy, nullable) NSArray *enumList; -@property(nonatomic, copy, nullable) NSArray *objectList; -@property(nonatomic, copy, nullable) NSArray *> *listList; -@property(nonatomic, copy, nullable) NSArray *> *mapList; -@property(nonatomic, copy, nullable) NSDictionary *map; -@property(nonatomic, copy, nullable) NSDictionary *stringMap; -@property(nonatomic, copy, nullable) NSDictionary *intMap; -@property(nonatomic, copy, nullable) NSDictionary *enumMap; -@property(nonatomic, copy, nullable) NSDictionary *objectMap; -@property(nonatomic, copy, nullable) NSDictionary *> *listMap; -@property(nonatomic, copy, nullable) NSDictionary *> *mapMap; -@end - -/// A class for testing nested class handling. -/// -/// This is needed to test nested nullable and non-nullable classes, -/// `AllNullableTypes` is non-nullable here as it is easier to instantiate -/// than `AllTypes` when testing doesn't require both (ie. testing null classes). -@interface FLTAllClassesWrapper : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype) - makeWithAllNullableTypes:(FLTAllNullableTypes *)allNullableTypes - allNullableTypesWithoutRecursion: - (nullable FLTAllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion - allTypes:(nullable FLTAllTypes *)allTypes - classList:(NSArray *)classList - nullableClassList: - (nullable NSArray *)nullableClassList - classMap:(NSDictionary *)classMap - nullableClassMap: - (nullable NSDictionary *) - nullableClassMap; -@property(nonatomic, strong) FLTAllNullableTypes *allNullableTypes; -@property(nonatomic, strong, nullable) - FLTAllNullableTypesWithoutRecursion *allNullableTypesWithoutRecursion; -@property(nonatomic, strong, nullable) FLTAllTypes *allTypes; -@property(nonatomic, copy) NSArray *classList; -@property(nonatomic, copy, nullable) - NSArray *nullableClassList; -@property(nonatomic, copy) NSDictionary *classMap; -@property(nonatomic, copy, nullable) - NSDictionary *nullableClassMap; -@end - -/// A data class containing a List, used in unit tests. -@interface FLTTestMessage : NSObject -+ (instancetype)makeWithTestList:(nullable NSArray *)testList; -@property(nonatomic, copy, nullable) NSArray *testList; -@end - -/// The codec used by all APIs. -NSObject *FLTGetCoreTestsCodec(void); - -/// The core interface that each host language plugin must implement in -/// platform_test integration tests. -@protocol FLTHostIntegrationCoreApi -/// A no-op function taking no arguments and returning no value, to sanity -/// test basic calling. -- (void)noopWithError:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed object, to test serialization and deserialization. -/// -/// @return `nil` only when `error != nil`. -- (nullable FLTAllTypes *)echoAllTypes:(FLTAllTypes *)everything - error:(FlutterError *_Nullable *_Nonnull)error; -/// 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. -- (void)throwErrorFromVoidWithError:(FlutterError *_Nullable *_Nonnull)error; -/// Returns a Flutter error, to test error handling. -- (nullable id)throwFlutterErrorWithError:(FlutterError *_Nullable *_Nonnull)error; -/// Returns passed in int. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)echoInt:(NSInteger)anInt error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns passed in double. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)echoDouble:(double)aDouble error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed in boolean. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)echoBool:(BOOL)aBool error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed in string. -/// -/// @return `nil` only when `error != nil`. -- (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; -/// Returns the passed in generic Object. -/// -/// @return `nil` only when `error != nil`. -- (nullable id)echoObject:(id)anObject error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed list, to test serialization and deserialization. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSArray *)echoList:(NSArray *)list - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed list, to test serialization and deserialization. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSArray *)echoEnumList:(NSArray *)enumList - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed list, to test serialization and deserialization. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSArray *)echoClassList: - (NSArray *)classList - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed list, to test serialization and deserialization. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSArray *)echoNonNullEnumList:(NSArray *)enumList - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed list, to test serialization and deserialization. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSArray *) - echoNonNullClassList:(NSArray *)classList - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map, to test serialization and deserialization. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSDictionary *)echoMap:(NSDictionary *)map - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map, to test serialization and deserialization. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSDictionary *) - echoStringMap:(NSDictionary *)stringMap - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map, to test serialization and deserialization. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSDictionary *) - echoIntMap:(NSDictionary *)intMap - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map, to test serialization and deserialization. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSDictionary *) - echoEnumMap:(NSDictionary *)enumMap - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map, to test serialization and deserialization. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSDictionary *) - echoClassMap:(NSDictionary *)classMap - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map, to test serialization and deserialization. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSDictionary *) - echoNonNullStringMap:(NSDictionary *)stringMap - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map, to test serialization and deserialization. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSDictionary *) - echoNonNullIntMap:(NSDictionary *)intMap - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map, to test serialization and deserialization. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSDictionary *) - echoNonNullEnumMap:(NSDictionary *)enumMap - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map, to test serialization and deserialization. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSDictionary *) - echoNonNullClassMap:(NSDictionary *)classMap - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed class to test nested class serialization and deserialization. -/// -/// @return `nil` only when `error != nil`. -- (nullable FLTAllClassesWrapper *)echoClassWrapper:(FLTAllClassesWrapper *)wrapper - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed enum to test serialization and deserialization. -/// -/// @return `nil` only when `error != nil`. -- (FLTAnEnumBox *_Nullable)echoEnum:(FLTAnEnum)anEnum - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed enum to test serialization and deserialization. -/// -/// @return `nil` only when `error != nil`. -- (FLTAnotherEnumBox *_Nullable)echoAnotherEnum:(FLTAnotherEnum)anotherEnum - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the default string. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSString *)echoNamedDefaultString:(NSString *)aString - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns passed in double. -/// -/// @return `nil` only when `error != nil`. -- (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; -/// Returns the passed object, to test serialization and deserialization. -- (nullable FLTAllNullableTypes *)echoAllNullableTypes:(nullable FLTAllNullableTypes *)everything - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed object, to test serialization and deserialization. -- (nullable FLTAllNullableTypesWithoutRecursion *) - echoAllNullableTypesWithoutRecursion:(nullable FLTAllNullableTypesWithoutRecursion *)everything - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the inner `aString` value from the wrapped object, to test -/// sending of nested objects. -- (nullable NSString *)extractNestedNullableStringFrom:(FLTAllClassesWrapper *)wrapper - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the inner `aString` value from the wrapped object, to test -/// sending of nested objects. -/// -/// @return `nil` only when `error != nil`. -- (nullable FLTAllClassesWrapper *) - createNestedObjectWithNullableString:(nullable NSString *)nullableString - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns passed in arguments of multiple types. -/// -/// @return `nil` only when `error != nil`. -- (nullable FLTAllNullableTypes *) - sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns passed in arguments of multiple types. -/// -/// @return `nil` only when `error != nil`. -- (nullable FLTAllNullableTypesWithoutRecursion *) - sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns passed in int. -- (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; -/// Returns the passed in boolean. -- (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; -/// Returns the passed in Uint8List. -- (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; -/// Returns the passed list, to test serialization and deserialization. -- (nullable NSArray *)echoNullableList:(nullable NSArray *)aNullableList - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed list, to test serialization and deserialization. -- (nullable NSArray *)echoNullableEnumList: - (nullable NSArray *)enumList - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed list, to test serialization and deserialization. -- (nullable NSArray *) - echoNullableClassList:(nullable NSArray *)classList - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed list, to test serialization and deserialization. -- (nullable NSArray *) - echoNullableNonNullEnumList:(nullable NSArray *)enumList - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed list, to test serialization and deserialization. -- (nullable NSArray *) - echoNullableNonNullClassList:(nullable NSArray *)classList - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map, to test serialization and deserialization. -- (nullable NSDictionary *)echoNullableMap:(nullable NSDictionary *)map - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map, to test serialization and deserialization. -- (nullable NSDictionary *) - echoNullableStringMap:(nullable NSDictionary *)stringMap - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map, to test serialization and deserialization. -- (nullable NSDictionary *) - echoNullableIntMap:(nullable NSDictionary *)intMap - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map, to test serialization and deserialization. -- (nullable NSDictionary *) - echoNullableEnumMap:(nullable NSDictionary *)enumMap - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map, to test serialization and deserialization. -- (nullable NSDictionary *) - echoNullableClassMap:(nullable NSDictionary *)classMap - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map, to test serialization and deserialization. -- (nullable NSDictionary *) - echoNullableNonNullStringMap:(nullable NSDictionary *)stringMap - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map, to test serialization and deserialization. -- (nullable NSDictionary *) - echoNullableNonNullIntMap:(nullable NSDictionary *)intMap - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map, to test serialization and deserialization. -- (nullable NSDictionary *) - echoNullableNonNullEnumMap:(nullable NSDictionary *)enumMap - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map, to test serialization and deserialization. -- (nullable NSDictionary *) - echoNullableNonNullClassMap:(nullable NSDictionary *)classMap - error:(FlutterError *_Nullable *_Nonnull)error; -- (FLTAnEnumBox *_Nullable)echoNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed - error:(FlutterError *_Nullable *_Nonnull)error; -- (FLTAnotherEnumBox *_Nullable)echoAnotherNullableEnum: - (nullable FLTAnotherEnumBox *)anotherEnumBoxed - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns passed in int. -- (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; -/// 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; -/// Returns passed in double asynchronously. -- (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; -/// Returns the passed string asynchronously. -- (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; -/// Returns the passed in generic Object asynchronously. -- (void)echoAsyncObject:(id)anObject - completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; -/// Returns the passed list, to test asynchronous serialization and deserialization. -- (void)echoAsyncList:(NSArray *)list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -/// Returns the passed list, to test asynchronous serialization and deserialization. -- (void)echoAsyncEnumList:(NSArray *)enumList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed list, to test asynchronous serialization and deserialization. -- (void)echoAsyncClassList:(NSArray *)classList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncMap:(NSDictionary *)map - completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; -/// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncStringMap:(NSDictionary *)stringMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncIntMap:(NSDictionary *)intMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncEnumMap:(NSDictionary *)enumMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncClassMap:(NSDictionary *)classMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed enum, to test asynchronous serialization and deserialization. -- (void)echoAsyncEnum:(FLTAnEnum)anEnum - completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; -/// Returns the passed enum, to test asynchronous serialization and deserialization. -- (void)echoAnotherAsyncEnum:(FLTAnotherEnum)anotherEnum - completion: - (void (^)(FLTAnotherEnumBox *_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; -/// Returns the passed object, to test async serialization and deserialization. -- (void)echoAsyncAllTypes:(FLTAllTypes *)everything - completion:(void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion; -/// Returns the passed object, to test serialization and deserialization. -- (void)echoAsyncNullableAllNullableTypes:(nullable FLTAllNullableTypes *)everything - completion:(void (^)(FLTAllNullableTypes *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed object, to test serialization and deserialization. -- (void)echoAsyncNullableAllNullableTypesWithoutRecursion: - (nullable FLTAllNullableTypesWithoutRecursion *)everything - completion: - (void (^)(FLTAllNullableTypesWithoutRecursion - *_Nullable, - FlutterError *_Nullable))completion; -/// Returns passed in int asynchronously. -- (void)echoAsyncNullableInt:(nullable NSNumber *)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -/// Returns passed in double asynchronously. -- (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; -/// Returns the passed string asynchronously. -- (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; -/// Returns the passed in generic Object asynchronously. -- (void)echoAsyncNullableObject:(nullable id)anObject - completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; -/// Returns the passed list, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableList:(nullable NSArray *)list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -/// Returns the passed list, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableEnumList:(nullable NSArray *)enumList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed list, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableClassList:(nullable NSArray *)classList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableMap:(nullable NSDictionary *)map - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableStringMap:(nullable NSDictionary *)stringMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableIntMap:(nullable NSDictionary *)intMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableEnumMap:(nullable NSDictionary *)enumMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test asynchronous serialization and deserialization. -- (void) - echoAsyncNullableClassMap:(nullable NSDictionary *)classMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed enum, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed - completion: - (void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; -/// Returns the passed enum, to test asynchronous serialization and deserialization. -- (void)echoAnotherAsyncNullableEnum:(nullable FLTAnotherEnumBox *)anotherEnumBoxed - completion:(void (^)(FLTAnotherEnumBox *_Nullable, - FlutterError *_Nullable))completion; -/// Returns true if the handler is run on a main thread, which should be -/// true since there is no TaskQueue annotation. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)defaultIsMainThreadWithError:(FlutterError *_Nullable *_Nonnull)error; -/// Returns true if the handler is run on a non-main thread, which should be -/// true for any platform with TaskQueue support. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)taskQueueIsBackgroundThreadWithError: - (FlutterError *_Nullable *_Nonnull)error; -- (void)callFlutterNoopWithCompletion:(void (^)(FlutterError *_Nullable))completion; -- (void)callFlutterThrowErrorWithCompletion:(void (^)(id _Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterThrowErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; -- (void)callFlutterEchoAllTypes:(FLTAllTypes *)everything - completion: - (void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoAllNullableTypes:(nullable FLTAllNullableTypes *)everything - completion:(void (^)(FLTAllNullableTypes *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterSendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - completion:(void (^)(FLTAllNullableTypes *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoAllNullableTypesWithoutRecursion: - (nullable FLTAllNullableTypesWithoutRecursion *)everything - completion: - (void (^)( - FLTAllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion; -- (void) - callFlutterSendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - completion: - (void (^)(FLTAllNullableTypesWithoutRecursion - *_Nullable, - FlutterError *_Nullable)) - completion; -- (void)callFlutterEchoBool:(BOOL)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoInt:(NSInteger)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoDouble:(double)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoUint8List:(FlutterStandardTypedData *)list - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoList:(NSArray *)list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoEnumList:(NSArray *)enumList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoClassList:(NSArray *)classList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoNonNullEnumList:(NSArray *)enumList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoNonNullClassList:(NSArray *)classList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoMap:(NSDictionary *)map - completion: - (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoStringMap:(NSDictionary *)stringMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoIntMap:(NSDictionary *)intMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoEnumMap:(NSDictionary *)enumMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoClassMap:(NSDictionary *)classMap - completion: - (void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoNonNullStringMap:(NSDictionary *)stringMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoNonNullIntMap:(NSDictionary *)intMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoNonNullEnumMap:(NSDictionary *)enumMap - completion: - (void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -- (void) - callFlutterEchoNonNullClassMap:(NSDictionary *)classMap - completion: - (void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoEnum:(FLTAnEnum)anEnum - completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoAnotherEnum:(FLTAnotherEnum)anotherEnum - completion:(void (^)(FLTAnotherEnumBox *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableBool:(nullable NSNumber *)aBool - completion: - (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableInt:(nullable NSNumber *)anInt - completion: - (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableDouble:(nullable NSNumber *)aDouble - completion: - (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableString:(nullable NSString *)aString - completion: - (void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableUint8List:(nullable FlutterStandardTypedData *)list - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableList:(nullable NSArray *)list - completion: - (void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableEnumList:(nullable NSArray *)enumList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableClassList:(nullable NSArray *)classList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableNonNullEnumList:(nullable NSArray *)enumList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableNonNullClassList:(nullable NSArray *)classList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)map - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableStringMap:(nullable NSDictionary *)stringMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableIntMap:(nullable NSDictionary *)intMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableEnumMap: - (nullable NSDictionary *)enumMap - completion: - (void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -- (void) - callFlutterEchoNullableClassMap: - (nullable NSDictionary *)classMap - completion: - (void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableNonNullStringMap: - (nullable NSDictionary *)stringMap - completion: - (void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableNonNullIntMap:(nullable NSDictionary *)intMap - completion: - (void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableNonNullEnumMap: - (nullable NSDictionary *)enumMap - completion: - (void (^)( - NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableNonNullClassMap: - (nullable NSDictionary *)classMap - completion: - (void (^)(NSDictionary - *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed - completion: - (void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoAnotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherEnumBoxed - completion:(void (^)(FLTAnotherEnumBox *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterSmallApiEchoString:(NSString *)aString - completion: - (void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; -@end - -extern void SetUpFLTHostIntegrationCoreApi(id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFLTHostIntegrationCoreApiWithSuffix( - id binaryMessenger, NSObject *_Nullable api, - NSString *messageChannelSuffix); - -/// The core interface that the Dart platform_test code implements for host -/// integration tests to call into. -@interface FLTFlutterIntegrationCoreApi : NSObject -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix; -/// A no-op function taking no arguments and returning no value, to sanity -/// test basic calling. -- (void)noopWithCompletion:(void (^)(FlutterError *_Nullable))completion; -/// Responds with an error from an async function returning a value. -- (void)throwErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; -/// Responds with an error from an async void function. -- (void)throwErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; -/// Returns the passed object, to test serialization and deserialization. -- (void)echoAllTypes:(FLTAllTypes *)everything - completion:(void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion; -/// Returns the passed object, to test serialization and deserialization. -- (void)echoAllNullableTypes:(nullable FLTAllNullableTypes *)everything - completion: - (void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion; -/// Returns passed in arguments of multiple types. -/// -/// Tests multiple-arity FlutterApi handling. -- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - completion:(void (^)(FLTAllNullableTypes *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed object, to test serialization and deserialization. -- (void) - echoAllNullableTypesWithoutRecursion:(nullable FLTAllNullableTypesWithoutRecursion *)everything - completion:(void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion; -/// Returns passed in arguments of multiple types. -/// -/// Tests multiple-arity FlutterApi handling. -- (void)sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - completion: - (void (^)( - FLTAllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed boolean, to test serialization and deserialization. -- (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; -/// Returns the passed double, to test serialization and deserialization. -- (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; -/// Returns the passed byte list, to test serialization and deserialization. -- (void)echoUint8List:(FlutterStandardTypedData *)list - completion: - (void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; -/// Returns the passed list, to test serialization and deserialization. -- (void)echoList:(NSArray *)list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -/// Returns the passed list, to test serialization and deserialization. -- (void)echoEnumList:(NSArray *)enumList - completion: - (void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -/// Returns the passed list, to test serialization and deserialization. -- (void)echoClassList:(NSArray *)classList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed list, to test serialization and deserialization. -- (void)echoNonNullEnumList:(NSArray *)enumList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed list, to test serialization and deserialization. -- (void)echoNonNullClassList:(NSArray *)classList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test serialization and deserialization. -- (void)echoMap:(NSDictionary *)map - completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; -/// Returns the passed map, to test serialization and deserialization. -- (void)echoStringMap:(NSDictionary *)stringMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test serialization and deserialization. -- (void)echoIntMap:(NSDictionary *)intMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test serialization and deserialization. -- (void)echoEnumMap:(NSDictionary *)enumMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test serialization and deserialization. -- (void)echoClassMap:(NSDictionary *)classMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test serialization and deserialization. -- (void)echoNonNullStringMap:(NSDictionary *)stringMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test serialization and deserialization. -- (void)echoNonNullIntMap:(NSDictionary *)intMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test serialization and deserialization. -- (void)echoNonNullEnumMap:(NSDictionary *)enumMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test serialization and deserialization. -- (void)echoNonNullClassMap:(NSDictionary *)classMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed enum to test serialization and deserialization. -- (void)echoEnum:(FLTAnEnum)anEnum - completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; -/// Returns the passed enum to test serialization and deserialization. -- (void)echoAnotherEnum:(FLTAnotherEnum)anotherEnum - completion:(void (^)(FLTAnotherEnumBox *_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; -/// Returns the passed int, to test serialization and deserialization. -- (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; -/// Returns the passed string, to test serialization and deserialization. -- (void)echoNullableString:(nullable NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; -/// Returns the passed byte list, to test serialization and deserialization. -- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)list - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed list, to test serialization and deserialization. -- (void)echoNullableList:(nullable NSArray *)list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -/// Returns the passed list, to test serialization and deserialization. -- (void)echoNullableEnumList:(nullable NSArray *)enumList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed list, to test serialization and deserialization. -- (void)echoNullableClassList:(nullable NSArray *)classList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed list, to test serialization and deserialization. -- (void)echoNullableNonNullEnumList:(nullable NSArray *)enumList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed list, to test serialization and deserialization. -- (void)echoNullableNonNullClassList:(nullable NSArray *)classList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test serialization and deserialization. -- (void)echoNullableMap:(nullable NSDictionary *)map - completion: - (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; -/// Returns the passed map, to test serialization and deserialization. -- (void)echoNullableStringMap:(nullable NSDictionary *)stringMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test serialization and deserialization. -- (void)echoNullableIntMap:(nullable NSDictionary *)intMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test serialization and deserialization. -- (void)echoNullableEnumMap:(nullable NSDictionary *)enumMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test serialization and deserialization. -- (void)echoNullableClassMap:(nullable NSDictionary *)classMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test serialization and deserialization. -- (void)echoNullableNonNullStringMap:(nullable NSDictionary *)stringMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test serialization and deserialization. -- (void)echoNullableNonNullIntMap:(nullable NSDictionary *)intMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test serialization and deserialization. -- (void)echoNullableNonNullEnumMap:(nullable NSDictionary *)enumMap - completion: - (void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed map, to test serialization and deserialization. -- (void)echoNullableNonNullClassMap: - (nullable NSDictionary *)classMap - completion: - (void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -/// Returns the passed enum to test serialization and deserialization. -- (void)echoNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed - completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; -/// Returns the passed enum to test serialization and deserialization. -- (void)echoAnotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherEnumBoxed - completion:(void (^)(FLTAnotherEnumBox *_Nullable, - FlutterError *_Nullable))completion; -/// A no-op function taking no arguments and returning no value, to sanity -/// test basic asynchronous calling. -- (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion; -/// Returns the passed in generic Object asynchronously. -- (void)echoAsyncString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; -@end - -/// An API that can be implemented for minimal, compile-only tests. -@protocol FLTHostTrivialApi -- (void)noopWithError:(FlutterError *_Nullable *_Nonnull)error; -@end - -extern void SetUpFLTHostTrivialApi(id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFLTHostTrivialApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); - -/// A simple API implemented in some unit tests. -@protocol FLTHostSmallApi -- (void)echoString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; -- (void)voidVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; -@end - -extern void SetUpFLTHostSmallApi(id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFLTHostSmallApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); - -/// A simple API called in some unit tests. -@interface FLTFlutterSmallApi : NSObject -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix; -- (void)echoWrappedList:(FLTTestMessage *)msg - completion:(void (^)(FLTTestMessage *_Nullable, FlutterError *_Nullable))completion; -- (void)echoString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; -@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 deleted file mode 100644 index 36fb0a516f5..00000000000 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.m +++ /dev/null @@ -1,6443 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// -// Autogenerated from Pigeon, do not edit directly. -// See also: https://pub.dev/packages/pigeon - -#import "CoreTests.gen.h" - -#if TARGET_OS_OSX -#import -#else -#import -#endif - -#if !__has_feature(objc_arc) -#error File requires ARC to be enabled. -#endif - -static NSArray *wrapResult(id result, FlutterError *error) { - if (error) { - return @[ - error.code ?: [NSNull null], error.message ?: [NSNull null], error.details ?: [NSNull null] - ]; - } - return @[ result ?: [NSNull null] ]; -} - -static FlutterError *createConnectionError(NSString *channelName) { - return [FlutterError - errorWithCode:@"channel-error" - message:[NSString stringWithFormat:@"%@/%@/%@", - @"Unable to establish connection on channel: '", - channelName, @"'."] - details:@""]; -} - -static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { - id result = array[key]; - return (result == [NSNull null]) ? nil : result; -} - -@implementation FLTAnEnumBox -- (instancetype)initWithValue:(FLTAnEnum)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -@implementation FLTAnotherEnumBox -- (instancetype)initWithValue:(FLTAnotherEnum)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -@interface FLTUnusedClass () -+ (FLTUnusedClass *)fromList:(NSArray *)list; -+ (nullable FLTUnusedClass *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FLTAllTypes () -+ (FLTAllTypes *)fromList:(NSArray *)list; -+ (nullable FLTAllTypes *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FLTAllNullableTypes () -+ (FLTAllNullableTypes *)fromList:(NSArray *)list; -+ (nullable FLTAllNullableTypes *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FLTAllNullableTypesWithoutRecursion () -+ (FLTAllNullableTypesWithoutRecursion *)fromList:(NSArray *)list; -+ (nullable FLTAllNullableTypesWithoutRecursion *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FLTAllClassesWrapper () -+ (FLTAllClassesWrapper *)fromList:(NSArray *)list; -+ (nullable FLTAllClassesWrapper *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FLTTestMessage () -+ (FLTTestMessage *)fromList:(NSArray *)list; -+ (nullable FLTTestMessage *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@implementation FLTUnusedClass -+ (instancetype)makeWithAField:(nullable id)aField { - FLTUnusedClass *pigeonResult = [[FLTUnusedClass alloc] init]; - pigeonResult.aField = aField; - return pigeonResult; -} -+ (FLTUnusedClass *)fromList:(NSArray *)list { - FLTUnusedClass *pigeonResult = [[FLTUnusedClass alloc] init]; - pigeonResult.aField = GetNullableObjectAtIndex(list, 0); - return pigeonResult; -} -+ (nullable FLTUnusedClass *)nullableFromList:(NSArray *)list { - return (list) ? [FLTUnusedClass fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.aField ?: [NSNull null], - ]; -} -@end - -@implementation FLTAllTypes -+ (instancetype)makeWithABool:(BOOL)aBool - anInt:(NSInteger)anInt - anInt64:(NSInteger)anInt64 - aDouble:(double)aDouble - aByteArray:(FlutterStandardTypedData *)aByteArray - a4ByteArray:(FlutterStandardTypedData *)a4ByteArray - a8ByteArray:(FlutterStandardTypedData *)a8ByteArray - aFloatArray:(FlutterStandardTypedData *)aFloatArray - anEnum:(FLTAnEnum)anEnum - anotherEnum:(FLTAnotherEnum)anotherEnum - aString:(NSString *)aString - anObject:(id)anObject - list:(NSArray *)list - stringList:(NSArray *)stringList - intList:(NSArray *)intList - doubleList:(NSArray *)doubleList - boolList:(NSArray *)boolList - enumList:(NSArray *)enumList - objectList:(NSArray *)objectList - listList:(NSArray *> *)listList - mapList:(NSArray *> *)mapList - map:(NSDictionary *)map - stringMap:(NSDictionary *)stringMap - intMap:(NSDictionary *)intMap - enumMap:(NSDictionary *)enumMap - objectMap:(NSDictionary *)objectMap - listMap:(NSDictionary *> *)listMap - mapMap:(NSDictionary *> *)mapMap { - FLTAllTypes *pigeonResult = [[FLTAllTypes alloc] init]; - pigeonResult.aBool = aBool; - pigeonResult.anInt = anInt; - pigeonResult.anInt64 = anInt64; - pigeonResult.aDouble = aDouble; - pigeonResult.aByteArray = aByteArray; - pigeonResult.a4ByteArray = a4ByteArray; - pigeonResult.a8ByteArray = a8ByteArray; - pigeonResult.aFloatArray = aFloatArray; - pigeonResult.anEnum = anEnum; - pigeonResult.anotherEnum = anotherEnum; - pigeonResult.aString = aString; - pigeonResult.anObject = anObject; - pigeonResult.list = list; - pigeonResult.stringList = stringList; - pigeonResult.intList = intList; - pigeonResult.doubleList = doubleList; - pigeonResult.boolList = boolList; - pigeonResult.enumList = enumList; - pigeonResult.objectList = objectList; - pigeonResult.listList = listList; - pigeonResult.mapList = mapList; - pigeonResult.map = map; - pigeonResult.stringMap = stringMap; - pigeonResult.intMap = intMap; - pigeonResult.enumMap = enumMap; - pigeonResult.objectMap = objectMap; - pigeonResult.listMap = listMap; - pigeonResult.mapMap = mapMap; - return pigeonResult; -} -+ (FLTAllTypes *)fromList:(NSArray *)list { - FLTAllTypes *pigeonResult = [[FLTAllTypes alloc] init]; - pigeonResult.aBool = [GetNullableObjectAtIndex(list, 0) boolValue]; - pigeonResult.anInt = [GetNullableObjectAtIndex(list, 1) integerValue]; - pigeonResult.anInt64 = [GetNullableObjectAtIndex(list, 2) integerValue]; - pigeonResult.aDouble = [GetNullableObjectAtIndex(list, 3) doubleValue]; - pigeonResult.aByteArray = GetNullableObjectAtIndex(list, 4); - pigeonResult.a4ByteArray = GetNullableObjectAtIndex(list, 5); - pigeonResult.a8ByteArray = GetNullableObjectAtIndex(list, 6); - pigeonResult.aFloatArray = GetNullableObjectAtIndex(list, 7); - FLTAnEnumBox *boxedFLTAnEnum = GetNullableObjectAtIndex(list, 8); - pigeonResult.anEnum = boxedFLTAnEnum.value; - FLTAnotherEnumBox *boxedFLTAnotherEnum = GetNullableObjectAtIndex(list, 9); - pigeonResult.anotherEnum = boxedFLTAnotherEnum.value; - pigeonResult.aString = GetNullableObjectAtIndex(list, 10); - pigeonResult.anObject = GetNullableObjectAtIndex(list, 11); - pigeonResult.list = GetNullableObjectAtIndex(list, 12); - pigeonResult.stringList = GetNullableObjectAtIndex(list, 13); - pigeonResult.intList = GetNullableObjectAtIndex(list, 14); - pigeonResult.doubleList = GetNullableObjectAtIndex(list, 15); - pigeonResult.boolList = GetNullableObjectAtIndex(list, 16); - pigeonResult.enumList = GetNullableObjectAtIndex(list, 17); - pigeonResult.objectList = GetNullableObjectAtIndex(list, 18); - pigeonResult.listList = GetNullableObjectAtIndex(list, 19); - pigeonResult.mapList = GetNullableObjectAtIndex(list, 20); - pigeonResult.map = GetNullableObjectAtIndex(list, 21); - pigeonResult.stringMap = GetNullableObjectAtIndex(list, 22); - pigeonResult.intMap = GetNullableObjectAtIndex(list, 23); - pigeonResult.enumMap = GetNullableObjectAtIndex(list, 24); - pigeonResult.objectMap = GetNullableObjectAtIndex(list, 25); - pigeonResult.listMap = GetNullableObjectAtIndex(list, 26); - pigeonResult.mapMap = GetNullableObjectAtIndex(list, 27); - return pigeonResult; -} -+ (nullable FLTAllTypes *)nullableFromList:(NSArray *)list { - return (list) ? [FLTAllTypes fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.aBool), - @(self.anInt), - @(self.anInt64), - @(self.aDouble), - self.aByteArray ?: [NSNull null], - self.a4ByteArray ?: [NSNull null], - self.a8ByteArray ?: [NSNull null], - self.aFloatArray ?: [NSNull null], - [[FLTAnEnumBox alloc] initWithValue:self.anEnum], - [[FLTAnotherEnumBox alloc] initWithValue:self.anotherEnum], - self.aString ?: [NSNull null], - self.anObject ?: [NSNull null], - self.list ?: [NSNull null], - self.stringList ?: [NSNull null], - self.intList ?: [NSNull null], - self.doubleList ?: [NSNull null], - self.boolList ?: [NSNull null], - self.enumList ?: [NSNull null], - self.objectList ?: [NSNull null], - self.listList ?: [NSNull null], - self.mapList ?: [NSNull null], - self.map ?: [NSNull null], - self.stringMap ?: [NSNull null], - self.intMap ?: [NSNull null], - self.enumMap ?: [NSNull null], - self.objectMap ?: [NSNull null], - self.listMap ?: [NSNull null], - self.mapMap ?: [NSNull null], - ]; -} -@end - -@implementation FLTAllNullableTypes -+ (instancetype) - makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum - anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject - allNullableTypes:(nullable FLTAllNullableTypes *)allNullableTypes - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - enumList:(nullable NSArray *)enumList - objectList:(nullable NSArray *)objectList - listList:(nullable NSArray *> *)listList - mapList:(nullable NSArray *> *)mapList - recursiveClassList:(nullable NSArray *)recursiveClassList - map:(nullable NSDictionary *)map - stringMap:(nullable NSDictionary *)stringMap - intMap:(nullable NSDictionary *)intMap - enumMap:(nullable NSDictionary *)enumMap - objectMap:(nullable NSDictionary *)objectMap - listMap:(nullable NSDictionary *> *)listMap - mapMap:(nullable NSDictionary *> *)mapMap - recursiveClassMap: - (nullable NSDictionary *)recursiveClassMap { - FLTAllNullableTypes *pigeonResult = [[FLTAllNullableTypes alloc] init]; - pigeonResult.aNullableBool = aNullableBool; - pigeonResult.aNullableInt = aNullableInt; - pigeonResult.aNullableInt64 = aNullableInt64; - pigeonResult.aNullableDouble = aNullableDouble; - pigeonResult.aNullableByteArray = aNullableByteArray; - pigeonResult.aNullable4ByteArray = aNullable4ByteArray; - pigeonResult.aNullable8ByteArray = aNullable8ByteArray; - pigeonResult.aNullableFloatArray = aNullableFloatArray; - pigeonResult.aNullableEnum = aNullableEnum; - pigeonResult.anotherNullableEnum = anotherNullableEnum; - pigeonResult.aNullableString = aNullableString; - pigeonResult.aNullableObject = aNullableObject; - pigeonResult.allNullableTypes = allNullableTypes; - pigeonResult.list = list; - pigeonResult.stringList = stringList; - pigeonResult.intList = intList; - pigeonResult.doubleList = doubleList; - pigeonResult.boolList = boolList; - pigeonResult.enumList = enumList; - pigeonResult.objectList = objectList; - pigeonResult.listList = listList; - pigeonResult.mapList = mapList; - pigeonResult.recursiveClassList = recursiveClassList; - pigeonResult.map = map; - pigeonResult.stringMap = stringMap; - pigeonResult.intMap = intMap; - pigeonResult.enumMap = enumMap; - pigeonResult.objectMap = objectMap; - pigeonResult.listMap = listMap; - pigeonResult.mapMap = mapMap; - pigeonResult.recursiveClassMap = recursiveClassMap; - return pigeonResult; -} -+ (FLTAllNullableTypes *)fromList:(NSArray *)list { - FLTAllNullableTypes *pigeonResult = [[FLTAllNullableTypes alloc] init]; - pigeonResult.aNullableBool = GetNullableObjectAtIndex(list, 0); - pigeonResult.aNullableInt = GetNullableObjectAtIndex(list, 1); - pigeonResult.aNullableInt64 = GetNullableObjectAtIndex(list, 2); - pigeonResult.aNullableDouble = GetNullableObjectAtIndex(list, 3); - pigeonResult.aNullableByteArray = GetNullableObjectAtIndex(list, 4); - pigeonResult.aNullable4ByteArray = GetNullableObjectAtIndex(list, 5); - pigeonResult.aNullable8ByteArray = GetNullableObjectAtIndex(list, 6); - pigeonResult.aNullableFloatArray = GetNullableObjectAtIndex(list, 7); - pigeonResult.aNullableEnum = GetNullableObjectAtIndex(list, 8); - pigeonResult.anotherNullableEnum = GetNullableObjectAtIndex(list, 9); - pigeonResult.aNullableString = GetNullableObjectAtIndex(list, 10); - pigeonResult.aNullableObject = GetNullableObjectAtIndex(list, 11); - pigeonResult.allNullableTypes = GetNullableObjectAtIndex(list, 12); - pigeonResult.list = GetNullableObjectAtIndex(list, 13); - pigeonResult.stringList = GetNullableObjectAtIndex(list, 14); - pigeonResult.intList = GetNullableObjectAtIndex(list, 15); - pigeonResult.doubleList = GetNullableObjectAtIndex(list, 16); - pigeonResult.boolList = GetNullableObjectAtIndex(list, 17); - pigeonResult.enumList = GetNullableObjectAtIndex(list, 18); - pigeonResult.objectList = GetNullableObjectAtIndex(list, 19); - pigeonResult.listList = GetNullableObjectAtIndex(list, 20); - pigeonResult.mapList = GetNullableObjectAtIndex(list, 21); - pigeonResult.recursiveClassList = GetNullableObjectAtIndex(list, 22); - pigeonResult.map = GetNullableObjectAtIndex(list, 23); - pigeonResult.stringMap = GetNullableObjectAtIndex(list, 24); - pigeonResult.intMap = GetNullableObjectAtIndex(list, 25); - pigeonResult.enumMap = GetNullableObjectAtIndex(list, 26); - pigeonResult.objectMap = GetNullableObjectAtIndex(list, 27); - pigeonResult.listMap = GetNullableObjectAtIndex(list, 28); - pigeonResult.mapMap = GetNullableObjectAtIndex(list, 29); - pigeonResult.recursiveClassMap = GetNullableObjectAtIndex(list, 30); - return pigeonResult; -} -+ (nullable FLTAllNullableTypes *)nullableFromList:(NSArray *)list { - return (list) ? [FLTAllNullableTypes fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.aNullableBool ?: [NSNull null], - self.aNullableInt ?: [NSNull null], - self.aNullableInt64 ?: [NSNull null], - self.aNullableDouble ?: [NSNull null], - self.aNullableByteArray ?: [NSNull null], - self.aNullable4ByteArray ?: [NSNull null], - self.aNullable8ByteArray ?: [NSNull null], - self.aNullableFloatArray ?: [NSNull null], - self.aNullableEnum ?: [NSNull null], - self.anotherNullableEnum ?: [NSNull null], - self.aNullableString ?: [NSNull null], - self.aNullableObject ?: [NSNull null], - self.allNullableTypes ?: [NSNull null], - self.list ?: [NSNull null], - self.stringList ?: [NSNull null], - self.intList ?: [NSNull null], - self.doubleList ?: [NSNull null], - self.boolList ?: [NSNull null], - self.enumList ?: [NSNull null], - self.objectList ?: [NSNull null], - self.listList ?: [NSNull null], - self.mapList ?: [NSNull null], - self.recursiveClassList ?: [NSNull null], - self.map ?: [NSNull null], - self.stringMap ?: [NSNull null], - self.intMap ?: [NSNull null], - self.enumMap ?: [NSNull null], - self.objectMap ?: [NSNull null], - self.listMap ?: [NSNull null], - self.mapMap ?: [NSNull null], - self.recursiveClassMap ?: [NSNull null], - ]; -} -@end - -@implementation FLTAllNullableTypesWithoutRecursion -+ (instancetype) - makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum - anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - enumList:(nullable NSArray *)enumList - objectList:(nullable NSArray *)objectList - listList:(nullable NSArray *> *)listList - mapList:(nullable NSArray *> *)mapList - map:(nullable NSDictionary *)map - stringMap:(nullable NSDictionary *)stringMap - intMap:(nullable NSDictionary *)intMap - enumMap:(nullable NSDictionary *)enumMap - objectMap:(nullable NSDictionary *)objectMap - listMap:(nullable NSDictionary *> *)listMap - mapMap:(nullable NSDictionary *> *)mapMap { - FLTAllNullableTypesWithoutRecursion *pigeonResult = - [[FLTAllNullableTypesWithoutRecursion alloc] init]; - pigeonResult.aNullableBool = aNullableBool; - pigeonResult.aNullableInt = aNullableInt; - pigeonResult.aNullableInt64 = aNullableInt64; - pigeonResult.aNullableDouble = aNullableDouble; - pigeonResult.aNullableByteArray = aNullableByteArray; - pigeonResult.aNullable4ByteArray = aNullable4ByteArray; - pigeonResult.aNullable8ByteArray = aNullable8ByteArray; - pigeonResult.aNullableFloatArray = aNullableFloatArray; - pigeonResult.aNullableEnum = aNullableEnum; - pigeonResult.anotherNullableEnum = anotherNullableEnum; - pigeonResult.aNullableString = aNullableString; - pigeonResult.aNullableObject = aNullableObject; - pigeonResult.list = list; - pigeonResult.stringList = stringList; - pigeonResult.intList = intList; - pigeonResult.doubleList = doubleList; - pigeonResult.boolList = boolList; - pigeonResult.enumList = enumList; - pigeonResult.objectList = objectList; - pigeonResult.listList = listList; - pigeonResult.mapList = mapList; - pigeonResult.map = map; - pigeonResult.stringMap = stringMap; - pigeonResult.intMap = intMap; - pigeonResult.enumMap = enumMap; - pigeonResult.objectMap = objectMap; - pigeonResult.listMap = listMap; - pigeonResult.mapMap = mapMap; - return pigeonResult; -} -+ (FLTAllNullableTypesWithoutRecursion *)fromList:(NSArray *)list { - FLTAllNullableTypesWithoutRecursion *pigeonResult = - [[FLTAllNullableTypesWithoutRecursion alloc] init]; - pigeonResult.aNullableBool = GetNullableObjectAtIndex(list, 0); - pigeonResult.aNullableInt = GetNullableObjectAtIndex(list, 1); - pigeonResult.aNullableInt64 = GetNullableObjectAtIndex(list, 2); - pigeonResult.aNullableDouble = GetNullableObjectAtIndex(list, 3); - pigeonResult.aNullableByteArray = GetNullableObjectAtIndex(list, 4); - pigeonResult.aNullable4ByteArray = GetNullableObjectAtIndex(list, 5); - pigeonResult.aNullable8ByteArray = GetNullableObjectAtIndex(list, 6); - pigeonResult.aNullableFloatArray = GetNullableObjectAtIndex(list, 7); - pigeonResult.aNullableEnum = GetNullableObjectAtIndex(list, 8); - pigeonResult.anotherNullableEnum = GetNullableObjectAtIndex(list, 9); - pigeonResult.aNullableString = GetNullableObjectAtIndex(list, 10); - pigeonResult.aNullableObject = GetNullableObjectAtIndex(list, 11); - pigeonResult.list = GetNullableObjectAtIndex(list, 12); - pigeonResult.stringList = GetNullableObjectAtIndex(list, 13); - pigeonResult.intList = GetNullableObjectAtIndex(list, 14); - pigeonResult.doubleList = GetNullableObjectAtIndex(list, 15); - pigeonResult.boolList = GetNullableObjectAtIndex(list, 16); - pigeonResult.enumList = GetNullableObjectAtIndex(list, 17); - pigeonResult.objectList = GetNullableObjectAtIndex(list, 18); - pigeonResult.listList = GetNullableObjectAtIndex(list, 19); - pigeonResult.mapList = GetNullableObjectAtIndex(list, 20); - pigeonResult.map = GetNullableObjectAtIndex(list, 21); - pigeonResult.stringMap = GetNullableObjectAtIndex(list, 22); - pigeonResult.intMap = GetNullableObjectAtIndex(list, 23); - pigeonResult.enumMap = GetNullableObjectAtIndex(list, 24); - pigeonResult.objectMap = GetNullableObjectAtIndex(list, 25); - pigeonResult.listMap = GetNullableObjectAtIndex(list, 26); - pigeonResult.mapMap = GetNullableObjectAtIndex(list, 27); - return pigeonResult; -} -+ (nullable FLTAllNullableTypesWithoutRecursion *)nullableFromList:(NSArray *)list { - return (list) ? [FLTAllNullableTypesWithoutRecursion fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.aNullableBool ?: [NSNull null], - self.aNullableInt ?: [NSNull null], - self.aNullableInt64 ?: [NSNull null], - self.aNullableDouble ?: [NSNull null], - self.aNullableByteArray ?: [NSNull null], - self.aNullable4ByteArray ?: [NSNull null], - self.aNullable8ByteArray ?: [NSNull null], - self.aNullableFloatArray ?: [NSNull null], - self.aNullableEnum ?: [NSNull null], - self.anotherNullableEnum ?: [NSNull null], - self.aNullableString ?: [NSNull null], - self.aNullableObject ?: [NSNull null], - self.list ?: [NSNull null], - self.stringList ?: [NSNull null], - self.intList ?: [NSNull null], - self.doubleList ?: [NSNull null], - self.boolList ?: [NSNull null], - self.enumList ?: [NSNull null], - self.objectList ?: [NSNull null], - self.listList ?: [NSNull null], - self.mapList ?: [NSNull null], - self.map ?: [NSNull null], - self.stringMap ?: [NSNull null], - self.intMap ?: [NSNull null], - self.enumMap ?: [NSNull null], - self.objectMap ?: [NSNull null], - self.listMap ?: [NSNull null], - self.mapMap ?: [NSNull null], - ]; -} -@end - -@implementation FLTAllClassesWrapper -+ (instancetype) - makeWithAllNullableTypes:(FLTAllNullableTypes *)allNullableTypes - allNullableTypesWithoutRecursion: - (nullable FLTAllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion - allTypes:(nullable FLTAllTypes *)allTypes - classList:(NSArray *)classList - nullableClassList: - (nullable NSArray *)nullableClassList - classMap:(NSDictionary *)classMap - nullableClassMap: - (nullable NSDictionary *) - nullableClassMap { - FLTAllClassesWrapper *pigeonResult = [[FLTAllClassesWrapper alloc] init]; - pigeonResult.allNullableTypes = allNullableTypes; - pigeonResult.allNullableTypesWithoutRecursion = allNullableTypesWithoutRecursion; - pigeonResult.allTypes = allTypes; - pigeonResult.classList = classList; - pigeonResult.nullableClassList = nullableClassList; - pigeonResult.classMap = classMap; - pigeonResult.nullableClassMap = nullableClassMap; - return pigeonResult; -} -+ (FLTAllClassesWrapper *)fromList:(NSArray *)list { - FLTAllClassesWrapper *pigeonResult = [[FLTAllClassesWrapper alloc] init]; - pigeonResult.allNullableTypes = GetNullableObjectAtIndex(list, 0); - pigeonResult.allNullableTypesWithoutRecursion = GetNullableObjectAtIndex(list, 1); - pigeonResult.allTypes = GetNullableObjectAtIndex(list, 2); - pigeonResult.classList = GetNullableObjectAtIndex(list, 3); - pigeonResult.nullableClassList = GetNullableObjectAtIndex(list, 4); - pigeonResult.classMap = GetNullableObjectAtIndex(list, 5); - pigeonResult.nullableClassMap = GetNullableObjectAtIndex(list, 6); - return pigeonResult; -} -+ (nullable FLTAllClassesWrapper *)nullableFromList:(NSArray *)list { - return (list) ? [FLTAllClassesWrapper fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.allNullableTypes ?: [NSNull null], - self.allNullableTypesWithoutRecursion ?: [NSNull null], - self.allTypes ?: [NSNull null], - self.classList ?: [NSNull null], - self.nullableClassList ?: [NSNull null], - self.classMap ?: [NSNull null], - self.nullableClassMap ?: [NSNull null], - ]; -} -@end - -@implementation FLTTestMessage -+ (instancetype)makeWithTestList:(nullable NSArray *)testList { - FLTTestMessage *pigeonResult = [[FLTTestMessage alloc] init]; - pigeonResult.testList = testList; - return pigeonResult; -} -+ (FLTTestMessage *)fromList:(NSArray *)list { - FLTTestMessage *pigeonResult = [[FLTTestMessage alloc] init]; - pigeonResult.testList = GetNullableObjectAtIndex(list, 0); - return pigeonResult; -} -+ (nullable FLTTestMessage *)nullableFromList:(NSArray *)list { - return (list) ? [FLTTestMessage fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.testList ?: [NSNull null], - ]; -} -@end - -@interface FLTCoreTestsPigeonCodecReader : FlutterStandardReader -@end -@implementation FLTCoreTestsPigeonCodecReader -- (nullable id)readValueOfType:(UInt8)type { - switch (type) { - case 129: { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil ? nil - : [[FLTAnEnumBox alloc] initWithValue:[enumAsNumber integerValue]]; - } - case 130: { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil - ? nil - : [[FLTAnotherEnumBox alloc] initWithValue:[enumAsNumber integerValue]]; - } - case 131: - return [FLTUnusedClass fromList:[self readValue]]; - case 132: - return [FLTAllTypes fromList:[self readValue]]; - case 133: - return [FLTAllNullableTypes fromList:[self readValue]]; - case 134: - return [FLTAllNullableTypesWithoutRecursion fromList:[self readValue]]; - case 135: - return [FLTAllClassesWrapper fromList:[self readValue]]; - case 136: - return [FLTTestMessage fromList:[self readValue]]; - default: - return [super readValueOfType:type]; - } -} -@end - -@interface FLTCoreTestsPigeonCodecWriter : FlutterStandardWriter -@end -@implementation FLTCoreTestsPigeonCodecWriter -- (void)writeValue:(id)value { - if ([value isKindOfClass:[FLTAnEnumBox class]]) { - FLTAnEnumBox *box = (FLTAnEnumBox *)value; - [self writeByte:129]; - [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; - } else if ([value isKindOfClass:[FLTAnotherEnumBox class]]) { - FLTAnotherEnumBox *box = (FLTAnotherEnumBox *)value; - [self writeByte:130]; - [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; - } else if ([value isKindOfClass:[FLTUnusedClass class]]) { - [self writeByte:131]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FLTAllTypes class]]) { - [self writeByte:132]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FLTAllNullableTypes class]]) { - [self writeByte:133]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FLTAllNullableTypesWithoutRecursion class]]) { - [self writeByte:134]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FLTAllClassesWrapper class]]) { - [self writeByte:135]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FLTTestMessage class]]) { - [self writeByte:136]; - [self writeValue:[value toList]]; - } else { - [super writeValue:value]; - } -} -@end - -@interface FLTCoreTestsPigeonCodecReaderWriter : FlutterStandardReaderWriter -@end -@implementation FLTCoreTestsPigeonCodecReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FLTCoreTestsPigeonCodecWriter alloc] initWithData:data]; -} -- (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FLTCoreTestsPigeonCodecReader alloc] initWithData:data]; -} -@end - -NSObject *FLTGetCoreTestsCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - static dispatch_once_t sPred = 0; - dispatch_once(&sPred, ^{ - FLTCoreTestsPigeonCodecReaderWriter *readerWriter = - [[FLTCoreTestsPigeonCodecReaderWriter alloc] init]; - sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; - }); - return sSharedObject; -} -void SetUpFLTHostIntegrationCoreApi(id binaryMessenger, - NSObject *api) { - SetUpFLTHostIntegrationCoreApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; -#if TARGET_OS_IOS - NSObject *taskQueue = [binaryMessenger makeBackgroundTaskQueue]; -#else - NSObject *taskQueue = nil; -#endif - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic calling. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.noop", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(noopWithError:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(noopWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - [api noopWithError:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed object, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAllTypes", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoAllTypes:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAllTypes:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FLTAllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - FLTAllTypes *output = [api echoAllTypes:arg_everything error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns an error, to test error handling. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.throwError", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(throwErrorWithError:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(throwErrorWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - id output = [api throwErrorWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns an error from a void function, to test error handling. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.throwErrorFromVoid", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(throwErrorFromVoidWithError:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwErrorFromVoidWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - [api throwErrorFromVoidWithError:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns a Flutter error, to test error handling. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.throwFlutterError", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(throwFlutterErrorWithError:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwFlutterErrorWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - id output = [api throwFlutterErrorWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns passed in int. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoInt", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoInt:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoInt:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; - FlutterError *error; - NSNumber *output = [api echoInt:arg_anInt error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns passed in double. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoDouble", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoDouble:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoDouble:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; - FlutterError *error; - NSNumber *output = [api echoDouble:arg_aDouble error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed in boolean. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoBool", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoBool:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoBool:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; - FlutterError *error; - NSNumber *output = [api echoBool:arg_aBool error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed in string. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoString", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoString:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoString:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSString *output = [api echoString:arg_aString error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed in Uint8List. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoUint8List", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoUint8List:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoUint8List:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - FlutterStandardTypedData *output = [api echoUint8List:arg_aUint8List error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed in generic Object. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoObject", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoObject:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoObject:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - id arg_anObject = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - id output = [api echoObject:arg_anObject error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed list, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoList:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoList:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSArray *output = [api echoList:arg_list error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed list, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoEnumList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoEnumList:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoEnumList:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSArray *output = [api echoEnumList:arg_enumList error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed list, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoClassList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoClassList:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoClassList:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSArray *output = [api echoClassList:arg_classList error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed list, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNonNullEnumList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNonNullEnumList:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNonNullEnumList:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSArray *output = [api echoNonNullEnumList:arg_enumList error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed list, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNonNullClassList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNonNullClassList:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNonNullClassList:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSArray *output = [api echoNonNullClassList:arg_classList - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoMap:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoMap:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSDictionary *output = [api echoMap:arg_map error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoStringMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoStringMap:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoStringMap:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSDictionary *output = [api echoStringMap:arg_stringMap - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoIntMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoIntMap:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoIntMap:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSDictionary *output = [api echoIntMap:arg_intMap error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoEnumMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoEnumMap:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoEnumMap:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_enumMap = - GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSDictionary *output = [api echoEnumMap:arg_enumMap - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoClassMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoClassMap:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoClassMap:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_classMap = - GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSDictionary *output = [api echoClassMap:arg_classMap - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNonNullStringMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNonNullStringMap:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNonNullStringMap:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSDictionary *output = [api echoNonNullStringMap:arg_stringMap - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNonNullIntMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNonNullIntMap:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNonNullIntMap:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSDictionary *output = [api echoNonNullIntMap:arg_intMap - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNonNullEnumMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNonNullEnumMap:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNonNullEnumMap:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_enumMap = - GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSDictionary *output = [api echoNonNullEnumMap:arg_enumMap - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNonNullClassMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNonNullClassMap:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNonNullClassMap:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_classMap = - GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSDictionary *output = - [api echoNonNullClassMap:arg_classMap error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed class to test nested class serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoClassWrapper", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoClassWrapper:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoClassWrapper:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FLTAllClassesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - FLTAllClassesWrapper *output = [api echoClassWrapper:arg_wrapper error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed enum to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoEnum", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoEnum:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoEnum:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FLTAnEnumBox *boxedFLTAnEnum = GetNullableObjectAtIndex(args, 0); - FLTAnEnum arg_anEnum = boxedFLTAnEnum.value; - FlutterError *error; - FLTAnEnumBox *output = [api echoEnum:arg_anEnum error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed enum to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAnotherEnum", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAnotherEnum:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAnotherEnum:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FLTAnotherEnumBox *boxedFLTAnotherEnum = GetNullableObjectAtIndex(args, 0); - FLTAnotherEnum arg_anotherEnum = boxedFLTAnotherEnum.value; - FlutterError *error; - FLTAnotherEnumBox *output = [api echoAnotherEnum:arg_anotherEnum error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the default string. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNamedDefaultString", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNamedDefaultString:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNamedDefaultString:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSString *output = [api echoNamedDefaultString:arg_aString error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns passed in double. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoOptionalDefaultDouble", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoOptionalDefaultDouble:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoOptionalDefaultDouble:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; - FlutterError *error; - NSNumber *output = [api echoOptionalDefaultDouble:arg_aDouble error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns passed in int. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoRequiredInt", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoRequiredInt:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoRequiredInt:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; - FlutterError *error; - NSNumber *output = [api echoRequiredInt:arg_anInt error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed object, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAllNullableTypes", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAllNullableTypes:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAllNullableTypes:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FLTAllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - FLTAllNullableTypes *output = [api echoAllNullableTypes:arg_everything error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed object, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAllNullableTypesWithoutRecursion:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAllNullableTypesWithoutRecursion:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FLTAllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - FLTAllNullableTypesWithoutRecursion *output = - [api echoAllNullableTypesWithoutRecursion:arg_everything error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the inner `aString` value from the wrapped object, to test - /// sending of nested objects. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.extractNestedNullableString", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(extractNestedNullableStringFrom:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(extractNestedNullableStringFrom:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FLTAllClassesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSString *output = [api extractNestedNullableStringFrom:arg_wrapper error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the inner `aString` value from the wrapped object, to test - /// sending of nested objects. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.createNestedNullableString", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(createNestedObjectWithNullableString:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(createNestedObjectWithNullableString:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_nullableString = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - FLTAllClassesWrapper *output = [api createNestedObjectWithNullableString:arg_nullableString - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns passed in arguments of multiple types. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.sendMultipleNullableTypes", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(sendMultipleNullableTypesABool: - anInt:aString:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(sendMultipleNullableTypesABool:anInt:aString:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); - NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); - NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - FLTAllNullableTypes *output = [api sendMultipleNullableTypesABool:arg_aNullableBool - anInt:arg_aNullableInt - aString:arg_aNullableString - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns passed in arguments of multiple types. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector - (sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); - NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); - NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - FLTAllNullableTypesWithoutRecursion *output = - [api sendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool - anInt:arg_aNullableInt - aString:arg_aNullableString - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns passed in int. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableInt", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableInt:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableInt:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSNumber *output = [api echoNullableInt:arg_aNullableInt error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns passed in double. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableDouble", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableDouble:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableDouble:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSNumber *arg_aNullableDouble = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSNumber *output = [api echoNullableDouble:arg_aNullableDouble error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed in boolean. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableBool", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableBool:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableBool:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSNumber *output = [api echoNullableBool:arg_aNullableBool error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed in string. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableString", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableString:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableString:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSString *output = [api echoNullableString:arg_aNullableString error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed in Uint8List. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableUint8List", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableUint8List:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableUint8List:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FlutterStandardTypedData *arg_aNullableUint8List = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - FlutterStandardTypedData *output = [api echoNullableUint8List:arg_aNullableUint8List - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed in generic Object. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableObject", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableObject:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableObject:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - id arg_aNullableObject = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - id output = [api echoNullableObject:arg_aNullableObject error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed list, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableList:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableList:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_aNullableList = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSArray *output = [api echoNullableList:arg_aNullableList error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed list, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableEnumList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableEnumList:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableEnumList:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSArray *output = [api echoNullableEnumList:arg_enumList error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed list, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableClassList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableClassList:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableClassList:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSArray *output = [api echoNullableClassList:arg_classList - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed list, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableNonNullEnumList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableNonNullEnumList:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableNonNullEnumList:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSArray *output = [api echoNullableNonNullEnumList:arg_enumList - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed list, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableNonNullClassList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableNonNullClassList:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableNonNullClassList:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSArray *output = [api echoNullableNonNullClassList:arg_classList - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableMap:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableMap:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSDictionary *output = [api echoNullableMap:arg_map error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableStringMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableStringMap:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableStringMap:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSDictionary *output = [api echoNullableStringMap:arg_stringMap - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableIntMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableIntMap:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableIntMap:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSDictionary *output = [api echoNullableIntMap:arg_intMap - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableEnumMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableEnumMap:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableEnumMap:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_enumMap = - GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSDictionary *output = [api echoNullableEnumMap:arg_enumMap - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableClassMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableClassMap:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableClassMap:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_classMap = - GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSDictionary *output = - [api echoNullableClassMap:arg_classMap error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableNonNullStringMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableNonNullStringMap:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableNonNullStringMap:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSDictionary *output = - [api echoNullableNonNullStringMap:arg_stringMap error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableNonNullIntMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableNonNullIntMap:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableNonNullIntMap:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSDictionary *output = [api echoNullableNonNullIntMap:arg_intMap - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableNonNullEnumMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableNonNullEnumMap:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableNonNullEnumMap:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_enumMap = - GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSDictionary *output = - [api echoNullableNonNullEnumMap:arg_enumMap error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableNonNullClassMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableNonNullClassMap:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableNonNullClassMap:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_classMap = - GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSDictionary *output = - [api echoNullableNonNullClassMap:arg_classMap error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableEnum", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableEnum:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableEnum:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FLTAnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - FLTAnEnumBox *output = [api echoNullableEnum:arg_anEnum error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAnotherNullableEnum", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAnotherNullableEnum:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAnotherNullableEnum:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FLTAnotherEnumBox *arg_anotherEnum = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - FLTAnotherEnumBox *output = [api echoAnotherNullableEnum:arg_anotherEnum error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns passed in int. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoOptionalNullableInt", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoOptionalNullableInt:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoOptionalNullableInt:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSNumber *output = [api echoOptionalNullableInt:arg_aNullableInt error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed in string. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNamedNullableString", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoNamedNullableString:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNamedNullableString:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSString *output = [api echoNamedNullableString:arg_aNullableString error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic asynchronous calling. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.noopAsync", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(noopAsyncWithCompletion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(noopAsyncWithCompletion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api noopAsyncWithCompletion:^(FlutterError *_Nullable error) { - callback(wrapResult(nil, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns passed in int asynchronously. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncInt", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncInt:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncInt:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; - [api echoAsyncInt:arg_anInt - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns passed in double asynchronously. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncDouble", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncDouble:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncDouble:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; - [api echoAsyncDouble:arg_aDouble - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed in boolean asynchronously. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncBool", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncBool:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncBool:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; - [api echoAsyncBool:arg_aBool - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed string asynchronously. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncString", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncString:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncString:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api echoAsyncString:arg_aString - completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed in Uint8List asynchronously. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncUint8List", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncUint8List:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncUint8List:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); - [api echoAsyncUint8List:arg_aUint8List - completion:^(FlutterStandardTypedData *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed in generic Object asynchronously. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncObject", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncObject:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncObject:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - id arg_anObject = GetNullableObjectAtIndex(args, 0); - [api echoAsyncObject:arg_anObject - completion:^(id _Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed list, to test asynchronous serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncList:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncList:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api echoAsyncList:arg_list - completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed list, to test asynchronous serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncEnumList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncEnumList:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncEnumList:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); - [api echoAsyncEnumList:arg_enumList - completion:^(NSArray *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed list, to test asynchronous serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncClassList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncClassList:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncClassList:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); - [api echoAsyncClassList:arg_classList - completion:^(NSArray *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test asynchronous serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); - [api echoAsyncMap:arg_map - completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test asynchronous serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncStringMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncStringMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncStringMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); - [api echoAsyncStringMap:arg_stringMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test asynchronous serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncIntMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncIntMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncIntMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); - [api echoAsyncIntMap:arg_intMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test asynchronous serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncEnumMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncEnumMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncEnumMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_enumMap = - GetNullableObjectAtIndex(args, 0); - [api echoAsyncEnumMap:arg_enumMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test asynchronous serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncClassMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncClassMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncClassMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_classMap = - GetNullableObjectAtIndex(args, 0); - [api echoAsyncClassMap:arg_classMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed enum, to test asynchronous serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncEnum", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncEnum:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncEnum:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FLTAnEnumBox *boxedFLTAnEnum = GetNullableObjectAtIndex(args, 0); - FLTAnEnum arg_anEnum = boxedFLTAnEnum.value; - [api echoAsyncEnum:arg_anEnum - completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed enum, to test asynchronous serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAnotherAsyncEnum", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAnotherAsyncEnum:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAnotherAsyncEnum:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FLTAnotherEnumBox *boxedFLTAnotherEnum = GetNullableObjectAtIndex(args, 0); - FLTAnotherEnum arg_anotherEnum = boxedFLTAnotherEnum.value; - [api echoAnotherAsyncEnum:arg_anotherEnum - completion:^(FLTAnotherEnumBox *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Responds with an error from an async function returning a value. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.throwAsyncError", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(throwAsyncErrorWithCompletion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwAsyncErrorWithCompletion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api throwAsyncErrorWithCompletion:^(id _Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Responds with an error from an async void function. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.throwAsyncErrorFromVoid", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(throwAsyncErrorFromVoidWithCompletion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwAsyncErrorFromVoidWithCompletion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api throwAsyncErrorFromVoidWithCompletion:^(FlutterError *_Nullable error) { - callback(wrapResult(nil, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Responds with a Flutter error from an async function returning a value. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.throwAsyncFlutterError", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(throwAsyncFlutterErrorWithCompletion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwAsyncFlutterErrorWithCompletion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api throwAsyncFlutterErrorWithCompletion:^(id _Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed object, to test async serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncAllTypes", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncAllTypes:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncAllTypes:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FLTAllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api echoAsyncAllTypes:arg_everything - completion:^(FLTAllTypes *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed object, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableAllNullableTypes:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableAllNullableTypes:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FLTAllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableAllNullableTypes:arg_everything - completion:^(FLTAllNullableTypes *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed object, to test serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi." - @"echoAsyncNullableAllNullableTypesWithoutRecursion", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector - (echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FLTAllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableAllNullableTypesWithoutRecursion:arg_everything - completion:^(FLTAllNullableTypesWithoutRecursion - *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns passed in int asynchronously. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableInt", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableInt:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableInt:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableInt:arg_anInt - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns passed in double asynchronously. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableDouble", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableDouble:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableDouble:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableDouble:arg_aDouble - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed in boolean asynchronously. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableBool", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableBool:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableBool:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableBool:arg_aBool - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed string asynchronously. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableString", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableString:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableString:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableString:arg_aString - completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed in Uint8List asynchronously. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableUint8List", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableUint8List:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableUint8List:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableUint8List:arg_aUint8List - completion:^(FlutterStandardTypedData *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed in generic Object asynchronously. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableObject", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableObject:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableObject:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - id arg_anObject = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableObject:arg_anObject - completion:^(id _Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed list, to test asynchronous serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableList:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableList:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableList:arg_list - completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed list, to test asynchronous serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableEnumList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableEnumList:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableEnumList:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableEnumList:arg_enumList - completion:^(NSArray *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed list, to test asynchronous serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableClassList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableClassList:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableClassList:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableClassList:arg_classList - completion:^(NSArray *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test asynchronous serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableMap:arg_map - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test asynchronous serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableStringMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableStringMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableStringMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableStringMap:arg_stringMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test asynchronous serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableIntMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableIntMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableIntMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableIntMap:arg_intMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test asynchronous serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableEnumMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableEnumMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableEnumMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_enumMap = - GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableEnumMap:arg_enumMap - completion:^( - NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed map, to test asynchronous serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableClassMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableClassMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableClassMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_classMap = - GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableClassMap:arg_classMap - completion:^( - NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed enum, to test asynchronous serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableEnum", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableEnum:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableEnum:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FLTAnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); - [api - echoAsyncNullableEnum:arg_anEnum - completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the passed enum, to test asynchronous serialization and deserialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAnotherAsyncNullableEnum", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoAnotherAsyncNullableEnum:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAnotherAsyncNullableEnum:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FLTAnotherEnumBox *arg_anotherEnum = GetNullableObjectAtIndex(args, 0); - [api echoAnotherAsyncNullableEnum:arg_anotherEnum - completion:^(FLTAnotherEnumBox *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns true if the handler is run on a main thread, which should be - /// true since there is no TaskQueue annotation. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.defaultIsMainThread", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(defaultIsMainThreadWithError:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(defaultIsMainThreadWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api defaultIsMainThreadWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns true if the handler is run on a non-main thread, which should be - /// true for any platform with TaskQueue support. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.taskQueueIsBackgroundThread", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec() -#ifdef TARGET_OS_IOS - taskQueue:taskQueue -#endif - ]; - - if (api) { - NSCAssert([api respondsToSelector:@selector(taskQueueIsBackgroundThreadWithError:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(taskQueueIsBackgroundThreadWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api taskQueueIsBackgroundThreadWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterNoop", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterNoopWithCompletion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterNoopWithCompletion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api callFlutterNoopWithCompletion:^(FlutterError *_Nullable error) { - callback(wrapResult(nil, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterThrowError", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorWithCompletion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterThrowErrorWithCompletion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api callFlutterThrowErrorWithCompletion:^(id _Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterThrowErrorFromVoid", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorFromVoidWithCompletion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterThrowErrorFromVoidWithCompletion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api callFlutterThrowErrorFromVoidWithCompletion:^(FlutterError *_Nullable error) { - callback(wrapResult(nil, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoAllTypes", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllTypes:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoAllTypes:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FLTAllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAllTypes:arg_everything - completion:^(FLTAllTypes *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoAllNullableTypes", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllNullableTypes:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoAllNullableTypes:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FLTAllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAllNullableTypes:arg_everything - completion:^(FLTAllNullableTypes *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector - (callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); - NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); - NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); - [api callFlutterSendMultipleNullableTypesABool:arg_aNullableBool - anInt:arg_aNullableInt - aString:arg_aNullableString - completion:^(FLTAllNullableTypes *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi." - @"callFlutterEchoAllNullableTypesWithoutRecursion", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector - (callFlutterEchoAllNullableTypesWithoutRecursion:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoAllNullableTypesWithoutRecursion:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FLTAllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAllNullableTypesWithoutRecursion:arg_everything - completion:^(FLTAllNullableTypesWithoutRecursion - *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterSendMultipleNullableTypesWithoutRecursion", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector - (callFlutterSendMultipleNullableTypesWithoutRecursionABool: - anInt:aString:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterSendMultipleNullableTypesWithoutRecursionABool:anInt:aString:" - @"completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); - NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); - NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); - [api callFlutterSendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool - anInt:arg_aNullableInt - aString:arg_aNullableString - completion:^( - FLTAllNullableTypesWithoutRecursion - *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoBool", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoBool:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoBool:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; - [api callFlutterEchoBool:arg_aBool - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoInt", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoInt:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoInt:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; - [api callFlutterEchoInt:arg_anInt - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoDouble", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoDouble:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoDouble:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; - [api callFlutterEchoDouble:arg_aDouble - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoString", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoString:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoString:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoString:arg_aString - completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoUint8List", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoUint8List:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoUint8List:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FlutterStandardTypedData *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoUint8List:arg_list - completion:^(FlutterStandardTypedData *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoList:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoList:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoList:arg_list - completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoEnumList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoEnumList:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoEnumList:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoEnumList:arg_enumList - completion:^(NSArray *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoClassList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoClassList:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoClassList:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoClassList:arg_classList - completion:^(NSArray *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNonNullEnumList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNonNullEnumList:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNonNullEnumList:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNonNullEnumList:arg_enumList - completion:^(NSArray *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNonNullClassList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNonNullClassList:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNonNullClassList:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNonNullClassList:arg_classList - completion:^(NSArray *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoMap:arg_map - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoStringMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoStringMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoStringMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoStringMap:arg_stringMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoIntMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoIntMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoIntMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoIntMap:arg_intMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoEnumMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoEnumMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoEnumMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_enumMap = - GetNullableObjectAtIndex(args, 0); - [api - callFlutterEchoEnumMap:arg_enumMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoClassMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoClassMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoClassMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_classMap = - GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoClassMap:arg_classMap - completion:^( - NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNonNullStringMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNonNullStringMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNonNullStringMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNonNullStringMap:arg_stringMap - completion:^( - NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNonNullIntMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNonNullIntMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNonNullIntMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNonNullIntMap:arg_intMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNonNullEnumMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNonNullEnumMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNonNullEnumMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_enumMap = - GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNonNullEnumMap:arg_enumMap - completion:^( - NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNonNullClassMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNonNullClassMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNonNullClassMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_classMap = - GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNonNullClassMap:arg_classMap - completion:^(NSDictionary - *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoEnum", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoEnum:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoEnum:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FLTAnEnumBox *boxedFLTAnEnum = GetNullableObjectAtIndex(args, 0); - FLTAnEnum arg_anEnum = boxedFLTAnEnum.value; - [api callFlutterEchoEnum:arg_anEnum - completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoAnotherEnum", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoAnotherEnum:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoAnotherEnum:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FLTAnotherEnumBox *boxedFLTAnotherEnum = GetNullableObjectAtIndex(args, 0); - FLTAnotherEnum arg_anotherEnum = boxedFLTAnotherEnum.value; - [api callFlutterEchoAnotherEnum:arg_anotherEnum - completion:^(FLTAnotherEnumBox *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableBool", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableBool:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableBool:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableBool:arg_aBool - completion:^(NSNumber *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableInt", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableInt:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableInt:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableInt:arg_anInt - completion:^(NSNumber *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableDouble", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableDouble:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableDouble:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableDouble:arg_aDouble - completion:^(NSNumber *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableString", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableString:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableString:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableString:arg_aString - completion:^(NSString *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableUint8List", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableUint8List:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableUint8List:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FlutterStandardTypedData *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableUint8List:arg_list - completion:^(FlutterStandardTypedData *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableList:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableList:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableList:arg_list - completion:^(NSArray *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableEnumList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableEnumList:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableEnumList:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableEnumList:arg_enumList - completion:^(NSArray *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableClassList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableClassList:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableClassList:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableClassList:arg_classList - completion:^(NSArray *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableNonNullEnumList: - completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableNonNullEnumList:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableNonNullEnumList:arg_enumList - completion:^(NSArray *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassList", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableNonNullClassList: - completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableNonNullClassList:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableNonNullClassList:arg_classList - completion:^( - NSArray *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableMap:arg_map - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableStringMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableStringMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableStringMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableStringMap:arg_stringMap - completion:^( - NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableIntMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableIntMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableIntMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableIntMap:arg_intMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableEnumMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableEnumMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableEnumMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_enumMap = - GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableEnumMap:arg_enumMap - completion:^( - NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableClassMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableClassMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableClassMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_classMap = - GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableClassMap:arg_classMap - completion:^(NSDictionary - *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableNonNullStringMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableNonNullStringMap: - completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableNonNullStringMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); - [api - callFlutterEchoNullableNonNullStringMap:arg_stringMap - completion:^( - NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableNonNullIntMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableNonNullIntMap: - completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableNonNullIntMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableNonNullIntMap:arg_intMap - completion:^( - NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableNonNullEnumMap: - completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableNonNullEnumMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_enumMap = - GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableNonNullEnumMap:arg_enumMap - completion:^(NSDictionary - *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableNonNullClassMap: - completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableNonNullClassMap:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_classMap = - GetNullableObjectAtIndex(args, 0); - [api - callFlutterEchoNullableNonNullClassMap:arg_classMap - completion:^(NSDictionary - *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableEnum", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableEnum:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableEnum:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FLTAnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableEnum:arg_anEnum - completion:^(FLTAnEnumBox *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoAnotherNullableEnum", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoAnotherNullableEnum:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoAnotherNullableEnum:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FLTAnotherEnumBox *arg_anotherEnum = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAnotherNullableEnum:arg_anotherEnum - completion:^(FLTAnotherEnumBox *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterSmallApiEchoString", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterSmallApiEchoString:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterSmallApiEchoString:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api callFlutterSmallApiEchoString:arg_aString - completion:^(NSString *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} -@interface FLTFlutterIntegrationCoreApi () -@property(nonatomic, strong) NSObject *binaryMessenger; -@property(nonatomic, strong) NSString *messageChannelSuffix; -@end - -@implementation FLTFlutterIntegrationCoreApi - -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; -} -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 - ? @"" - : [NSString stringWithFormat:@".%@", messageChannelSuffix]; - } - return self; -} -- (void)noopWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)throwErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - id output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)throwErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.throwErrorFromVoid", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)echoAllTypes:(FLTAllTypes *)arg_everything - completion:(void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_everything ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FLTAllTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoAllNullableTypes:(nullable FLTAllNullableTypes *)arg_everything - completion:(void (^)(FLTAllNullableTypes *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoAllNullableTypes", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_everything ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FLTAllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool - anInt:(nullable NSNumber *)arg_aNullableInt - aString:(nullable NSString *)arg_aNullableString - completion:(void (^)(FLTAllNullableTypes *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.sendMultipleNullableTypes", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ - arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], - arg_aNullableString ?: [NSNull null] - ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FLTAllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoAllNullableTypesWithoutRecursion: - (nullable FLTAllNullableTypesWithoutRecursion *)arg_everything - completion: - (void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_everything ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FLTAllNullableTypesWithoutRecursion *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)arg_aNullableBool - anInt:(nullable NSNumber *)arg_aNullableInt - aString:(nullable NSString *)arg_aNullableString - completion: - (void (^)( - FLTAllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - @"sendMultipleNullableTypesWithoutRecursion", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ - arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], - arg_aNullableString ?: [NSNull null] - ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FLTAllNullableTypesWithoutRecursion *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoBool:(BOOL)arg_aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ @(arg_aBool) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoInt:(NSInteger)arg_anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ @(arg_anInt) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoDouble:(double)arg_aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ @(arg_aDouble) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoString:(NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoUint8List:(FlutterStandardTypedData *)arg_list - completion: - (void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_list ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FlutterStandardTypedData *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoList:(NSArray *)arg_list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_list ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoEnumList:(NSArray *)arg_enumList - completion: - (void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumList", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_enumList ?: [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)echoClassList:(NSArray *)arg_classList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassList", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_classList ?: [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)echoNonNullEnumList:(NSArray *)arg_enumList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNonNullEnumList", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_enumList ?: [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)echoNonNullClassList:(NSArray *)arg_classList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNonNullClassList", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_classList ?: [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_map - completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_map ?: [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)echoStringMap:(NSDictionary *)arg_stringMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoStringMap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_stringMap ?: [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)echoIntMap:(NSDictionary *)arg_intMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoIntMap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_intMap ?: [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)echoEnumMap:(NSDictionary *)arg_enumMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumMap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_enumMap ?: [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)echoClassMap:(NSDictionary *)arg_classMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassMap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_classMap ?: [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)echoNonNullStringMap:(NSDictionary *)arg_stringMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNonNullStringMap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_stringMap ?: [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)echoNonNullIntMap:(NSDictionary *)arg_intMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNonNullIntMap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_intMap ?: [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)echoNonNullEnumMap:(NSDictionary *)arg_enumMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNonNullEnumMap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_enumMap ?: [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)echoNonNullClassMap:(NSDictionary *)arg_classMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNonNullClassMap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_classMap ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSDictionary *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoEnum:(FLTAnEnum)arg_anEnum - completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ [[FLTAnEnumBox alloc] initWithValue:arg_anEnum] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FLTAnEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoAnotherEnum:(FLTAnotherEnum)arg_anotherEnum - completion: - (void (^)(FLTAnotherEnumBox *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAnotherEnum", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ [[FLTAnotherEnumBox alloc] initWithValue:arg_anotherEnum] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FLTAnotherEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableBool:(nullable NSNumber *)arg_aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aBool ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableInt:(nullable NSNumber *)arg_anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_anInt ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableDouble", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aDouble ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableString:(nullable NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableString", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_list - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableUint8List", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_list ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FlutterStandardTypedData *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableList:(nullable NSArray *)arg_list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_list ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableEnumList:(nullable NSArray *)arg_enumList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableEnumList", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_enumList ?: [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)echoNullableClassList:(nullable NSArray *)arg_classList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableClassList", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_classList ?: [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)echoNullableNonNullEnumList:(nullable NSArray *)arg_enumList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableNonNullEnumList", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_enumList ?: [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)echoNullableNonNullClassList:(nullable NSArray *)arg_classList - completion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableNonNullClassList", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_classList ?: [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_map - completion: - (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_map ?: [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)echoNullableStringMap:(nullable NSDictionary *)arg_stringMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableStringMap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_stringMap ?: [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)echoNullableIntMap:(nullable NSDictionary *)arg_intMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableIntMap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_intMap ?: [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)echoNullableEnumMap:(nullable NSDictionary *)arg_enumMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableEnumMap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_enumMap ?: [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)echoNullableClassMap: - (nullable NSDictionary *)arg_classMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableClassMap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_classMap ?: [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)echoNullableNonNullStringMap:(nullable NSDictionary *)arg_stringMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableNonNullStringMap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_stringMap ?: [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)echoNullableNonNullIntMap:(nullable NSDictionary *)arg_intMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableNonNullIntMap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_intMap ?: [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) - echoNullableNonNullEnumMap:(nullable NSDictionary *)arg_enumMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableNonNullEnumMap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_enumMap ?: [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)echoNullableNonNullClassMap: - (nullable NSDictionary *)arg_classMap - completion: - (void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableNonNullClassMap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_classMap ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSDictionary *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableEnum:(nullable FLTAnEnumBox *)arg_anEnum - completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_anEnum == nil ? [NSNull null] : arg_anEnum ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FLTAnEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoAnotherNullableEnum:(nullable FLTAnotherEnumBox *)arg_anotherEnum - completion:(void (^)(FLTAnotherEnumBox *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoAnotherNullableEnum", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_anotherEnum == nil ? [NSNull null] : arg_anotherEnum ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FLTAnotherEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)echoAsyncString:(NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -@end - -void SetUpFLTHostTrivialApi(id binaryMessenger, - NSObject *api) { - SetUpFLTHostTrivialApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFLTHostTrivialApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(noopWithError:)], - @"FLTHostTrivialApi api (%@) doesn't respond to @selector(noopWithError:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - [api noopWithError:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} -void SetUpFLTHostSmallApi(id binaryMessenger, - NSObject *api) { - SetUpFLTHostSmallApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFLTHostSmallApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(echoString:completion:)], - @"FLTHostSmallApi api (%@) doesn't respond to @selector(echoString:completion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api echoString:arg_aString - completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostSmallApi.voidVoid", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(voidVoidWithCompletion:)], - @"FLTHostSmallApi api (%@) doesn't respond to @selector(voidVoidWithCompletion:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api voidVoidWithCompletion:^(FlutterError *_Nullable error) { - callback(wrapResult(nil, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} -@interface FLTFlutterSmallApi () -@property(nonatomic, strong) NSObject *binaryMessenger; -@property(nonatomic, strong) NSString *messageChannelSuffix; -@end - -@implementation FLTFlutterSmallApi - -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; -} -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 - ? @"" - : [NSString stringWithFormat:@".%@", messageChannelSuffix]; - } - return self; -} -- (void)echoWrappedList:(FLTTestMessage *)arg_msg - completion:(void (^)(FLTTestMessage *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_msg ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FLTTestMessage *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoString:(NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -@end diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/alternate_language_test_plugin.podspec b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/alternate_language_test_plugin.podspec deleted file mode 100644 index d9ce18f4dab..00000000000 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/alternate_language_test_plugin.podspec +++ /dev/null @@ -1,23 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. -# Run `pod lib lint alternate_language_test_plugin.podspec` to validate before publishing. -# -Pod::Spec.new do |s| - s.name = 'alternate_language_test_plugin' - s.version = '0.0.1' - s.summary = 'Alternate-language Pigeon test plugin' - s.description = <<-DESC -A plugin to test Pigeon generation for secondary languages (e.g., Java, Objective-C). - DESC - s.homepage = 'http://example.com' - s.license = { :type => 'BSD', :file => '../../../LICENSE' } - s.author = { 'Your Company' => 'email@example.com' } - - s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/pigeon' } - s.source_files = 'Classes/**/*' - s.dependency 'FlutterMacOS' - - s.platform = :osx, '10.14' - s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } - s.swift_version = '5.0' -end diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/pubspec.yaml b/packages/pigeon/platform_tests/alternate_language_test_plugin/pubspec.yaml index 415203428d8..14ece47a315 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/pubspec.yaml +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/pubspec.yaml @@ -15,8 +15,10 @@ flutter: pluginClass: AlternateLanguageTestPlugin ios: pluginClass: AlternateLanguageTestPlugin + sharedDarwinSource: true macos: pluginClass: AlternateLanguageTestPlugin + sharedDarwinSource: true dependencies: flutter: diff --git a/packages/pigeon/platform_tests/test_plugin/ios/.gitignore b/packages/pigeon/platform_tests/test_plugin/darwin/.gitignore similarity index 100% rename from packages/pigeon/platform_tests/test_plugin/ios/.gitignore rename to packages/pigeon/platform_tests/test_plugin/darwin/.gitignore diff --git a/packages/pigeon/platform_tests/test_plugin/ios/Classes/.gitignore b/packages/pigeon/platform_tests/test_plugin/darwin/Classes/.gitignore similarity index 99% rename from packages/pigeon/platform_tests/test_plugin/ios/Classes/.gitignore rename to packages/pigeon/platform_tests/test_plugin/darwin/Classes/.gitignore index 94e339ef912..ad1dc18f98c 100644 --- a/packages/pigeon/platform_tests/test_plugin/ios/Classes/.gitignore +++ b/packages/pigeon/platform_tests/test_plugin/darwin/Classes/.gitignore @@ -5,7 +5,6 @@ !CoreTests.gen.swift # Keeping this makes it easier to review changes to ProxyApi generation. !ProxyApiTests.gen.swift - # Including these makes it easier to review code generation changes. !ProxyApiTestClass.swift !EventChannelTests.gen.swift diff --git a/packages/pigeon/platform_tests/test_plugin/ios/Classes/CoreTests.gen.swift b/packages/pigeon/platform_tests/test_plugin/darwin/Classes/CoreTests.gen.swift similarity index 100% rename from packages/pigeon/platform_tests/test_plugin/ios/Classes/CoreTests.gen.swift rename to packages/pigeon/platform_tests/test_plugin/darwin/Classes/CoreTests.gen.swift diff --git a/packages/pigeon/platform_tests/test_plugin/ios/Classes/EventChannelTests.gen.swift b/packages/pigeon/platform_tests/test_plugin/darwin/Classes/EventChannelTests.gen.swift similarity index 100% rename from packages/pigeon/platform_tests/test_plugin/ios/Classes/EventChannelTests.gen.swift rename to packages/pigeon/platform_tests/test_plugin/darwin/Classes/EventChannelTests.gen.swift diff --git a/packages/pigeon/platform_tests/test_plugin/macos/Classes/ProxyApiTestClass.swift b/packages/pigeon/platform_tests/test_plugin/darwin/Classes/ProxyApiTestClass.swift similarity index 91% rename from packages/pigeon/platform_tests/test_plugin/macos/Classes/ProxyApiTestClass.swift rename to packages/pigeon/platform_tests/test_plugin/darwin/Classes/ProxyApiTestClass.swift index f6e7eed44cb..3f5633022d7 100644 --- a/packages/pigeon/platform_tests/test_plugin/macos/Classes/ProxyApiTestClass.swift +++ b/packages/pigeon/platform_tests/test_plugin/darwin/Classes/ProxyApiTestClass.swift @@ -10,5 +10,5 @@ open class ProxyApiSuperClass {} protocol ProxyApiInterface {} -@available(macOS 10, *) +@available(iOS 15, macOS 10, *) class ClassWithApiRequirement {} diff --git a/packages/pigeon/platform_tests/test_plugin/ios/Classes/ProxyApiTests.gen.swift b/packages/pigeon/platform_tests/test_plugin/darwin/Classes/ProxyApiTests.gen.swift similarity index 100% rename from packages/pigeon/platform_tests/test_plugin/ios/Classes/ProxyApiTests.gen.swift rename to packages/pigeon/platform_tests/test_plugin/darwin/Classes/ProxyApiTests.gen.swift diff --git a/packages/pigeon/platform_tests/test_plugin/macos/Classes/TestPlugin.swift b/packages/pigeon/platform_tests/test_plugin/darwin/Classes/TestPlugin.swift similarity index 98% rename from packages/pigeon/platform_tests/test_plugin/macos/Classes/TestPlugin.swift rename to packages/pigeon/platform_tests/test_plugin/darwin/Classes/TestPlugin.swift index 295a6440875..3783bdbeb85 100644 --- a/packages/pigeon/platform_tests/test_plugin/macos/Classes/TestPlugin.swift +++ b/packages/pigeon/platform_tests/test_plugin/darwin/Classes/TestPlugin.swift @@ -2,8 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import Cocoa -import FlutterMacOS +import Foundation + +#if os(iOS) + import Flutter +#elseif os(macOS) + import FlutterMacOS +#endif /// This plugin handles the native side of the integration tests in /// example/integration_test/. @@ -14,8 +19,14 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { var proxyApiRegistrar: ProxyApiTestsPigeonProxyApiRegistrar? public static func register(with registrar: FlutterPluginRegistrar) { - let plugin = TestPlugin(binaryMessenger: registrar.messenger) - HostIntegrationCoreApiSetup.setUp(binaryMessenger: registrar.messenger, api: plugin) + // Workaround for https://github.com/flutter/flutter/issues/118103. + #if os(iOS) + let messenger = registrar.messenger() + #else + let messenger = registrar.messenger + #endif + let plugin = TestPlugin(binaryMessenger: messenger) + HostIntegrationCoreApiSetup.setUp(binaryMessenger: messenger, api: plugin) TestPluginWithSuffix.register(with: registrar, suffix: "suffixOne") TestPluginWithSuffix.register(with: registrar, suffix: "suffixTwo") registrar.publish(plugin) @@ -27,6 +38,9 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { binaryMessenger: binaryMessenger, messageChannelSuffix: "suffixOne") flutterSmallApiTwo = FlutterSmallApi( binaryMessenger: binaryMessenger, messageChannelSuffix: "suffixTwo") + + StreamIntsStreamHandler.register(with: binaryMessenger, streamHandler: SendInts()) + StreamEventsStreamHandler.register(with: binaryMessenger, streamHandler: SendEvents()) StreamConsistentNumbersStreamHandler.register( with: binaryMessenger, instanceName: "1", streamHandler: SendConsistentNumbers(numberToSend: 1)) @@ -36,9 +50,6 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { proxyApiRegistrar = ProxyApiTestsPigeonProxyApiRegistrar( binaryMessenger: binaryMessenger, apiDelegate: ProxyApiDelegate()) proxyApiRegistrar!.setUp() - - StreamIntsStreamHandler.register(with: binaryMessenger, streamHandler: SendInts()) - StreamEventsStreamHandler.register(with: binaryMessenger, streamHandler: SendEvents()) } public func detachFromEngine(for registrar: FlutterPluginRegistrar) { @@ -1215,9 +1226,15 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { public class TestPluginWithSuffix: HostSmallApi { public static func register(with registrar: FlutterPluginRegistrar, suffix: String) { + // Workaround for https://github.com/flutter/flutter/issues/118103. + #if os(iOS) + let messenger = registrar.messenger() + #else + let messenger = registrar.messenger + #endif let plugin = TestPluginWithSuffix() HostSmallApiSetup.setUp( - binaryMessenger: registrar.messenger, api: plugin, messageChannelSuffix: suffix) + binaryMessenger: messenger, api: plugin, messageChannelSuffix: suffix) } func echo(aString: String, completion: @escaping (Result) -> Void) { @@ -1229,6 +1246,7 @@ public class TestPluginWithSuffix: HostSmallApi { } } + class SendInts: StreamIntsStreamHandler { var timerActive = false var timer: Timer? @@ -2210,14 +2228,14 @@ class ProxyApiDelegate: ProxyApiTestsPigeonProxyApiDelegate { -> PigeonApiClassWithApiRequirement { class ClassWithApiRequirementDelegate: PigeonApiDelegateClassWithApiRequirement { - @available(macOS 10, *) + @available(iOS 15, macOS 10, *) func pigeonDefaultConstructor(pigeonApi: PigeonApiClassWithApiRequirement) throws -> ClassWithApiRequirement { return ClassWithApiRequirement() } - @available(macOS 10, *) + @available(iOS 15, macOS 10, *) func aMethod( pigeonApi: PigeonApiClassWithApiRequirement, pigeonInstance: ClassWithApiRequirement ) throws { diff --git a/packages/pigeon/platform_tests/test_plugin/ios/test_plugin.podspec b/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin.podspec similarity index 79% rename from packages/pigeon/platform_tests/test_plugin/ios/test_plugin.podspec rename to packages/pigeon/platform_tests/test_plugin/darwin/test_plugin.podspec index 9b19ac1850c..6cc844c5968 100644 --- a/packages/pigeon/platform_tests/test_plugin/ios/test_plugin.podspec +++ b/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin.podspec @@ -14,14 +14,13 @@ Pod::Spec.new do |s| s.author = { 'Your Company' => 'email@example.com' } s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/pigeon' } s.source_files = 'Classes/**/*' - s.dependency 'Flutter' - s.platform = :ios, '12.0' - s.xcconfig = { + s.ios.dependency 'Flutter' + s.osx.dependency 'FlutterMacOS' + s.ios.deployment_target = '12.0' + s.osx.deployment_target = '10.14' + s.ios.xcconfig = { 'LIBRARY_SEARCH_PATHS' => '$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)/ $(SDKROOT)/usr/lib/swift', 'LD_RUNPATH_SEARCH_PATHS' => '/usr/lib/swift', } - - # Flutter.framework does not contain a i386 slice. - s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } s.swift_version = '5.0' end diff --git a/packages/pigeon/platform_tests/test_plugin/ios/Assets/.gitkeep b/packages/pigeon/platform_tests/test_plugin/ios/Assets/.gitkeep deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/packages/pigeon/platform_tests/test_plugin/ios/Classes/ProxyApiTestClass.swift b/packages/pigeon/platform_tests/test_plugin/ios/Classes/ProxyApiTestClass.swift deleted file mode 100644 index 04a14c4e69f..00000000000 --- a/packages/pigeon/platform_tests/test_plugin/ios/Classes/ProxyApiTestClass.swift +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import Foundation - -class ProxyApiTestClass: ProxyApiSuperClass, ProxyApiInterface {} - -open class ProxyApiSuperClass {} - -protocol ProxyApiInterface {} - -@available(iOS 15, *) -class ClassWithApiRequirement {} diff --git a/packages/pigeon/platform_tests/test_plugin/ios/Classes/TestPlugin.swift b/packages/pigeon/platform_tests/test_plugin/ios/Classes/TestPlugin.swift deleted file mode 100644 index 5059fedfeaf..00000000000 --- a/packages/pigeon/platform_tests/test_plugin/ios/Classes/TestPlugin.swift +++ /dev/null @@ -1,2150 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import Flutter -import UIKit - -/// This plugin handles the native side of the integration tests in -/// example/integration_test/. -public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { - - var flutterAPI: FlutterIntegrationCoreApi - var flutterSmallApiOne: FlutterSmallApi - var flutterSmallApiTwo: FlutterSmallApi - var proxyApiRegistrar: ProxyApiTestsPigeonProxyApiRegistrar? - - public static func register(with registrar: FlutterPluginRegistrar) { - let plugin = TestPlugin(binaryMessenger: registrar.messenger()) - HostIntegrationCoreApiSetup.setUp(binaryMessenger: registrar.messenger(), api: plugin) - TestPluginWithSuffix.register(with: registrar, suffix: "suffixOne") - TestPluginWithSuffix.register(with: registrar, suffix: "suffixTwo") - registrar.publish(plugin) - } - - init(binaryMessenger: FlutterBinaryMessenger) { - flutterAPI = FlutterIntegrationCoreApi(binaryMessenger: binaryMessenger) - flutterSmallApiOne = FlutterSmallApi( - binaryMessenger: binaryMessenger, messageChannelSuffix: "suffixOne") - flutterSmallApiTwo = FlutterSmallApi( - binaryMessenger: binaryMessenger, messageChannelSuffix: "suffixTwo") - - StreamIntsStreamHandler.register(with: binaryMessenger, streamHandler: SendInts()) - StreamEventsStreamHandler.register(with: binaryMessenger, streamHandler: SendEvents()) - StreamConsistentNumbersStreamHandler.register( - with: binaryMessenger, instanceName: "1", - streamHandler: SendConsistentNumbers(numberToSend: 1)) - StreamConsistentNumbersStreamHandler.register( - with: binaryMessenger, instanceName: "2", - streamHandler: SendConsistentNumbers(numberToSend: 2)) - proxyApiRegistrar = ProxyApiTestsPigeonProxyApiRegistrar( - binaryMessenger: binaryMessenger, apiDelegate: ProxyApiDelegate()) - proxyApiRegistrar!.setUp() - } - - public func detachFromEngine(for registrar: FlutterPluginRegistrar) { - proxyApiRegistrar!.tearDown() - proxyApiRegistrar = nil - } - - // MARK: HostIntegrationCoreApi implementation - - func noop() { - - } - - func echo(_ everything: AllTypes) -> AllTypes { - return everything - } - - func echo(_ everything: AllNullableTypes?) -> AllNullableTypes? { - return everything - } - func echo(_ everything: AllNullableTypesWithoutRecursion?) throws - -> AllNullableTypesWithoutRecursion? - { - return everything - } - - func throwError() throws -> Any? { - throw PigeonError(code: "code", message: "message", details: "details") - } - - func throwErrorFromVoid() throws { - throw PigeonError(code: "code", message: "message", details: "details") - } - - func throwFlutterError() throws -> Any? { - throw PigeonError(code: "code", message: "message", details: "details") - } - - func echo(_ anInt: Int64) -> Int64 { - return anInt - } - - func echo(_ aDouble: Double) -> Double { - return aDouble - } - - func echo(_ aBool: Bool) -> Bool { - return aBool - } - - func echo(_ aString: String) -> String { - return aString - } - - func echo(_ aUint8List: FlutterStandardTypedData) -> FlutterStandardTypedData { - return aUint8List - } - - func echo(_ anObject: Any) -> Any { - return anObject - } - - func echo(_ list: [Any?]) throws -> [Any?] { - return list - } - - func echo(enumList: [AnEnum?]) throws -> [AnEnum?] { - return enumList - } - - func echo(classList: [AllNullableTypes?]) throws -> [AllNullableTypes?] { - return classList - } - - func echoNonNull(enumList: [AnEnum]) throws -> [AnEnum] { - return enumList - } - - func echoNonNull(classList: [AllNullableTypes]) throws -> [AllNullableTypes] { - return classList - } - - func echo(_ map: [AnyHashable?: Any?]) throws -> [AnyHashable?: Any?] { - return map - } - - func echo(stringMap: [String?: String?]) throws -> [String?: String?] { - return stringMap - } - - func echo(intMap: [Int64?: Int64?]) throws -> [Int64?: Int64?] { - return intMap - } - - func echo(enumMap: [AnEnum?: AnEnum?]) throws -> [AnEnum?: AnEnum?] { - return enumMap - } - - func echo(classMap: [Int64?: AllNullableTypes?]) throws -> [Int64?: AllNullableTypes?] { - return classMap - } - - func echoNonNull(stringMap: [String: String]) throws -> [String: String] { - return stringMap - } - - func echoNonNull(intMap: [Int64: Int64]) throws -> [Int64: Int64] { - return intMap - } - - func echoNonNull(enumMap: [AnEnum: AnEnum]) throws -> [AnEnum: AnEnum] { - return enumMap - } - - func echoNonNull(classMap: [Int64: AllNullableTypes]) throws -> [Int64: AllNullableTypes] { - return classMap - } - - func echo(_ wrapper: AllClassesWrapper) throws -> AllClassesWrapper { - return wrapper - } - - func echo(_ anEnum: AnEnum) throws -> AnEnum { - return anEnum - } - - func echo(_ anotherEnum: AnotherEnum) throws -> AnotherEnum { - return anotherEnum - } - - func extractNestedNullableString(from wrapper: AllClassesWrapper) -> String? { - return wrapper.allNullableTypes.aNullableString - } - - func createNestedObject(with nullableString: String?) -> AllClassesWrapper { - return AllClassesWrapper( - allNullableTypes: AllNullableTypes(aNullableString: nullableString), classList: [], - classMap: [:]) - } - - func sendMultipleNullableTypes( - aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String? - ) -> AllNullableTypes { - let someThings = AllNullableTypes( - aNullableBool: aNullableBool, aNullableInt: aNullableInt, aNullableString: aNullableString) - return someThings - } - - func sendMultipleNullableTypesWithoutRecursion( - aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String? - ) throws -> AllNullableTypesWithoutRecursion { - let someThings = AllNullableTypesWithoutRecursion( - aNullableBool: aNullableBool, aNullableInt: aNullableInt, aNullableString: aNullableString) - return someThings - } - - func echo(_ aNullableInt: Int64?) -> Int64? { - return aNullableInt - } - - func echo(_ aNullableDouble: Double?) -> Double? { - return aNullableDouble - } - - func echo(_ aNullableBool: Bool?) -> Bool? { - return aNullableBool - } - - func echo(_ aNullableString: String?) -> String? { - return aNullableString - } - - func echo(_ aNullableUint8List: FlutterStandardTypedData?) -> FlutterStandardTypedData? { - return aNullableUint8List - } - - func echo(_ aNullableObject: Any?) -> Any? { - return aNullableObject - } - - func echoNamedDefault(_ aString: String) throws -> String { - return aString - } - - func echoOptionalDefault(_ aDouble: Double) throws -> Double { - return aDouble - } - - func echoRequired(_ anInt: Int64) throws -> Int64 { - return anInt - } - - func echoNullable(_ aNullableList: [Any?]?) throws -> [Any?]? { - return aNullableList - } - - func echoNullable(enumList: [AnEnum?]?) throws -> [AnEnum?]? { - return enumList - } - - func echoNullable(classList: [AllNullableTypes?]?) throws -> [AllNullableTypes?]? { - return classList - } - - func echoNullableNonNull(enumList: [AnEnum]?) throws -> [AnEnum]? { - return enumList - } - - func echoNullableNonNull(classList: [AllNullableTypes]?) throws -> [AllNullableTypes]? { - return classList - } - - func echoNullable(_ map: [AnyHashable?: Any?]?) throws -> [AnyHashable?: Any?]? { - return map - } - - func echoNullable(stringMap: [String?: String?]?) throws -> [String?: String?]? { - return stringMap - } - - func echoNullable(intMap: [Int64?: Int64?]?) throws -> [Int64?: Int64?]? { - return intMap - } - - func echoNullable(enumMap: [AnEnum?: AnEnum?]?) throws -> [AnEnum?: AnEnum?]? { - return enumMap - } - - func echoNullable(classMap: [Int64?: AllNullableTypes?]?) throws -> [Int64?: AllNullableTypes?]? { - return classMap - } - - func echoNullableNonNull(stringMap: [String: String]?) throws -> [String: String]? { - return stringMap - } - - func echoNullableNonNull(intMap: [Int64: Int64]?) throws -> [Int64: Int64]? { - return intMap - } - - func echoNullableNonNull(enumMap: [AnEnum: AnEnum]?) throws -> [AnEnum: AnEnum]? { - return enumMap - } - - func echoNullableNonNull(classMap: [Int64: AllNullableTypes]?) throws -> [Int64: - AllNullableTypes]? - { - return classMap - } - - func echoNullable(_ anEnum: AnEnum?) throws -> AnEnum? { - return anEnum - } - - func echoNullable(_ anotherEnum: AnotherEnum?) throws -> AnotherEnum? { - return anotherEnum - } - - func echoOptional(_ aNullableInt: Int64?) throws -> Int64? { - return aNullableInt - } - - func echoNamed(_ aNullableString: String?) throws -> String? { - return aNullableString - } - - func noopAsync(completion: @escaping (Result) -> Void) { - completion(.success(Void())) - } - - func throwAsyncError(completion: @escaping (Result) -> Void) { - completion(.failure(PigeonError(code: "code", message: "message", details: "details"))) - } - - func throwAsyncErrorFromVoid(completion: @escaping (Result) -> Void) { - completion(.failure(PigeonError(code: "code", message: "message", details: "details"))) - } - - func throwAsyncFlutterError(completion: @escaping (Result) -> Void) { - completion(.failure(PigeonError(code: "code", message: "message", details: "details"))) - } - - func echoAsync(_ everything: AllTypes, completion: @escaping (Result) -> Void) { - completion(.success(everything)) - } - - func echoAsync( - _ everything: AllNullableTypes?, - completion: @escaping (Result) -> Void - ) { - completion(.success(everything)) - } - - func echoAsync( - _ everything: AllNullableTypesWithoutRecursion?, - completion: @escaping (Result) -> Void - ) { - completion(.success(everything)) - } - - func echoAsync(_ anInt: Int64, completion: @escaping (Result) -> Void) { - completion(.success(anInt)) - } - - func echoAsync(_ aDouble: Double, completion: @escaping (Result) -> Void) { - completion(.success(aDouble)) - } - - func echoAsync(_ aBool: Bool, completion: @escaping (Result) -> Void) { - completion(.success(aBool)) - } - - func echoAsync(_ aString: String, completion: @escaping (Result) -> Void) { - completion(.success(aString)) - } - - func echoAsync( - _ aUint8List: FlutterStandardTypedData, - completion: @escaping (Result) -> Void - ) { - completion(.success(aUint8List)) - } - - func echoAsync(_ anObject: Any, completion: @escaping (Result) -> Void) { - completion(.success(anObject)) - } - - func echoAsync(_ list: [Any?], completion: @escaping (Result<[Any?], Error>) -> Void) { - completion(.success(list)) - } - - func echoAsync(enumList: [AnEnum?], completion: @escaping (Result<[AnEnum?], Error>) -> Void) { - completion(.success(enumList)) - } - - func echoAsync( - classList: [AllNullableTypes?], - completion: @escaping (Result<[AllNullableTypes?], Error>) -> Void - ) { - completion(.success(classList)) - } - - func echoAsync( - _ map: [AnyHashable?: Any?], completion: @escaping (Result<[AnyHashable?: Any?], Error>) -> Void - ) { - completion(.success(map)) - } - - func echoAsync( - stringMap: [String?: String?], completion: @escaping (Result<[String?: String?], Error>) -> Void - ) { - completion(.success(stringMap)) - } - - func echoAsync( - intMap: [Int64?: Int64?], completion: @escaping (Result<[Int64?: Int64?], Error>) -> Void - ) { - completion(.success(intMap)) - } - - func echoAsync( - enumMap: [AnEnum?: AnEnum?], completion: @escaping (Result<[AnEnum?: AnEnum?], Error>) -> Void - ) { - completion(.success(enumMap)) - } - - func echoAsync( - classMap: [Int64?: AllNullableTypes?], - completion: @escaping (Result<[Int64?: AllNullableTypes?], Error>) -> Void - ) { - completion(.success(classMap)) - } - - func echoAsync(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) { - completion(.success(anEnum)) - } - - func echoAsync( - _ anotherEnum: AnotherEnum, completion: @escaping (Result) -> Void - ) { - completion(.success(anotherEnum)) - } - - func echoAsyncNullable(_ anInt: Int64?, completion: @escaping (Result) -> Void) { - completion(.success(anInt)) - } - - func echoAsyncNullable(_ aDouble: Double?, completion: @escaping (Result) -> Void) - { - completion(.success(aDouble)) - } - - func echoAsyncNullable(_ aBool: Bool?, completion: @escaping (Result) -> Void) { - completion(.success(aBool)) - } - - func echoAsyncNullable(_ aString: String?, completion: @escaping (Result) -> Void) - { - completion(.success(aString)) - } - - func echoAsyncNullable( - _ aUint8List: FlutterStandardTypedData?, - completion: @escaping (Result) -> Void - ) { - completion(.success(aUint8List)) - } - - func echoAsyncNullable(_ anObject: Any?, completion: @escaping (Result) -> Void) { - completion(.success(anObject)) - } - - func echoAsyncNullable(_ list: [Any?]?, completion: @escaping (Result<[Any?]?, Error>) -> Void) { - completion(.success(list)) - } - - func echoAsyncNullable( - enumList: [AnEnum?]?, completion: @escaping (Result<[AnEnum?]?, Error>) -> Void - ) { - completion(.success(enumList)) - } - - func echoAsyncNullable( - classList: [AllNullableTypes?]?, - completion: @escaping (Result<[AllNullableTypes?]?, Error>) -> Void - ) { - completion(.success(classList)) - } - - func echoAsyncNullable( - _ map: [AnyHashable?: Any?]?, - completion: @escaping (Result<[AnyHashable?: Any?]?, Error>) -> Void - ) { - completion(.success(map)) - } - - func echoAsyncNullable( - stringMap: [String?: String?]?, - completion: @escaping (Result<[String?: String?]?, Error>) -> Void - ) { - completion(.success(stringMap)) - } - - func echoAsyncNullable( - intMap: [Int64?: Int64?]?, completion: @escaping (Result<[Int64?: Int64?]?, Error>) -> Void - ) { - completion(.success(intMap)) - } - - func echoAsyncNullable( - enumMap: [AnEnum?: AnEnum?]?, completion: @escaping (Result<[AnEnum?: AnEnum?]?, Error>) -> Void - ) { - completion(.success(enumMap)) - } - - func echoAsyncNullable( - classMap: [Int64?: AllNullableTypes?]?, - completion: @escaping (Result<[Int64?: AllNullableTypes?]?, Error>) -> Void - ) { - completion(.success(classMap)) - } - - func echoAsyncNullable( - _ anEnum: AnEnum?, completion: @escaping (Result) -> Void - ) { - completion(.success(anEnum)) - } - - func echoAsyncNullable( - _ anotherEnum: AnotherEnum?, completion: @escaping (Result) -> Void - ) { - completion(.success(anotherEnum)) - } - - func defaultIsMainThread() -> Bool { - return Thread.isMainThread - } - - func taskQueueIsBackgroundThread() -> Bool { - return !Thread.isMainThread - } - - func callFlutterNoop(completion: @escaping (Result) -> Void) { - flutterAPI.noop { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterThrowError(completion: @escaping (Result) -> Void) { - flutterAPI.throwError { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterThrowErrorFromVoid(completion: @escaping (Result) -> Void) { - flutterAPI.throwErrorFromVoid { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEcho( - _ everything: AllTypes, completion: @escaping (Result) -> Void - ) { - flutterAPI.echo(everything) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEcho( - _ everything: AllNullableTypes?, - completion: @escaping (Result) -> Void - ) { - flutterAPI.echoNullable(everything) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEcho( - _ everything: AllNullableTypesWithoutRecursion?, - completion: @escaping (Result) -> Void - ) { - flutterAPI.echoNullable(everything) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterSendMultipleNullableTypes( - aBool aNullableBool: Bool?, - anInt aNullableInt: Int64?, - aString aNullableString: String?, - completion: @escaping (Result) -> Void - ) { - flutterAPI.sendMultipleNullableTypes( - aBool: aNullableBool, - anInt: aNullableInt, - aString: aNullableString - ) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterSendMultipleNullableTypesWithoutRecursion( - aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?, - completion: @escaping (Result) -> Void - ) { - flutterAPI.sendMultipleNullableTypesWithoutRecursion( - aBool: aNullableBool, - anInt: aNullableInt, - aString: aNullableString - ) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEcho(_ aBool: Bool, completion: @escaping (Result) -> Void) { - flutterAPI.echo(aBool) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEcho(_ anInt: Int64, completion: @escaping (Result) -> Void) { - flutterAPI.echo(anInt) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEcho(_ aDouble: Double, completion: @escaping (Result) -> Void) { - flutterAPI.echo(aDouble) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEcho(_ aString: String, completion: @escaping (Result) -> Void) { - flutterAPI.echo(aString) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEcho( - _ list: FlutterStandardTypedData, - completion: @escaping (Result) -> Void - ) { - flutterAPI.echo(list) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEcho(_ list: [Any?], completion: @escaping (Result<[Any?], Error>) -> Void) { - flutterAPI.echo(list) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEcho( - enumList: [AnEnum?], completion: @escaping (Result<[AnEnum?], Error>) -> Void - ) { - flutterAPI.echo(enumList: enumList) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEcho( - classList: [AllNullableTypes?], - completion: @escaping (Result<[AllNullableTypes?], Error>) -> Void - ) { - flutterAPI.echo(classList: classList) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNonNull( - enumList: [AnEnum], completion: @escaping (Result<[AnEnum], Error>) -> Void - ) { - flutterAPI.echoNonNull(enumList: enumList) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNonNull( - classList: [AllNullableTypes], completion: @escaping (Result<[AllNullableTypes], Error>) -> Void - ) { - flutterAPI.echoNonNull(classList: classList) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEcho( - _ map: [AnyHashable?: Any?], completion: @escaping (Result<[AnyHashable?: Any?], Error>) -> Void - ) { - flutterAPI.echo(map) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEcho( - stringMap: [String?: String?], completion: @escaping (Result<[String?: String?], Error>) -> Void - ) { - flutterAPI.echo(stringMap: stringMap) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEcho( - intMap: [Int64?: Int64?], completion: @escaping (Result<[Int64?: Int64?], Error>) -> Void - ) { - flutterAPI.echo(intMap: intMap) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEcho( - enumMap: [AnEnum?: AnEnum?], completion: @escaping (Result<[AnEnum?: AnEnum?], Error>) -> Void - ) { - flutterAPI.echo(enumMap: enumMap) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEcho( - classMap: [Int64?: AllNullableTypes?], - completion: @escaping (Result<[Int64?: AllNullableTypes?], Error>) -> Void - ) { - flutterAPI.echo(classMap: classMap) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNonNull( - stringMap: [String: String], completion: @escaping (Result<[String: String], Error>) -> Void - ) { - flutterAPI.echoNonNull(stringMap: stringMap) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNonNull( - intMap: [Int64: Int64], completion: @escaping (Result<[Int64: Int64], Error>) -> Void - ) { - flutterAPI.echoNonNull(intMap: intMap) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNonNull( - enumMap: [AnEnum: AnEnum], completion: @escaping (Result<[AnEnum: AnEnum], Error>) -> Void - ) { - flutterAPI.echoNonNull(enumMap: enumMap) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNonNull( - classMap: [Int64: AllNullableTypes], - completion: @escaping (Result<[Int64: AllNullableTypes], Error>) -> Void - ) { - flutterAPI.echoNonNull(classMap: classMap) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEcho( - _ anEnum: AnEnum, completion: @escaping (Result) -> Void - ) { - flutterAPI.echo(anEnum) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEcho( - _ anotherEnum: AnotherEnum, completion: @escaping (Result) -> Void - ) { - flutterAPI.echo(anotherEnum) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullable(_ aBool: Bool?, completion: @escaping (Result) -> Void) - { - flutterAPI.echoNullable(aBool) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullable( - _ anInt: Int64?, completion: @escaping (Result) -> Void - ) { - flutterAPI.echoNullable(anInt) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullable( - _ aDouble: Double?, completion: @escaping (Result) -> Void - ) { - flutterAPI.echoNullable(aDouble) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullable( - _ aString: String?, completion: @escaping (Result) -> Void - ) { - flutterAPI.echoNullable(aString) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullable( - _ list: FlutterStandardTypedData?, - completion: @escaping (Result) -> Void - ) { - flutterAPI.echoNullable(list) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullable( - _ list: [Any?]?, completion: @escaping (Result<[Any?]?, Error>) -> Void - ) { - flutterAPI.echoNullable(list) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullable( - enumList: [AnEnum?]?, completion: @escaping (Result<[AnEnum?]?, Error>) -> Void - ) { - flutterAPI.echoNullable(enumList: enumList) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullable( - classList: [AllNullableTypes?]?, - completion: @escaping (Result<[AllNullableTypes?]?, Error>) -> Void - ) { - flutterAPI.echoNullable(classList: classList) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullableNonNull( - enumList: [AnEnum]?, completion: @escaping (Result<[AnEnum]?, Error>) -> Void - ) { - flutterAPI.echoNullableNonNull(enumList: enumList) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullableNonNull( - classList: [AllNullableTypes]?, - completion: @escaping (Result<[AllNullableTypes]?, Error>) -> Void - ) { - flutterAPI.echoNullableNonNull(classList: classList) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullable( - _ map: [AnyHashable?: Any?]?, - completion: @escaping (Result<[AnyHashable?: Any?]?, Error>) -> Void - ) { - flutterAPI.echoNullable(map) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullable( - stringMap: [String?: String?]?, - completion: @escaping (Result<[String?: String?]?, Error>) -> Void - ) { - flutterAPI.echoNullable(stringMap: stringMap) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullable( - intMap: [Int64?: Int64?]?, completion: @escaping (Result<[Int64?: Int64?]?, Error>) -> Void - ) { - flutterAPI.echoNullable(intMap: intMap) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullable( - enumMap: [AnEnum?: AnEnum?]?, completion: @escaping (Result<[AnEnum?: AnEnum?]?, Error>) -> Void - ) { - flutterAPI.echoNullable(enumMap: enumMap) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullable( - classMap: [Int64?: AllNullableTypes?]?, - completion: @escaping (Result<[Int64?: AllNullableTypes?]?, Error>) -> Void - ) { - flutterAPI.echoNullable(classMap: classMap) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullableNonNull( - stringMap: [String: String]?, completion: @escaping (Result<[String: String]?, Error>) -> Void - ) { - flutterAPI.echoNullableNonNull(stringMap: stringMap) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullableNonNull( - intMap: [Int64: Int64]?, completion: @escaping (Result<[Int64: Int64]?, Error>) -> Void - ) { - flutterAPI.echoNullableNonNull(intMap: intMap) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullableNonNull( - enumMap: [AnEnum: AnEnum]?, completion: @escaping (Result<[AnEnum: AnEnum]?, Error>) -> Void - ) { - flutterAPI.echoNullableNonNull(enumMap: enumMap) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullableNonNull( - classMap: [Int64: AllNullableTypes]?, - completion: @escaping (Result<[Int64: AllNullableTypes]?, Error>) -> Void - ) { - flutterAPI.echoNullableNonNull(classMap: classMap) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullable( - _ anEnum: AnEnum?, completion: @escaping (Result) -> Void - ) { - flutterAPI.echoNullable(anEnum) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullable( - _ anotherEnum: AnotherEnum?, completion: @escaping (Result) -> Void - ) { - flutterAPI.echoNullable(anotherEnum) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterSmallApiEcho( - _ aString: String, completion: @escaping (Result) -> Void - ) { - flutterSmallApiOne.echo(string: aString) { responseOne in - self.flutterSmallApiTwo.echo(string: aString) { responseTwo in - switch responseOne { - case .success(let resOne): - switch responseTwo { - case .success(let resTwo): - if resOne == resTwo { - completion(.success(resOne)) - } else { - completion( - .failure( - PigeonError( - code: "", - message: "Multi-instance responses were not matching: \(resOne), \(resTwo)", - details: nil))) - } - case .failure(let error): - completion(.failure(error)) - } - case .failure(let error): - completion(.failure(error)) - } - } - } - } - - func testUnusedClassesGenerate() -> UnusedClass { - return UnusedClass() - } -} - -public class TestPluginWithSuffix: HostSmallApi { - public static func register(with registrar: FlutterPluginRegistrar, suffix: String) { - let plugin = TestPluginWithSuffix() - HostSmallApiSetup.setUp( - binaryMessenger: registrar.messenger(), api: plugin, messageChannelSuffix: suffix) - } - - func echo(aString: String, completion: @escaping (Result) -> Void) { - completion(.success(aString)) - } - - func voidVoid(completion: @escaping (Result) -> Void) { - completion(.success(Void())) - } - -} - -class SendInts: StreamIntsStreamHandler { - var timerActive = false - var timer: Timer? - - override func onListen(withArguments arguments: Any?, sink: PigeonEventSink) { - var count: Int64 = 0 - if !timerActive { - timerActive = true - timer = Timer.scheduledTimer(withTimeInterval: 0.01, repeats: true) { _ in - DispatchQueue.main.async { - sink.success(count) - count += 1 - if count >= 5 { - sink.endOfStream() - self.timer?.invalidate() - } - } - } - } - } -} - -class SendEvents: StreamEventsStreamHandler { - var timerActive = false - var timer: Timer? - var eventList: [PlatformEvent] = - [ - IntEvent(value: 1), - StringEvent(value: "string"), - BoolEvent(value: false), - DoubleEvent(value: 3.14), - ObjectsEvent(value: true), - EnumEvent(value: EventEnum.fortyTwo), - ClassEvent(value: EventAllNullableTypes(aNullableInt: 0)), - ] - - override func onListen(withArguments arguments: Any?, sink: PigeonEventSink) { - var count = 0 - if !timerActive { - timerActive = true - timer = Timer.scheduledTimer(withTimeInterval: 0.01, repeats: true) { _ in - DispatchQueue.main.async { - if count >= self.eventList.count { - sink.endOfStream() - self.timer?.invalidate() - } else { - sink.success(self.eventList[count]) - count += 1 - } - } - } - } - } -} - -class SendConsistentNumbers: StreamConsistentNumbersStreamHandler { - let numberToSend: Int64 - init(numberToSend: Int64) { - self.numberToSend = numberToSend - } - var timerActive = false - var timer: Timer? - - override func onListen(withArguments arguments: Any?, sink: PigeonEventSink) { - let numberThatWillBeSent: Int64 = numberToSend - var count: Int64 = 0 - if !timerActive { - timerActive = true - timer = Timer.scheduledTimer(withTimeInterval: 0.01, repeats: true) { _ in - DispatchQueue.main.async { - sink.success(numberThatWillBeSent) - count += 1 - if count >= 10 { - sink.endOfStream() - self.timer?.invalidate() - } - } - } - } - } -} - -class ProxyApiDelegate: ProxyApiTestsPigeonProxyApiDelegate { - func pigeonApiProxyApiTestClass(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) - -> PigeonApiProxyApiTestClass - { - class ProxyApiTestClassDelegate: PigeonApiDelegateProxyApiTestClass { - func pigeonDefaultConstructor( - pigeonApi: PigeonApiProxyApiTestClass, aBool: Bool, anInt: Int64, aDouble: Double, - aString: String, aUint8List: FlutterStandardTypedData, aList: [Any?], - aMap: [String?: Any?], - anEnum: ProxyApiTestEnum, aProxyApi: ProxyApiSuperClass, aNullableBool: Bool?, - aNullableInt: Int64?, aNullableDouble: Double?, aNullableString: String?, - aNullableUint8List: FlutterStandardTypedData?, aNullableList: [Any?]?, - aNullableMap: [String?: Any?]?, aNullableEnum: ProxyApiTestEnum?, - aNullableProxyApi: ProxyApiSuperClass?, boolParam: Bool, intParam: Int64, - doubleParam: Double, stringParam: String, aUint8ListParam: FlutterStandardTypedData, - listParam: [Any?], mapParam: [String?: Any?], enumParam: ProxyApiTestEnum, - proxyApiParam: ProxyApiSuperClass, nullableBoolParam: Bool?, nullableIntParam: Int64?, - nullableDoubleParam: Double?, nullableStringParam: String?, - nullableUint8ListParam: FlutterStandardTypedData?, nullableListParam: [Any?]?, - nullableMapParam: [String?: Any?]?, nullableEnumParam: ProxyApiTestEnum?, - nullableProxyApiParam: ProxyApiSuperClass? - ) throws -> ProxyApiTestClass { - return ProxyApiTestClass() - } - - func namedConstructor( - pigeonApi: PigeonApiProxyApiTestClass, aBool: Bool, anInt: Int64, aDouble: Double, - aString: String, aUint8List: FlutterStandardTypedData, aList: [Any?], aMap: [String?: Any?], - anEnum: ProxyApiTestEnum, aProxyApi: ProxyApiSuperClass, aNullableBool: Bool?, - aNullableInt: Int64?, aNullableDouble: Double?, aNullableString: String?, - aNullableUint8List: FlutterStandardTypedData?, aNullableList: [Any?]?, - aNullableMap: [String?: Any?]?, aNullableEnum: ProxyApiTestEnum?, - aNullableProxyApi: ProxyApiSuperClass? - ) throws -> ProxyApiTestClass { - return ProxyApiTestClass() - } - - func attachedField(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) - throws -> ProxyApiSuperClass - { - return ProxyApiSuperClass() - } - - func staticAttachedField(pigeonApi: PigeonApiProxyApiTestClass) throws - -> ProxyApiSuperClass - { - return ProxyApiSuperClass() - } - - func noop(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws { - } - - func throwError(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) - throws -> Any? - { - throw ProxyApiTestsError(code: "code", message: "message", details: "details") - } - - func throwErrorFromVoid( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass - ) throws { - throw ProxyApiTestsError(code: "code", message: "message", details: "details") - } - - func throwFlutterError( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass - ) throws -> Any? { - throw ProxyApiTestsError(code: "code", message: "message", details: "details") - } - - func echoInt( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64 - ) throws -> Int64 { - return anInt - } - - func echoDouble( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aDouble: Double - ) throws -> Double { - return aDouble - } - - func echoBool( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool - ) throws -> Bool { - return aBool - } - - func echoString( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aString: String - ) throws -> String { - return aString - } - - func echoUint8List( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aUint8List: FlutterStandardTypedData - ) throws -> FlutterStandardTypedData { - return aUint8List - } - - func echoObject( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anObject: Any - ) throws -> Any { - return anObject - } - - func echoList( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?] - ) throws -> [Any?] { - return aList - } - - func echoProxyApiList( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aList: [ProxyApiTestClass] - ) throws -> [ProxyApiTestClass] { - return aList - } - - func echoMap( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aMap: [String?: Any?] - ) throws -> [String?: Any?] { - return aMap - } - - func echoProxyApiMap( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aMap: [String: ProxyApiTestClass] - ) throws -> [String: ProxyApiTestClass] { - return aMap - } - - func echoEnum( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum - ) throws -> ProxyApiTestEnum { - return anEnum - } - - func echoProxyApi( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aProxyApi: ProxyApiSuperClass - ) throws -> ProxyApiSuperClass { - return aProxyApi - } - - func echoNullableInt( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aNullableInt: Int64? - ) throws -> Int64? { - return aNullableInt - } - - func echoNullableDouble( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aNullableDouble: Double? - ) throws -> Double? { - return aNullableDouble - } - - func echoNullableBool( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aNullableBool: Bool? - ) throws -> Bool? { - return aNullableBool - } - - func echoNullableString( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aNullableString: String? - ) throws -> String? { - return aNullableString - } - - func echoNullableUint8List( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aNullableUint8List: FlutterStandardTypedData? - ) throws -> FlutterStandardTypedData? { - return aNullableUint8List - } - - func echoNullableObject( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aNullableObject: Any? - ) throws -> Any? { - return aNullableObject - } - - func echoNullableList( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aNullableList: [Any?]? - ) throws -> [Any?]? { - return aNullableList - } - - func echoNullableMap( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aNullableMap: [String?: Any?]? - ) throws -> [String?: Any?]? { - return aNullableMap - } - - func echoNullableEnum( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aNullableEnum: ProxyApiTestEnum? - ) throws -> ProxyApiTestEnum? { - return aNullableEnum - } - - func echoNullableProxyApi( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aNullableProxyApi: ProxyApiSuperClass? - ) throws -> ProxyApiSuperClass? { - return aNullableProxyApi - } - - func noopAsync( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - completion: @escaping (Result) -> Void - ) { - completion(.success(Void())) - } - - func echoAsyncInt( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64, - completion: @escaping (Result) -> Void - ) { - completion(.success(anInt)) - } - - func echoAsyncDouble( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aDouble: Double, - completion: @escaping (Result) -> Void - ) { - completion(.success(aDouble)) - } - - func echoAsyncBool( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool, - completion: @escaping (Result) -> Void - ) { - completion(.success(aBool)) - } - - func echoAsyncString( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aString: String, - completion: @escaping (Result) -> Void - ) { - completion(.success(aString)) - } - - func echoAsyncUint8List( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aUint8List: FlutterStandardTypedData, - completion: @escaping (Result) -> Void - ) { - completion(.success(aUint8List)) - } - - func echoAsyncObject( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anObject: Any, - completion: @escaping (Result) -> Void - ) { - completion(.success(anObject)) - } - - func echoAsyncList( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?], - completion: @escaping (Result<[Any?], Error>) -> Void - ) { - completion(.success(aList)) - } - - func echoAsyncMap( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void - ) { - completion(.success(aMap)) - } - - func echoAsyncEnum( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum, - completion: @escaping (Result) -> Void - ) { - completion(.success(anEnum)) - } - - func throwAsyncError( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - completion: @escaping (Result) -> Void - ) { - completion( - .failure(ProxyApiTestsError(code: "code", message: "message", details: "details"))) - } - - func throwAsyncErrorFromVoid( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - completion: @escaping (Result) -> Void - ) { - completion( - .failure(ProxyApiTestsError(code: "code", message: "message", details: "details"))) - } - - func throwAsyncFlutterError( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - completion: @escaping (Result) -> Void - ) { - completion( - .failure(ProxyApiTestsError(code: "code", message: "message", details: "details"))) - } - - func echoAsyncNullableInt( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64?, - completion: @escaping (Result) -> Void - ) { - completion(.success(anInt)) - } - - func echoAsyncNullableDouble( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aDouble: Double?, - completion: @escaping (Result) -> Void - ) { - completion(.success(aDouble)) - } - - func echoAsyncNullableBool( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool?, - completion: @escaping (Result) -> Void - ) { - completion(.success(aBool)) - } - - func echoAsyncNullableString( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aString: String?, - completion: @escaping (Result) -> Void - ) { - completion(.success(aString)) - } - - func echoAsyncNullableUint8List( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aUint8List: FlutterStandardTypedData?, - completion: @escaping (Result) -> Void - ) { - completion(.success(aUint8List)) - } - - func echoAsyncNullableObject( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - anObject: Any?, - completion: @escaping (Result) -> Void - ) { - completion(.success(anObject)) - } - - func echoAsyncNullableList( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aList: [Any?]?, - completion: @escaping (Result<[Any?]?, Error>) -> Void - ) { - completion(.success(aList)) - } - - func echoAsyncNullableMap( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void - ) { - completion(.success(aMap)) - } - - func echoAsyncNullableEnum( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum?, - completion: @escaping (Result) -> Void - ) { - completion(.success(anEnum)) - } - - func staticNoop(pigeonApi: PigeonApiProxyApiTestClass) throws { - - } - - func echoStaticString(pigeonApi: PigeonApiProxyApiTestClass, aString: String) throws - -> String - { - return aString - } - - func staticAsyncNoop( - pigeonApi: PigeonApiProxyApiTestClass, - completion: @escaping (Result) -> Void - ) { - completion(.success(Void())) - } - - func callFlutterNoop( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - completion: @escaping (Result) -> Void - ) { - pigeonApi.flutterNoop(pigeonInstance: pigeonInstance) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterThrowError( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - completion: @escaping (Result) -> Void - ) { - pigeonApi.flutterThrowError(pigeonInstance: pigeonInstance) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterThrowErrorFromVoid( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - completion: @escaping (Result) -> Void - ) { - pigeonApi.flutterThrowErrorFromVoid(pigeonInstance: pigeonInstance) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoBool( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool, - completion: @escaping (Result) -> Void - ) { - pigeonApi.flutterEchoBool(pigeonInstance: pigeonInstance, aBool: aBool) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoInt( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64, - completion: @escaping (Result) -> Void - ) { - pigeonApi.flutterEchoInt(pigeonInstance: pigeonInstance, anInt: anInt) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoDouble( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aDouble: Double, - completion: @escaping (Result) -> Void - ) { - pigeonApi.flutterEchoDouble(pigeonInstance: pigeonInstance, aDouble: aDouble) { - response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoString( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aString: String, - completion: @escaping (Result) -> Void - ) { - pigeonApi.flutterEchoString(pigeonInstance: pigeonInstance, aString: aString) { - response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoUint8List( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aUint8List: FlutterStandardTypedData, - completion: @escaping (Result) -> Void - ) { - pigeonApi.flutterEchoUint8List(pigeonInstance: pigeonInstance, aList: aUint8List) { - response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoList( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?], - completion: @escaping (Result<[Any?], Error>) -> Void - ) { - pigeonApi.flutterEchoList(pigeonInstance: pigeonInstance, aList: aList) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoProxyApiList( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aList: [ProxyApiTestClass?], - completion: @escaping (Result<[ProxyApiTestClass?], Error>) -> Void - ) { - pigeonApi.flutterEchoProxyApiList(pigeonInstance: pigeonInstance, aList: aList) { - response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoMap( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void - ) { - pigeonApi.flutterEchoMap(pigeonInstance: pigeonInstance, aMap: aMap) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoProxyApiMap( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aMap: [String?: ProxyApiTestClass?], - completion: @escaping (Result<[String?: ProxyApiTestClass?], Error>) -> Void - ) { - pigeonApi.flutterEchoProxyApiMap(pigeonInstance: pigeonInstance, aMap: aMap) { - response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoEnum( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum, - completion: @escaping (Result) -> Void - ) { - pigeonApi.flutterEchoEnum(pigeonInstance: pigeonInstance, anEnum: anEnum) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoProxyApi( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aProxyApi: ProxyApiSuperClass, - completion: @escaping (Result) -> Void - ) { - pigeonApi.flutterEchoProxyApi(pigeonInstance: pigeonInstance, aProxyApi: aProxyApi) { - response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullableBool( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool?, - completion: @escaping (Result) -> Void - ) { - pigeonApi.flutterEchoNullableBool(pigeonInstance: pigeonInstance, aBool: aBool) { - response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullableInt( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64?, - completion: @escaping (Result) -> Void - ) { - pigeonApi.flutterEchoNullableInt(pigeonInstance: pigeonInstance, anInt: anInt) { - response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullableDouble( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aDouble: Double?, - completion: @escaping (Result) -> Void - ) { - pigeonApi.flutterEchoNullableDouble(pigeonInstance: pigeonInstance, aDouble: aDouble) { - response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullableString( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aString: String?, - completion: @escaping (Result) -> Void - ) { - pigeonApi.flutterEchoNullableString(pigeonInstance: pigeonInstance, aString: aString) { - response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullableUint8List( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aUint8List: FlutterStandardTypedData?, - completion: @escaping (Result) -> Void - ) { - pigeonApi.flutterEchoNullableUint8List( - pigeonInstance: pigeonInstance, aList: aUint8List - ) { - response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullableList( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aList: [Any?]?, - completion: @escaping (Result<[Any?]?, Error>) -> Void - ) { - pigeonApi.flutterEchoNullableList(pigeonInstance: pigeonInstance, aList: aList) { - response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullableMap( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void - ) { - pigeonApi.flutterEchoNullableMap(pigeonInstance: pigeonInstance, aMap: aMap) { - response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullableEnum( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum?, - completion: @escaping (Result) -> Void - ) { - pigeonApi.flutterEchoNullableEnum(pigeonInstance: pigeonInstance, anEnum: anEnum) { - response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoNullableProxyApi( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aProxyApi: ProxyApiSuperClass?, - completion: @escaping (Result) -> Void - ) { - pigeonApi.flutterEchoNullableProxyApi( - pigeonInstance: pigeonInstance, aProxyApi: aProxyApi - ) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterNoopAsync( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - completion: @escaping (Result) -> Void - ) { - pigeonApi.flutterNoopAsync(pigeonInstance: pigeonInstance) { response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - func callFlutterEchoAsyncString( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aString: String, - completion: @escaping (Result) -> Void - ) { - pigeonApi.flutterEchoAsyncString(pigeonInstance: pigeonInstance, aString: aString) { - response in - switch response { - case .success(let res): - completion(.success(res)) - case .failure(let error): - completion(.failure(error)) - } - } - } - - } - return PigeonApiProxyApiTestClass( - pigeonRegistrar: registrar, delegate: ProxyApiTestClassDelegate()) - } - - func pigeonApiProxyApiSuperClass(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) - -> PigeonApiProxyApiSuperClass - { - class ProxyApiSuperClassDelegate: PigeonApiDelegateProxyApiSuperClass { - func pigeonDefaultConstructor(pigeonApi: PigeonApiProxyApiSuperClass) throws - -> ProxyApiSuperClass - { - return ProxyApiSuperClass() - } - - func aSuperMethod( - pigeonApi: PigeonApiProxyApiSuperClass, pigeonInstance: ProxyApiSuperClass - ) - throws - {} - } - return PigeonApiProxyApiSuperClass( - pigeonRegistrar: registrar, delegate: ProxyApiSuperClassDelegate()) - } - - func pigeonApiClassWithApiRequirement(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) - -> PigeonApiClassWithApiRequirement - { - class ClassWithApiRequirementDelegate: PigeonApiDelegateClassWithApiRequirement { - @available(iOS 15, *) - func pigeonDefaultConstructor(pigeonApi: PigeonApiClassWithApiRequirement) throws - -> ClassWithApiRequirement - { - return ClassWithApiRequirement() - } - - @available(iOS 15, *) - func aMethod( - pigeonApi: PigeonApiClassWithApiRequirement, pigeonInstance: ClassWithApiRequirement - ) throws { - - } - } - - return PigeonApiClassWithApiRequirement( - pigeonRegistrar: registrar, delegate: ClassWithApiRequirementDelegate()) - } -} diff --git a/packages/pigeon/platform_tests/test_plugin/macos/Classes/.gitignore b/packages/pigeon/platform_tests/test_plugin/macos/Classes/.gitignore deleted file mode 100644 index cd69c2f5c29..00000000000 --- a/packages/pigeon/platform_tests/test_plugin/macos/Classes/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -# TODO(stuartmorgan): Remove this, so that review will show the effects of -# changes on generated files. This will need a way to avoid unnecessary churn, -# such as a flag to suppress version stamp generation. -*.gen.swift -!CoreTests.gen.swift -# Keeping this makes it easier to review changes to ProxyApi generation. -!ProxyApiTests.gen.swift -# Including these makes it easier to review code generation changes. -!ProxyApiTestClass.swift -!EventChannelTests.gen.swift \ No newline at end of file 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 deleted file mode 100644 index 8b1bb6c3627..00000000000 --- a/packages/pigeon/platform_tests/test_plugin/macos/Classes/CoreTests.gen.swift +++ /dev/null @@ -1,6011 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// -// Autogenerated from Pigeon, do not edit directly. -// See also: https://pub.dev/packages/pigeon - -import Foundation - -#if os(iOS) - import Flutter -#elseif os(macOS) - import FlutterMacOS -#else - #error("Unsupported platform.") -#endif - -/// Error class for passing custom error details to Dart side. -final class PigeonError: Error { - let code: String - let message: String? - let details: Sendable? - - init(code: String, message: String?, details: Sendable?) { - self.code = code - self.message = message - self.details = details - } - - var localizedDescription: String { - return - "PigeonError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" - } -} - -private func wrapResult(_ result: Any?) -> [Any?] { - return [result] -} - -private func wrapError(_ error: Any) -> [Any?] { - if let pigeonError = error as? PigeonError { - return [ - pigeonError.code, - pigeonError.message, - pigeonError.details, - ] - } - if let flutterError = error as? FlutterError { - return [ - flutterError.code, - flutterError.message, - flutterError.details, - ] - } - return [ - "\(error)", - "\(type(of: error))", - "Stacktrace: \(Thread.callStackSymbols)", - ] -} - -private func createConnectionError(withChannelName channelName: String) -> PigeonError { - return PigeonError( - code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", - details: "") -} - -private func isNullish(_ value: Any?) -> Bool { - return value is NSNull || value == nil -} - -private func nilOrValue(_ value: Any?) -> T? { - if value is NSNull { return nil } - return value as! T? -} - -func deepEqualsCoreTests(_ lhs: Any?, _ rhs: Any?) -> Bool { - let cleanLhs = nilOrValue(lhs) as Any? - let cleanRhs = nilOrValue(rhs) as Any? - switch (cleanLhs, cleanRhs) { - case (nil, nil): - return true - - case (nil, _), (_, nil): - return false - - case is (Void, Void): - return true - - case let (cleanLhsHashable, cleanRhsHashable) as (AnyHashable, AnyHashable): - return cleanLhsHashable == cleanRhsHashable - - case let (cleanLhsArray, cleanRhsArray) as ([Any?], [Any?]): - guard cleanLhsArray.count == cleanRhsArray.count else { return false } - for (index, element) in cleanLhsArray.enumerated() { - if !deepEqualsCoreTests(element, cleanRhsArray[index]) { - return false - } - } - return true - - case let (cleanLhsDictionary, cleanRhsDictionary) as ([AnyHashable: Any?], [AnyHashable: Any?]): - guard cleanLhsDictionary.count == cleanRhsDictionary.count else { return false } - for (key, cleanLhsValue) in cleanLhsDictionary { - guard cleanRhsDictionary.index(forKey: key) != nil else { return false } - if !deepEqualsCoreTests(cleanLhsValue, cleanRhsDictionary[key]!) { - return false - } - } - return true - - default: - // Any other type shouldn't be able to be used with pigeon. File an issue if you find this to be untrue. - return false - } -} - -func deepHashCoreTests(value: Any?, hasher: inout Hasher) { - if let valueList = value as? [AnyHashable] { - for item in valueList { deepHashCoreTests(value: item, hasher: &hasher) } - return - } - - if let valueDict = value as? [AnyHashable: AnyHashable] { - for key in valueDict.keys { - hasher.combine(key) - deepHashCoreTests(value: valueDict[key]!, hasher: &hasher) - } - return - } - - if let hashableValue = value as? AnyHashable { - hasher.combine(hashableValue.hashValue) - } - - return hasher.combine(String(describing: value)) -} - -enum AnEnum: Int { - case one = 0 - case two = 1 - case three = 2 - case fortyTwo = 3 - case fourHundredTwentyTwo = 4 -} - -enum AnotherEnum: Int { - case justInCase = 0 -} - -/// Generated class from Pigeon that represents data sent in messages. -struct UnusedClass: Hashable { - var aField: Any? = nil - - // swift-format-ignore: AlwaysUseLowerCamelCase - static func fromList(_ pigeonVar_list: [Any?]) -> UnusedClass? { - let aField: Any? = pigeonVar_list[0] - - return UnusedClass( - aField: aField - ) - } - func toList() -> [Any?] { - return [ - aField - ] - } - static func == (lhs: UnusedClass, rhs: UnusedClass) -> Bool { - return deepEqualsCoreTests(lhs.toList(), rhs.toList()) - } - func hash(into hasher: inout Hasher) { - deepHashCoreTests(value: toList(), hasher: &hasher) - } -} - -/// A class containing all supported types. -/// -/// Generated class from Pigeon that represents data sent in messages. -struct AllTypes: Hashable { - var aBool: Bool - var anInt: Int64 - var anInt64: Int64 - var aDouble: Double - var aByteArray: FlutterStandardTypedData - var a4ByteArray: FlutterStandardTypedData - var a8ByteArray: FlutterStandardTypedData - var aFloatArray: FlutterStandardTypedData - var anEnum: AnEnum - var anotherEnum: AnotherEnum - var aString: String - var anObject: Any - var list: [Any?] - var stringList: [String] - var intList: [Int64] - var doubleList: [Double] - var boolList: [Bool] - var enumList: [AnEnum] - var objectList: [Any] - var listList: [[Any?]] - var mapList: [[AnyHashable?: Any?]] - var map: [AnyHashable?: Any?] - var stringMap: [String: String] - var intMap: [Int64: Int64] - var enumMap: [AnEnum: AnEnum] - var objectMap: [AnyHashable: Any] - var listMap: [Int64: [Any?]] - var mapMap: [Int64: [AnyHashable?: Any?]] - - // swift-format-ignore: AlwaysUseLowerCamelCase - static func fromList(_ pigeonVar_list: [Any?]) -> AllTypes? { - let aBool = pigeonVar_list[0] as! Bool - let anInt = pigeonVar_list[1] as! Int64 - let anInt64 = pigeonVar_list[2] as! Int64 - let aDouble = pigeonVar_list[3] as! Double - let aByteArray = pigeonVar_list[4] as! FlutterStandardTypedData - let a4ByteArray = pigeonVar_list[5] as! FlutterStandardTypedData - let a8ByteArray = pigeonVar_list[6] as! FlutterStandardTypedData - let aFloatArray = pigeonVar_list[7] as! FlutterStandardTypedData - let anEnum = pigeonVar_list[8] as! AnEnum - let anotherEnum = pigeonVar_list[9] as! AnotherEnum - let aString = pigeonVar_list[10] as! String - let anObject = pigeonVar_list[11]! - let list = pigeonVar_list[12] as! [Any?] - let stringList = pigeonVar_list[13] as! [String] - let intList = pigeonVar_list[14] as! [Int64] - let doubleList = pigeonVar_list[15] as! [Double] - let boolList = pigeonVar_list[16] as! [Bool] - let enumList = pigeonVar_list[17] as! [AnEnum] - let objectList = pigeonVar_list[18] as! [Any] - let listList = pigeonVar_list[19] as! [[Any?]] - let mapList = pigeonVar_list[20] as! [[AnyHashable?: Any?]] - let map = pigeonVar_list[21] as! [AnyHashable?: Any?] - let stringMap = pigeonVar_list[22] as! [String: String] - let intMap = pigeonVar_list[23] as! [Int64: Int64] - let enumMap = pigeonVar_list[24] as? [AnEnum: AnEnum] - let objectMap = pigeonVar_list[25] as! [AnyHashable: Any] - let listMap = pigeonVar_list[26] as! [Int64: [Any?]] - let mapMap = pigeonVar_list[27] as! [Int64: [AnyHashable?: Any?]] - - return AllTypes( - aBool: aBool, - anInt: anInt, - anInt64: anInt64, - aDouble: aDouble, - aByteArray: aByteArray, - a4ByteArray: a4ByteArray, - a8ByteArray: a8ByteArray, - aFloatArray: aFloatArray, - anEnum: anEnum, - anotherEnum: anotherEnum, - aString: aString, - anObject: anObject, - list: list, - stringList: stringList, - intList: intList, - doubleList: doubleList, - boolList: boolList, - enumList: enumList, - objectList: objectList, - listList: listList, - mapList: mapList, - map: map, - stringMap: stringMap, - intMap: intMap, - enumMap: enumMap!, - objectMap: objectMap, - listMap: listMap, - mapMap: mapMap - ) - } - func toList() -> [Any?] { - return [ - aBool, - anInt, - anInt64, - aDouble, - aByteArray, - a4ByteArray, - a8ByteArray, - aFloatArray, - anEnum, - anotherEnum, - aString, - anObject, - list, - stringList, - intList, - doubleList, - boolList, - enumList, - objectList, - listList, - mapList, - map, - stringMap, - intMap, - enumMap, - objectMap, - listMap, - mapMap, - ] - } - static func == (lhs: AllTypes, rhs: AllTypes) -> Bool { - return deepEqualsCoreTests(lhs.toList(), rhs.toList()) - } - func hash(into hasher: inout Hasher) { - deepHashCoreTests(value: toList(), hasher: &hasher) - } -} - -/// A class containing all supported nullable types. -/// -/// Generated class from Pigeon that represents data sent in messages. -class AllNullableTypes: Hashable { - init( - aNullableBool: Bool? = nil, - aNullableInt: Int64? = nil, - aNullableInt64: Int64? = nil, - aNullableDouble: Double? = nil, - aNullableByteArray: FlutterStandardTypedData? = nil, - aNullable4ByteArray: FlutterStandardTypedData? = nil, - aNullable8ByteArray: FlutterStandardTypedData? = nil, - aNullableFloatArray: FlutterStandardTypedData? = nil, - aNullableEnum: AnEnum? = nil, - anotherNullableEnum: AnotherEnum? = nil, - aNullableString: String? = nil, - aNullableObject: Any? = nil, - allNullableTypes: AllNullableTypes? = nil, - list: [Any?]? = nil, - stringList: [String?]? = nil, - intList: [Int64?]? = nil, - doubleList: [Double?]? = nil, - boolList: [Bool?]? = nil, - enumList: [AnEnum?]? = nil, - objectList: [Any?]? = nil, - listList: [[Any?]?]? = nil, - mapList: [[AnyHashable?: Any?]?]? = nil, - recursiveClassList: [AllNullableTypes?]? = nil, - map: [AnyHashable?: Any?]? = nil, - stringMap: [String?: String?]? = nil, - intMap: [Int64?: Int64?]? = nil, - enumMap: [AnEnum?: AnEnum?]? = nil, - objectMap: [AnyHashable?: Any?]? = nil, - listMap: [Int64?: [Any?]?]? = nil, - mapMap: [Int64?: [AnyHashable?: Any?]?]? = nil, - recursiveClassMap: [Int64?: AllNullableTypes?]? = nil - ) { - self.aNullableBool = aNullableBool - self.aNullableInt = aNullableInt - self.aNullableInt64 = aNullableInt64 - self.aNullableDouble = aNullableDouble - self.aNullableByteArray = aNullableByteArray - self.aNullable4ByteArray = aNullable4ByteArray - self.aNullable8ByteArray = aNullable8ByteArray - self.aNullableFloatArray = aNullableFloatArray - self.aNullableEnum = aNullableEnum - self.anotherNullableEnum = anotherNullableEnum - self.aNullableString = aNullableString - self.aNullableObject = aNullableObject - self.allNullableTypes = allNullableTypes - self.list = list - self.stringList = stringList - self.intList = intList - self.doubleList = doubleList - self.boolList = boolList - self.enumList = enumList - self.objectList = objectList - self.listList = listList - self.mapList = mapList - self.recursiveClassList = recursiveClassList - self.map = map - self.stringMap = stringMap - self.intMap = intMap - self.enumMap = enumMap - self.objectMap = objectMap - self.listMap = listMap - self.mapMap = mapMap - self.recursiveClassMap = recursiveClassMap - } - var aNullableBool: Bool? - var aNullableInt: Int64? - var aNullableInt64: Int64? - var aNullableDouble: Double? - var aNullableByteArray: FlutterStandardTypedData? - var aNullable4ByteArray: FlutterStandardTypedData? - var aNullable8ByteArray: FlutterStandardTypedData? - var aNullableFloatArray: FlutterStandardTypedData? - var aNullableEnum: AnEnum? - var anotherNullableEnum: AnotherEnum? - var aNullableString: String? - var aNullableObject: Any? - var allNullableTypes: AllNullableTypes? - var list: [Any?]? - var stringList: [String?]? - var intList: [Int64?]? - var doubleList: [Double?]? - var boolList: [Bool?]? - var enumList: [AnEnum?]? - var objectList: [Any?]? - var listList: [[Any?]?]? - var mapList: [[AnyHashable?: Any?]?]? - var recursiveClassList: [AllNullableTypes?]? - var map: [AnyHashable?: Any?]? - var stringMap: [String?: String?]? - var intMap: [Int64?: Int64?]? - var enumMap: [AnEnum?: AnEnum?]? - var objectMap: [AnyHashable?: Any?]? - var listMap: [Int64?: [Any?]?]? - var mapMap: [Int64?: [AnyHashable?: Any?]?]? - var recursiveClassMap: [Int64?: AllNullableTypes?]? - - // swift-format-ignore: AlwaysUseLowerCamelCase - static func fromList(_ pigeonVar_list: [Any?]) -> AllNullableTypes? { - let aNullableBool: Bool? = nilOrValue(pigeonVar_list[0]) - let aNullableInt: Int64? = nilOrValue(pigeonVar_list[1]) - let aNullableInt64: Int64? = nilOrValue(pigeonVar_list[2]) - let aNullableDouble: Double? = nilOrValue(pigeonVar_list[3]) - let aNullableByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[4]) - let aNullable4ByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[5]) - let aNullable8ByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[6]) - let aNullableFloatArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[7]) - let aNullableEnum: AnEnum? = nilOrValue(pigeonVar_list[8]) - let anotherNullableEnum: AnotherEnum? = nilOrValue(pigeonVar_list[9]) - let aNullableString: String? = nilOrValue(pigeonVar_list[10]) - let aNullableObject: Any? = pigeonVar_list[11] - let allNullableTypes: AllNullableTypes? = nilOrValue(pigeonVar_list[12]) - let list: [Any?]? = nilOrValue(pigeonVar_list[13]) - let stringList: [String?]? = nilOrValue(pigeonVar_list[14]) - let intList: [Int64?]? = nilOrValue(pigeonVar_list[15]) - let doubleList: [Double?]? = nilOrValue(pigeonVar_list[16]) - let boolList: [Bool?]? = nilOrValue(pigeonVar_list[17]) - let enumList: [AnEnum?]? = nilOrValue(pigeonVar_list[18]) - let objectList: [Any?]? = nilOrValue(pigeonVar_list[19]) - let listList: [[Any?]?]? = nilOrValue(pigeonVar_list[20]) - let mapList: [[AnyHashable?: Any?]?]? = nilOrValue(pigeonVar_list[21]) - let recursiveClassList: [AllNullableTypes?]? = nilOrValue(pigeonVar_list[22]) - let map: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[23]) - let stringMap: [String?: String?]? = nilOrValue(pigeonVar_list[24]) - let intMap: [Int64?: Int64?]? = nilOrValue(pigeonVar_list[25]) - let enumMap: [AnEnum?: AnEnum?]? = pigeonVar_list[26] as? [AnEnum?: AnEnum?] - let objectMap: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[27]) - let listMap: [Int64?: [Any?]?]? = nilOrValue(pigeonVar_list[28]) - let mapMap: [Int64?: [AnyHashable?: Any?]?]? = nilOrValue(pigeonVar_list[29]) - let recursiveClassMap: [Int64?: AllNullableTypes?]? = nilOrValue(pigeonVar_list[30]) - - return AllNullableTypes( - aNullableBool: aNullableBool, - aNullableInt: aNullableInt, - aNullableInt64: aNullableInt64, - aNullableDouble: aNullableDouble, - aNullableByteArray: aNullableByteArray, - aNullable4ByteArray: aNullable4ByteArray, - aNullable8ByteArray: aNullable8ByteArray, - aNullableFloatArray: aNullableFloatArray, - aNullableEnum: aNullableEnum, - anotherNullableEnum: anotherNullableEnum, - aNullableString: aNullableString, - aNullableObject: aNullableObject, - allNullableTypes: allNullableTypes, - list: list, - stringList: stringList, - intList: intList, - doubleList: doubleList, - boolList: boolList, - enumList: enumList, - objectList: objectList, - listList: listList, - mapList: mapList, - recursiveClassList: recursiveClassList, - map: map, - stringMap: stringMap, - intMap: intMap, - enumMap: enumMap, - objectMap: objectMap, - listMap: listMap, - mapMap: mapMap, - recursiveClassMap: recursiveClassMap - ) - } - func toList() -> [Any?] { - return [ - aNullableBool, - aNullableInt, - aNullableInt64, - aNullableDouble, - aNullableByteArray, - aNullable4ByteArray, - aNullable8ByteArray, - aNullableFloatArray, - aNullableEnum, - anotherNullableEnum, - aNullableString, - aNullableObject, - allNullableTypes, - list, - stringList, - intList, - doubleList, - boolList, - enumList, - objectList, - listList, - mapList, - recursiveClassList, - map, - stringMap, - intMap, - enumMap, - objectMap, - listMap, - mapMap, - recursiveClassMap, - ] - } - static func == (lhs: AllNullableTypes, rhs: AllNullableTypes) -> Bool { - if lhs === rhs { - return true - } - return deepEqualsCoreTests(lhs.toList(), rhs.toList()) - } - func hash(into hasher: inout Hasher) { - deepHashCoreTests(value: toList(), hasher: &hasher) - } -} - -/// The primary purpose for this class is to ensure coverage of Swift structs -/// with nullable items, as the primary [AllNullableTypes] class is being used to -/// test Swift classes. -/// -/// Generated class from Pigeon that represents data sent in messages. -struct AllNullableTypesWithoutRecursion: Hashable { - var aNullableBool: Bool? = nil - var aNullableInt: Int64? = nil - var aNullableInt64: Int64? = nil - var aNullableDouble: Double? = nil - var aNullableByteArray: FlutterStandardTypedData? = nil - var aNullable4ByteArray: FlutterStandardTypedData? = nil - var aNullable8ByteArray: FlutterStandardTypedData? = nil - var aNullableFloatArray: FlutterStandardTypedData? = nil - var aNullableEnum: AnEnum? = nil - var anotherNullableEnum: AnotherEnum? = nil - var aNullableString: String? = nil - var aNullableObject: Any? = nil - var list: [Any?]? = nil - var stringList: [String?]? = nil - var intList: [Int64?]? = nil - var doubleList: [Double?]? = nil - var boolList: [Bool?]? = nil - var enumList: [AnEnum?]? = nil - var objectList: [Any?]? = nil - var listList: [[Any?]?]? = nil - var mapList: [[AnyHashable?: Any?]?]? = nil - var map: [AnyHashable?: Any?]? = nil - var stringMap: [String?: String?]? = nil - var intMap: [Int64?: Int64?]? = nil - var enumMap: [AnEnum?: AnEnum?]? = nil - var objectMap: [AnyHashable?: Any?]? = nil - var listMap: [Int64?: [Any?]?]? = nil - var mapMap: [Int64?: [AnyHashable?: Any?]?]? = nil - - // swift-format-ignore: AlwaysUseLowerCamelCase - static func fromList(_ pigeonVar_list: [Any?]) -> AllNullableTypesWithoutRecursion? { - let aNullableBool: Bool? = nilOrValue(pigeonVar_list[0]) - let aNullableInt: Int64? = nilOrValue(pigeonVar_list[1]) - let aNullableInt64: Int64? = nilOrValue(pigeonVar_list[2]) - let aNullableDouble: Double? = nilOrValue(pigeonVar_list[3]) - let aNullableByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[4]) - let aNullable4ByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[5]) - let aNullable8ByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[6]) - let aNullableFloatArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[7]) - let aNullableEnum: AnEnum? = nilOrValue(pigeonVar_list[8]) - let anotherNullableEnum: AnotherEnum? = nilOrValue(pigeonVar_list[9]) - let aNullableString: String? = nilOrValue(pigeonVar_list[10]) - let aNullableObject: Any? = pigeonVar_list[11] - let list: [Any?]? = nilOrValue(pigeonVar_list[12]) - let stringList: [String?]? = nilOrValue(pigeonVar_list[13]) - let intList: [Int64?]? = nilOrValue(pigeonVar_list[14]) - let doubleList: [Double?]? = nilOrValue(pigeonVar_list[15]) - let boolList: [Bool?]? = nilOrValue(pigeonVar_list[16]) - let enumList: [AnEnum?]? = nilOrValue(pigeonVar_list[17]) - let objectList: [Any?]? = nilOrValue(pigeonVar_list[18]) - let listList: [[Any?]?]? = nilOrValue(pigeonVar_list[19]) - let mapList: [[AnyHashable?: Any?]?]? = nilOrValue(pigeonVar_list[20]) - let map: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[21]) - let stringMap: [String?: String?]? = nilOrValue(pigeonVar_list[22]) - let intMap: [Int64?: Int64?]? = nilOrValue(pigeonVar_list[23]) - let enumMap: [AnEnum?: AnEnum?]? = pigeonVar_list[24] as? [AnEnum?: AnEnum?] - let objectMap: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[25]) - let listMap: [Int64?: [Any?]?]? = nilOrValue(pigeonVar_list[26]) - let mapMap: [Int64?: [AnyHashable?: Any?]?]? = nilOrValue(pigeonVar_list[27]) - - return AllNullableTypesWithoutRecursion( - aNullableBool: aNullableBool, - aNullableInt: aNullableInt, - aNullableInt64: aNullableInt64, - aNullableDouble: aNullableDouble, - aNullableByteArray: aNullableByteArray, - aNullable4ByteArray: aNullable4ByteArray, - aNullable8ByteArray: aNullable8ByteArray, - aNullableFloatArray: aNullableFloatArray, - aNullableEnum: aNullableEnum, - anotherNullableEnum: anotherNullableEnum, - aNullableString: aNullableString, - aNullableObject: aNullableObject, - list: list, - stringList: stringList, - intList: intList, - doubleList: doubleList, - boolList: boolList, - enumList: enumList, - objectList: objectList, - listList: listList, - mapList: mapList, - map: map, - stringMap: stringMap, - intMap: intMap, - enumMap: enumMap, - objectMap: objectMap, - listMap: listMap, - mapMap: mapMap - ) - } - func toList() -> [Any?] { - return [ - aNullableBool, - aNullableInt, - aNullableInt64, - aNullableDouble, - aNullableByteArray, - aNullable4ByteArray, - aNullable8ByteArray, - aNullableFloatArray, - aNullableEnum, - anotherNullableEnum, - aNullableString, - aNullableObject, - list, - stringList, - intList, - doubleList, - boolList, - enumList, - objectList, - listList, - mapList, - map, - stringMap, - intMap, - enumMap, - objectMap, - listMap, - mapMap, - ] - } - static func == (lhs: AllNullableTypesWithoutRecursion, rhs: AllNullableTypesWithoutRecursion) - -> Bool - { - return deepEqualsCoreTests(lhs.toList(), rhs.toList()) - } - func hash(into hasher: inout Hasher) { - deepHashCoreTests(value: toList(), hasher: &hasher) - } -} - -/// A class for testing nested class handling. -/// -/// This is needed to test nested nullable and non-nullable classes, -/// `AllNullableTypes` is non-nullable here as it is easier to instantiate -/// than `AllTypes` when testing doesn't require both (ie. testing null classes). -/// -/// Generated class from Pigeon that represents data sent in messages. -struct AllClassesWrapper: Hashable { - var allNullableTypes: AllNullableTypes - var allNullableTypesWithoutRecursion: AllNullableTypesWithoutRecursion? = nil - var allTypes: AllTypes? = nil - var classList: [AllTypes?] - var nullableClassList: [AllNullableTypesWithoutRecursion?]? = nil - var classMap: [Int64?: AllTypes?] - var nullableClassMap: [Int64?: AllNullableTypesWithoutRecursion?]? = nil - - // swift-format-ignore: AlwaysUseLowerCamelCase - static func fromList(_ pigeonVar_list: [Any?]) -> AllClassesWrapper? { - let allNullableTypes = pigeonVar_list[0] as! AllNullableTypes - let allNullableTypesWithoutRecursion: AllNullableTypesWithoutRecursion? = nilOrValue( - pigeonVar_list[1]) - let allTypes: AllTypes? = nilOrValue(pigeonVar_list[2]) - let classList = pigeonVar_list[3] as! [AllTypes?] - let nullableClassList: [AllNullableTypesWithoutRecursion?]? = nilOrValue(pigeonVar_list[4]) - let classMap = pigeonVar_list[5] as! [Int64?: AllTypes?] - let nullableClassMap: [Int64?: AllNullableTypesWithoutRecursion?]? = nilOrValue( - pigeonVar_list[6]) - - return AllClassesWrapper( - allNullableTypes: allNullableTypes, - allNullableTypesWithoutRecursion: allNullableTypesWithoutRecursion, - allTypes: allTypes, - classList: classList, - nullableClassList: nullableClassList, - classMap: classMap, - nullableClassMap: nullableClassMap - ) - } - func toList() -> [Any?] { - return [ - allNullableTypes, - allNullableTypesWithoutRecursion, - allTypes, - classList, - nullableClassList, - classMap, - nullableClassMap, - ] - } - static func == (lhs: AllClassesWrapper, rhs: AllClassesWrapper) -> Bool { - return deepEqualsCoreTests(lhs.toList(), rhs.toList()) - } - func hash(into hasher: inout Hasher) { - deepHashCoreTests(value: toList(), hasher: &hasher) - } -} - -/// A data class containing a List, used in unit tests. -/// -/// Generated class from Pigeon that represents data sent in messages. -struct TestMessage: Hashable { - var testList: [Any?]? = nil - - // swift-format-ignore: AlwaysUseLowerCamelCase - static func fromList(_ pigeonVar_list: [Any?]) -> TestMessage? { - let testList: [Any?]? = nilOrValue(pigeonVar_list[0]) - - return TestMessage( - testList: testList - ) - } - func toList() -> [Any?] { - return [ - testList - ] - } - static func == (lhs: TestMessage, rhs: TestMessage) -> Bool { - return deepEqualsCoreTests(lhs.toList(), rhs.toList()) - } - func hash(into hasher: inout Hasher) { - deepHashCoreTests(value: toList(), hasher: &hasher) - } -} - -private class CoreTestsPigeonCodecReader: FlutterStandardReader { - override func readValue(ofType type: UInt8) -> Any? { - switch type { - case 129: - let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) - if let enumResultAsInt = enumResultAsInt { - return AnEnum(rawValue: enumResultAsInt) - } - return nil - case 130: - let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) - if let enumResultAsInt = enumResultAsInt { - return AnotherEnum(rawValue: enumResultAsInt) - } - return nil - case 131: - return UnusedClass.fromList(self.readValue() as! [Any?]) - case 132: - return AllTypes.fromList(self.readValue() as! [Any?]) - case 133: - return AllNullableTypes.fromList(self.readValue() as! [Any?]) - case 134: - return AllNullableTypesWithoutRecursion.fromList(self.readValue() as! [Any?]) - case 135: - return AllClassesWrapper.fromList(self.readValue() as! [Any?]) - case 136: - return TestMessage.fromList(self.readValue() as! [Any?]) - default: - return super.readValue(ofType: type) - } - } -} - -private class CoreTestsPigeonCodecWriter: FlutterStandardWriter { - override func writeValue(_ value: Any) { - if let value = value as? AnEnum { - super.writeByte(129) - super.writeValue(value.rawValue) - } else if let value = value as? AnotherEnum { - super.writeByte(130) - super.writeValue(value.rawValue) - } else if let value = value as? UnusedClass { - super.writeByte(131) - super.writeValue(value.toList()) - } else if let value = value as? AllTypes { - super.writeByte(132) - super.writeValue(value.toList()) - } else if let value = value as? AllNullableTypes { - super.writeByte(133) - super.writeValue(value.toList()) - } else if let value = value as? AllNullableTypesWithoutRecursion { - super.writeByte(134) - super.writeValue(value.toList()) - } else if let value = value as? AllClassesWrapper { - super.writeByte(135) - super.writeValue(value.toList()) - } else if let value = value as? TestMessage { - super.writeByte(136) - super.writeValue(value.toList()) - } else { - super.writeValue(value) - } - } -} - -private class CoreTestsPigeonCodecReaderWriter: FlutterStandardReaderWriter { - override func reader(with data: Data) -> FlutterStandardReader { - return CoreTestsPigeonCodecReader(data: data) - } - - override func writer(with data: NSMutableData) -> FlutterStandardWriter { - return CoreTestsPigeonCodecWriter(data: data) - } -} - -class CoreTestsPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable { - static let shared = CoreTestsPigeonCodec(readerWriter: CoreTestsPigeonCodecReaderWriter()) -} - -/// The core interface that each host language plugin must implement in -/// platform_test integration tests. -/// -/// Generated protocol from Pigeon that represents a handler of messages from Flutter. -protocol HostIntegrationCoreApi { - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic calling. - func noop() throws - /// Returns the passed object, to test serialization and deserialization. - func echo(_ everything: AllTypes) throws -> AllTypes - /// Returns an error, to test error handling. - func throwError() throws -> Any? - /// Returns an error from a void function, to test error handling. - func throwErrorFromVoid() throws - /// Returns a Flutter error, to test error handling. - func throwFlutterError() throws -> Any? - /// Returns passed in int. - func echo(_ anInt: Int64) throws -> Int64 - /// Returns passed in double. - func echo(_ aDouble: Double) throws -> Double - /// Returns the passed in boolean. - func echo(_ aBool: Bool) throws -> Bool - /// Returns the passed in string. - func echo(_ aString: String) throws -> String - /// Returns the passed in Uint8List. - func echo(_ aUint8List: FlutterStandardTypedData) throws -> FlutterStandardTypedData - /// Returns the passed in generic Object. - func echo(_ anObject: Any) throws -> Any - /// Returns the passed list, to test serialization and deserialization. - func echo(_ list: [Any?]) throws -> [Any?] - /// Returns the passed list, to test serialization and deserialization. - func echo(enumList: [AnEnum?]) throws -> [AnEnum?] - /// Returns the passed list, to test serialization and deserialization. - func echo(classList: [AllNullableTypes?]) throws -> [AllNullableTypes?] - /// Returns the passed list, to test serialization and deserialization. - func echoNonNull(enumList: [AnEnum]) throws -> [AnEnum] - /// Returns the passed list, to test serialization and deserialization. - func echoNonNull(classList: [AllNullableTypes]) throws -> [AllNullableTypes] - /// Returns the passed map, to test serialization and deserialization. - func echo(_ map: [AnyHashable?: Any?]) throws -> [AnyHashable?: Any?] - /// Returns the passed map, to test serialization and deserialization. - func echo(stringMap: [String?: String?]) throws -> [String?: String?] - /// Returns the passed map, to test serialization and deserialization. - func echo(intMap: [Int64?: Int64?]) throws -> [Int64?: Int64?] - /// Returns the passed map, to test serialization and deserialization. - func echo(enumMap: [AnEnum?: AnEnum?]) throws -> [AnEnum?: AnEnum?] - /// Returns the passed map, to test serialization and deserialization. - func echo(classMap: [Int64?: AllNullableTypes?]) throws -> [Int64?: AllNullableTypes?] - /// Returns the passed map, to test serialization and deserialization. - func echoNonNull(stringMap: [String: String]) throws -> [String: String] - /// Returns the passed map, to test serialization and deserialization. - func echoNonNull(intMap: [Int64: Int64]) throws -> [Int64: Int64] - /// Returns the passed map, to test serialization and deserialization. - func echoNonNull(enumMap: [AnEnum: AnEnum]) throws -> [AnEnum: AnEnum] - /// Returns the passed map, to test serialization and deserialization. - func echoNonNull(classMap: [Int64: AllNullableTypes]) throws -> [Int64: AllNullableTypes] - /// Returns the passed class to test nested class serialization and deserialization. - func echo(_ wrapper: AllClassesWrapper) throws -> AllClassesWrapper - /// Returns the passed enum to test serialization and deserialization. - func echo(_ anEnum: AnEnum) throws -> AnEnum - /// Returns the passed enum to test serialization and deserialization. - func echo(_ anotherEnum: AnotherEnum) throws -> AnotherEnum - /// Returns the default string. - func echoNamedDefault(_ aString: String) throws -> String - /// Returns passed in double. - func echoOptionalDefault(_ aDouble: Double) throws -> Double - /// Returns passed in int. - func echoRequired(_ anInt: Int64) throws -> Int64 - /// Returns the passed object, to test serialization and deserialization. - func echo(_ everything: AllNullableTypes?) throws -> AllNullableTypes? - /// Returns the passed object, to test serialization and deserialization. - func echo(_ everything: AllNullableTypesWithoutRecursion?) throws - -> AllNullableTypesWithoutRecursion? - /// Returns the inner `aString` value from the wrapped object, to test - /// sending of nested objects. - func extractNestedNullableString(from wrapper: AllClassesWrapper) throws -> String? - /// Returns the inner `aString` value from the wrapped object, to test - /// sending of nested objects. - func createNestedObject(with nullableString: String?) throws -> AllClassesWrapper - /// Returns passed in arguments of multiple types. - func sendMultipleNullableTypes( - aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String? - ) throws -> AllNullableTypes - /// Returns passed in arguments of multiple types. - func sendMultipleNullableTypesWithoutRecursion( - aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String? - ) throws -> AllNullableTypesWithoutRecursion - /// Returns passed in int. - func echo(_ aNullableInt: Int64?) throws -> Int64? - /// Returns passed in double. - func echo(_ aNullableDouble: Double?) throws -> Double? - /// Returns the passed in boolean. - func echo(_ aNullableBool: Bool?) throws -> Bool? - /// Returns the passed in string. - func echo(_ aNullableString: String?) throws -> String? - /// Returns the passed in Uint8List. - func echo(_ aNullableUint8List: FlutterStandardTypedData?) throws -> FlutterStandardTypedData? - /// Returns the passed in generic Object. - func echo(_ aNullableObject: Any?) throws -> Any? - /// Returns the passed list, to test serialization and deserialization. - func echoNullable(_ aNullableList: [Any?]?) throws -> [Any?]? - /// Returns the passed list, to test serialization and deserialization. - func echoNullable(enumList: [AnEnum?]?) throws -> [AnEnum?]? - /// Returns the passed list, to test serialization and deserialization. - func echoNullable(classList: [AllNullableTypes?]?) throws -> [AllNullableTypes?]? - /// Returns the passed list, to test serialization and deserialization. - func echoNullableNonNull(enumList: [AnEnum]?) throws -> [AnEnum]? - /// Returns the passed list, to test serialization and deserialization. - func echoNullableNonNull(classList: [AllNullableTypes]?) throws -> [AllNullableTypes]? - /// Returns the passed map, to test serialization and deserialization. - func echoNullable(_ map: [AnyHashable?: Any?]?) throws -> [AnyHashable?: Any?]? - /// Returns the passed map, to test serialization and deserialization. - func echoNullable(stringMap: [String?: String?]?) throws -> [String?: String?]? - /// Returns the passed map, to test serialization and deserialization. - func echoNullable(intMap: [Int64?: Int64?]?) throws -> [Int64?: Int64?]? - /// Returns the passed map, to test serialization and deserialization. - func echoNullable(enumMap: [AnEnum?: AnEnum?]?) throws -> [AnEnum?: AnEnum?]? - /// Returns the passed map, to test serialization and deserialization. - func echoNullable(classMap: [Int64?: AllNullableTypes?]?) throws -> [Int64?: AllNullableTypes?]? - /// Returns the passed map, to test serialization and deserialization. - func echoNullableNonNull(stringMap: [String: String]?) throws -> [String: String]? - /// Returns the passed map, to test serialization and deserialization. - func echoNullableNonNull(intMap: [Int64: Int64]?) throws -> [Int64: Int64]? - /// Returns the passed map, to test serialization and deserialization. - func echoNullableNonNull(enumMap: [AnEnum: AnEnum]?) throws -> [AnEnum: AnEnum]? - /// Returns the passed map, to test serialization and deserialization. - func echoNullableNonNull(classMap: [Int64: AllNullableTypes]?) throws -> [Int64: - AllNullableTypes]? - func echoNullable(_ anEnum: AnEnum?) throws -> AnEnum? - func echoNullable(_ anotherEnum: AnotherEnum?) throws -> AnotherEnum? - /// Returns passed in int. - func echoOptional(_ aNullableInt: Int64?) throws -> Int64? - /// Returns the passed in string. - func echoNamed(_ aNullableString: String?) throws -> String? - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic asynchronous calling. - func noopAsync(completion: @escaping (Result) -> Void) - /// Returns passed in int asynchronously. - func echoAsync(_ anInt: Int64, completion: @escaping (Result) -> Void) - /// Returns passed in double asynchronously. - func echoAsync(_ aDouble: Double, completion: @escaping (Result) -> Void) - /// Returns the passed in boolean asynchronously. - func echoAsync(_ aBool: Bool, completion: @escaping (Result) -> Void) - /// Returns the passed string asynchronously. - func echoAsync(_ aString: String, completion: @escaping (Result) -> Void) - /// Returns the passed in Uint8List asynchronously. - func echoAsync( - _ aUint8List: FlutterStandardTypedData, - completion: @escaping (Result) -> Void) - /// Returns the passed in generic Object asynchronously. - func echoAsync(_ anObject: Any, completion: @escaping (Result) -> Void) - /// Returns the passed list, to test asynchronous serialization and deserialization. - func echoAsync(_ list: [Any?], completion: @escaping (Result<[Any?], Error>) -> Void) - /// Returns the passed list, to test asynchronous serialization and deserialization. - func echoAsync(enumList: [AnEnum?], completion: @escaping (Result<[AnEnum?], Error>) -> Void) - /// Returns the passed list, to test asynchronous serialization and deserialization. - func echoAsync( - classList: [AllNullableTypes?], - completion: @escaping (Result<[AllNullableTypes?], Error>) -> Void) - /// Returns the passed map, to test asynchronous serialization and deserialization. - func echoAsync( - _ map: [AnyHashable?: Any?], completion: @escaping (Result<[AnyHashable?: Any?], Error>) -> Void - ) - /// Returns the passed map, to test asynchronous serialization and deserialization. - func echoAsync( - stringMap: [String?: String?], completion: @escaping (Result<[String?: String?], Error>) -> Void - ) - /// Returns the passed map, to test asynchronous serialization and deserialization. - func echoAsync( - intMap: [Int64?: Int64?], completion: @escaping (Result<[Int64?: Int64?], Error>) -> Void) - /// Returns the passed map, to test asynchronous serialization and deserialization. - func echoAsync( - enumMap: [AnEnum?: AnEnum?], completion: @escaping (Result<[AnEnum?: AnEnum?], Error>) -> Void) - /// Returns the passed map, to test asynchronous serialization and deserialization. - func echoAsync( - classMap: [Int64?: AllNullableTypes?], - completion: @escaping (Result<[Int64?: AllNullableTypes?], Error>) -> Void) - /// Returns the passed enum, to test asynchronous serialization and deserialization. - func echoAsync(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) - /// Returns the passed enum, to test asynchronous serialization and deserialization. - func echoAsync( - _ anotherEnum: AnotherEnum, completion: @escaping (Result) -> Void) - /// Responds with an error from an async function returning a value. - func throwAsyncError(completion: @escaping (Result) -> Void) - /// Responds with an error from an async void function. - func throwAsyncErrorFromVoid(completion: @escaping (Result) -> Void) - /// Responds with a Flutter error from an async function returning a value. - func throwAsyncFlutterError(completion: @escaping (Result) -> Void) - /// Returns the passed object, to test async serialization and deserialization. - func echoAsync(_ everything: AllTypes, completion: @escaping (Result) -> Void) - /// Returns the passed object, to test serialization and deserialization. - func echoAsync( - _ everything: AllNullableTypes?, - completion: @escaping (Result) -> Void) - /// Returns the passed object, to test serialization and deserialization. - func echoAsync( - _ everything: AllNullableTypesWithoutRecursion?, - completion: @escaping (Result) -> Void) - /// Returns passed in int asynchronously. - func echoAsyncNullable(_ anInt: Int64?, completion: @escaping (Result) -> Void) - /// Returns passed in double asynchronously. - func echoAsyncNullable(_ aDouble: Double?, completion: @escaping (Result) -> Void) - /// Returns the passed in boolean asynchronously. - func echoAsyncNullable(_ aBool: Bool?, completion: @escaping (Result) -> Void) - /// Returns the passed string asynchronously. - func echoAsyncNullable(_ aString: String?, completion: @escaping (Result) -> Void) - /// Returns the passed in Uint8List asynchronously. - func echoAsyncNullable( - _ aUint8List: FlutterStandardTypedData?, - completion: @escaping (Result) -> Void) - /// Returns the passed in generic Object asynchronously. - func echoAsyncNullable(_ anObject: Any?, completion: @escaping (Result) -> Void) - /// Returns the passed list, to test asynchronous serialization and deserialization. - func echoAsyncNullable(_ list: [Any?]?, completion: @escaping (Result<[Any?]?, Error>) -> Void) - /// Returns the passed list, to test asynchronous serialization and deserialization. - func echoAsyncNullable( - enumList: [AnEnum?]?, completion: @escaping (Result<[AnEnum?]?, Error>) -> Void) - /// Returns the passed list, to test asynchronous serialization and deserialization. - func echoAsyncNullable( - classList: [AllNullableTypes?]?, - completion: @escaping (Result<[AllNullableTypes?]?, Error>) -> Void) - /// Returns the passed map, to test asynchronous serialization and deserialization. - func echoAsyncNullable( - _ map: [AnyHashable?: Any?]?, - completion: @escaping (Result<[AnyHashable?: Any?]?, Error>) -> Void) - /// Returns the passed map, to test asynchronous serialization and deserialization. - func echoAsyncNullable( - stringMap: [String?: String?]?, - completion: @escaping (Result<[String?: String?]?, Error>) -> Void) - /// Returns the passed map, to test asynchronous serialization and deserialization. - func echoAsyncNullable( - intMap: [Int64?: Int64?]?, completion: @escaping (Result<[Int64?: Int64?]?, Error>) -> Void) - /// Returns the passed map, to test asynchronous serialization and deserialization. - func echoAsyncNullable( - enumMap: [AnEnum?: AnEnum?]?, completion: @escaping (Result<[AnEnum?: AnEnum?]?, Error>) -> Void - ) - /// Returns the passed map, to test asynchronous serialization and deserialization. - func echoAsyncNullable( - classMap: [Int64?: AllNullableTypes?]?, - completion: @escaping (Result<[Int64?: AllNullableTypes?]?, Error>) -> Void) - /// Returns the passed enum, to test asynchronous serialization and deserialization. - func echoAsyncNullable(_ anEnum: AnEnum?, completion: @escaping (Result) -> Void) - /// Returns the passed enum, to test asynchronous serialization and deserialization. - func echoAsyncNullable( - _ anotherEnum: AnotherEnum?, completion: @escaping (Result) -> Void) - /// Returns true if the handler is run on a main thread, which should be - /// true since there is no TaskQueue annotation. - func defaultIsMainThread() throws -> Bool - /// Returns true if the handler is run on a non-main thread, which should be - /// true for any platform with TaskQueue support. - func taskQueueIsBackgroundThread() throws -> Bool - func callFlutterNoop(completion: @escaping (Result) -> Void) - func callFlutterThrowError(completion: @escaping (Result) -> Void) - func callFlutterThrowErrorFromVoid(completion: @escaping (Result) -> Void) - func callFlutterEcho( - _ everything: AllTypes, completion: @escaping (Result) -> Void) - func callFlutterEcho( - _ everything: AllNullableTypes?, - completion: @escaping (Result) -> Void) - func callFlutterSendMultipleNullableTypes( - aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?, - completion: @escaping (Result) -> Void) - func callFlutterEcho( - _ everything: AllNullableTypesWithoutRecursion?, - completion: @escaping (Result) -> Void) - func callFlutterSendMultipleNullableTypesWithoutRecursion( - aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?, - completion: @escaping (Result) -> Void) - func callFlutterEcho(_ aBool: Bool, completion: @escaping (Result) -> Void) - func callFlutterEcho(_ anInt: Int64, completion: @escaping (Result) -> Void) - func callFlutterEcho(_ aDouble: Double, completion: @escaping (Result) -> Void) - func callFlutterEcho(_ aString: String, completion: @escaping (Result) -> Void) - func callFlutterEcho( - _ list: FlutterStandardTypedData, - completion: @escaping (Result) -> Void) - func callFlutterEcho(_ list: [Any?], completion: @escaping (Result<[Any?], Error>) -> Void) - func callFlutterEcho( - enumList: [AnEnum?], completion: @escaping (Result<[AnEnum?], Error>) -> Void) - func callFlutterEcho( - classList: [AllNullableTypes?], - completion: @escaping (Result<[AllNullableTypes?], Error>) -> Void) - func callFlutterEchoNonNull( - enumList: [AnEnum], completion: @escaping (Result<[AnEnum], Error>) -> Void) - func callFlutterEchoNonNull( - classList: [AllNullableTypes], completion: @escaping (Result<[AllNullableTypes], Error>) -> Void - ) - func callFlutterEcho( - _ map: [AnyHashable?: Any?], completion: @escaping (Result<[AnyHashable?: Any?], Error>) -> Void - ) - func callFlutterEcho( - stringMap: [String?: String?], completion: @escaping (Result<[String?: String?], Error>) -> Void - ) - func callFlutterEcho( - intMap: [Int64?: Int64?], completion: @escaping (Result<[Int64?: Int64?], Error>) -> Void) - func callFlutterEcho( - enumMap: [AnEnum?: AnEnum?], completion: @escaping (Result<[AnEnum?: AnEnum?], Error>) -> Void) - func callFlutterEcho( - classMap: [Int64?: AllNullableTypes?], - completion: @escaping (Result<[Int64?: AllNullableTypes?], Error>) -> Void) - func callFlutterEchoNonNull( - stringMap: [String: String], completion: @escaping (Result<[String: String], Error>) -> Void) - func callFlutterEchoNonNull( - intMap: [Int64: Int64], completion: @escaping (Result<[Int64: Int64], Error>) -> Void) - func callFlutterEchoNonNull( - enumMap: [AnEnum: AnEnum], completion: @escaping (Result<[AnEnum: AnEnum], Error>) -> Void) - func callFlutterEchoNonNull( - classMap: [Int64: AllNullableTypes], - completion: @escaping (Result<[Int64: AllNullableTypes], Error>) -> Void) - func callFlutterEcho(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) - func callFlutterEcho( - _ anotherEnum: AnotherEnum, completion: @escaping (Result) -> Void) - func callFlutterEchoNullable(_ aBool: Bool?, completion: @escaping (Result) -> Void) - func callFlutterEchoNullable( - _ anInt: Int64?, completion: @escaping (Result) -> Void) - func callFlutterEchoNullable( - _ aDouble: Double?, completion: @escaping (Result) -> Void) - func callFlutterEchoNullable( - _ aString: String?, completion: @escaping (Result) -> Void) - func callFlutterEchoNullable( - _ list: FlutterStandardTypedData?, - completion: @escaping (Result) -> Void) - func callFlutterEchoNullable( - _ list: [Any?]?, completion: @escaping (Result<[Any?]?, Error>) -> Void) - func callFlutterEchoNullable( - enumList: [AnEnum?]?, completion: @escaping (Result<[AnEnum?]?, Error>) -> Void) - func callFlutterEchoNullable( - classList: [AllNullableTypes?]?, - completion: @escaping (Result<[AllNullableTypes?]?, Error>) -> Void) - func callFlutterEchoNullableNonNull( - enumList: [AnEnum]?, completion: @escaping (Result<[AnEnum]?, Error>) -> Void) - func callFlutterEchoNullableNonNull( - classList: [AllNullableTypes]?, - completion: @escaping (Result<[AllNullableTypes]?, Error>) -> Void) - func callFlutterEchoNullable( - _ map: [AnyHashable?: Any?]?, - completion: @escaping (Result<[AnyHashable?: Any?]?, Error>) -> Void) - func callFlutterEchoNullable( - stringMap: [String?: String?]?, - completion: @escaping (Result<[String?: String?]?, Error>) -> Void) - func callFlutterEchoNullable( - intMap: [Int64?: Int64?]?, completion: @escaping (Result<[Int64?: Int64?]?, Error>) -> Void) - func callFlutterEchoNullable( - enumMap: [AnEnum?: AnEnum?]?, completion: @escaping (Result<[AnEnum?: AnEnum?]?, Error>) -> Void - ) - func callFlutterEchoNullable( - classMap: [Int64?: AllNullableTypes?]?, - completion: @escaping (Result<[Int64?: AllNullableTypes?]?, Error>) -> Void) - func callFlutterEchoNullableNonNull( - stringMap: [String: String]?, completion: @escaping (Result<[String: String]?, Error>) -> Void) - func callFlutterEchoNullableNonNull( - intMap: [Int64: Int64]?, completion: @escaping (Result<[Int64: Int64]?, Error>) -> Void) - func callFlutterEchoNullableNonNull( - enumMap: [AnEnum: AnEnum]?, completion: @escaping (Result<[AnEnum: AnEnum]?, Error>) -> Void) - func callFlutterEchoNullableNonNull( - classMap: [Int64: AllNullableTypes]?, - completion: @escaping (Result<[Int64: AllNullableTypes]?, Error>) -> Void) - func callFlutterEchoNullable( - _ anEnum: AnEnum?, completion: @escaping (Result) -> Void) - func callFlutterEchoNullable( - _ anotherEnum: AnotherEnum?, completion: @escaping (Result) -> Void) - func callFlutterSmallApiEcho( - _ aString: String, completion: @escaping (Result) -> Void) -} - -/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. -class HostIntegrationCoreApiSetup { - static var codec: FlutterStandardMessageCodec { CoreTestsPigeonCodec.shared } - /// Sets up an instance of `HostIntegrationCoreApi` to handle messages through the `binaryMessenger`. - static func setUp( - binaryMessenger: FlutterBinaryMessenger, api: HostIntegrationCoreApi?, - messageChannelSuffix: String = "" - ) { - let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" - #if os(iOS) - let taskQueue = binaryMessenger.makeBackgroundTaskQueue?() - #else - let taskQueue: FlutterTaskQueue? = nil - #endif - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic calling. - let noopChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - noopChannel.setMessageHandler { _, reply in - do { - try api.noop() - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - noopChannel.setMessageHandler(nil) - } - /// Returns the passed object, to test serialization and deserialization. - let echoAllTypesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAllTypesChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let everythingArg = args[0] as! AllTypes - do { - let result = try api.echo(everythingArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoAllTypesChannel.setMessageHandler(nil) - } - /// Returns an error, to test error handling. - let throwErrorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - throwErrorChannel.setMessageHandler { _, reply in - do { - let result = try api.throwError() - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - throwErrorChannel.setMessageHandler(nil) - } - /// Returns an error from a void function, to test error handling. - let throwErrorFromVoidChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - throwErrorFromVoidChannel.setMessageHandler { _, reply in - do { - try api.throwErrorFromVoid() - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - throwErrorFromVoidChannel.setMessageHandler(nil) - } - /// Returns a Flutter error, to test error handling. - let throwFlutterErrorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - throwFlutterErrorChannel.setMessageHandler { _, reply in - do { - let result = try api.throwFlutterError() - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - throwFlutterErrorChannel.setMessageHandler(nil) - } - /// Returns passed in int. - let echoIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoIntChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let anIntArg = args[0] as! Int64 - do { - let result = try api.echo(anIntArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoIntChannel.setMessageHandler(nil) - } - /// Returns passed in double. - let echoDoubleChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoDoubleChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aDoubleArg = args[0] as! Double - do { - let result = try api.echo(aDoubleArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoDoubleChannel.setMessageHandler(nil) - } - /// Returns the passed in boolean. - let echoBoolChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoBoolChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aBoolArg = args[0] as! Bool - do { - let result = try api.echo(aBoolArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoBoolChannel.setMessageHandler(nil) - } - /// Returns the passed in string. - let echoStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aStringArg = args[0] as! String - do { - let result = try api.echo(aStringArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoStringChannel.setMessageHandler(nil) - } - /// Returns the passed in Uint8List. - let echoUint8ListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoUint8ListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aUint8ListArg = args[0] as! FlutterStandardTypedData - do { - let result = try api.echo(aUint8ListArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoUint8ListChannel.setMessageHandler(nil) - } - /// Returns the passed in generic Object. - let echoObjectChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoObjectChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let anObjectArg = args[0]! - do { - let result = try api.echo(anObjectArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoObjectChannel.setMessageHandler(nil) - } - /// Returns the passed list, to test serialization and deserialization. - let echoListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let listArg = args[0] as! [Any?] - do { - let result = try api.echo(listArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoListChannel.setMessageHandler(nil) - } - /// Returns the passed list, to test serialization and deserialization. - let echoEnumListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnumList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoEnumListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let enumListArg = args[0] as! [AnEnum?] - do { - let result = try api.echo(enumList: enumListArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoEnumListChannel.setMessageHandler(nil) - } - /// Returns the passed list, to test serialization and deserialization. - let echoClassListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoClassListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let classListArg = args[0] as! [AllNullableTypes?] - do { - let result = try api.echo(classList: classListArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoClassListChannel.setMessageHandler(nil) - } - /// Returns the passed list, to test serialization and deserialization. - let echoNonNullEnumListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullEnumList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNonNullEnumListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let enumListArg = args[0] as! [AnEnum] - do { - let result = try api.echoNonNull(enumList: enumListArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNonNullEnumListChannel.setMessageHandler(nil) - } - /// Returns the passed list, to test serialization and deserialization. - let echoNonNullClassListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullClassList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNonNullClassListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let classListArg = args[0] as! [AllNullableTypes] - do { - let result = try api.echoNonNull(classList: classListArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNonNullClassListChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test serialization and deserialization. - let echoMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let mapArg = args[0] as! [AnyHashable?: Any?] - do { - let result = try api.echo(mapArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoMapChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test serialization and deserialization. - let echoStringMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoStringMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoStringMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let stringMapArg = args[0] as! [String?: String?] - do { - let result = try api.echo(stringMap: stringMapArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoStringMapChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test serialization and deserialization. - let echoIntMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoIntMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoIntMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let intMapArg = args[0] as! [Int64?: Int64?] - do { - let result = try api.echo(intMap: intMapArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoIntMapChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test serialization and deserialization. - let echoEnumMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnumMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoEnumMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let enumMapArg = args[0] as? [AnEnum?: AnEnum?] - do { - let result = try api.echo(enumMap: enumMapArg!) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoEnumMapChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test serialization and deserialization. - let echoClassMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoClassMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let classMapArg = args[0] as! [Int64?: AllNullableTypes?] - do { - let result = try api.echo(classMap: classMapArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoClassMapChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test serialization and deserialization. - let echoNonNullStringMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullStringMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNonNullStringMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let stringMapArg = args[0] as! [String: String] - do { - let result = try api.echoNonNull(stringMap: stringMapArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNonNullStringMapChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test serialization and deserialization. - let echoNonNullIntMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullIntMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNonNullIntMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let intMapArg = args[0] as! [Int64: Int64] - do { - let result = try api.echoNonNull(intMap: intMapArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNonNullIntMapChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test serialization and deserialization. - let echoNonNullEnumMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullEnumMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNonNullEnumMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let enumMapArg = args[0] as? [AnEnum: AnEnum] - do { - let result = try api.echoNonNull(enumMap: enumMapArg!) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNonNullEnumMapChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test serialization and deserialization. - let echoNonNullClassMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullClassMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNonNullClassMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let classMapArg = args[0] as! [Int64: AllNullableTypes] - do { - let result = try api.echoNonNull(classMap: classMapArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNonNullClassMapChannel.setMessageHandler(nil) - } - /// Returns the passed class to test nested class serialization and deserialization. - let echoClassWrapperChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoClassWrapperChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let wrapperArg = args[0] as! AllClassesWrapper - do { - let result = try api.echo(wrapperArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoClassWrapperChannel.setMessageHandler(nil) - } - /// Returns the passed enum to test serialization and deserialization. - let echoEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoEnumChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let anEnumArg = args[0] as! AnEnum - do { - let result = try api.echo(anEnumArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoEnumChannel.setMessageHandler(nil) - } - /// Returns the passed enum to test serialization and deserialization. - let echoAnotherEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherEnum\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAnotherEnumChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let anotherEnumArg = args[0] as! AnotherEnum - do { - let result = try api.echo(anotherEnumArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoAnotherEnumChannel.setMessageHandler(nil) - } - /// Returns the default string. - let echoNamedDefaultStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNamedDefaultStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aStringArg = args[0] as! String - do { - let result = try api.echoNamedDefault(aStringArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNamedDefaultStringChannel.setMessageHandler(nil) - } - /// Returns passed in double. - let echoOptionalDefaultDoubleChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoOptionalDefaultDoubleChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aDoubleArg = args[0] as! Double - do { - let result = try api.echoOptionalDefault(aDoubleArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoOptionalDefaultDoubleChannel.setMessageHandler(nil) - } - /// Returns passed in int. - let echoRequiredIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoRequiredIntChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let anIntArg = args[0] as! Int64 - do { - let result = try api.echoRequired(anIntArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoRequiredIntChannel.setMessageHandler(nil) - } - /// Returns the passed object, to test serialization and deserialization. - let echoAllNullableTypesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAllNullableTypesChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let everythingArg: AllNullableTypes? = nilOrValue(args[0]) - do { - let result = try api.echo(everythingArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoAllNullableTypesChannel.setMessageHandler(nil) - } - /// Returns the passed object, to test serialization and deserialization. - let echoAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAllNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let everythingArg: AllNullableTypesWithoutRecursion? = nilOrValue(args[0]) - do { - let result = try api.echo(everythingArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoAllNullableTypesWithoutRecursionChannel.setMessageHandler(nil) - } - /// Returns the inner `aString` value from the wrapped object, to test - /// sending of nested objects. - let extractNestedNullableStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - extractNestedNullableStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let wrapperArg = args[0] as! AllClassesWrapper - do { - let result = try api.extractNestedNullableString(from: wrapperArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - extractNestedNullableStringChannel.setMessageHandler(nil) - } - /// Returns the inner `aString` value from the wrapped object, to test - /// sending of nested objects. - let createNestedNullableStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - createNestedNullableStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let nullableStringArg: String? = nilOrValue(args[0]) - do { - let result = try api.createNestedObject(with: nullableStringArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - createNestedNullableStringChannel.setMessageHandler(nil) - } - /// Returns passed in arguments of multiple types. - let sendMultipleNullableTypesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - sendMultipleNullableTypesChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = nilOrValue(args[1]) - let aNullableStringArg: String? = nilOrValue(args[2]) - do { - let result = try api.sendMultipleNullableTypes( - aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - sendMultipleNullableTypesChannel.setMessageHandler(nil) - } - /// Returns passed in arguments of multiple types. - let sendMultipleNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - sendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = nilOrValue(args[1]) - let aNullableStringArg: String? = nilOrValue(args[2]) - do { - let result = try api.sendMultipleNullableTypesWithoutRecursion( - aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - sendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler(nil) - } - /// Returns passed in int. - let echoNullableIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableIntChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aNullableIntArg: Int64? = nilOrValue(args[0]) - do { - let result = try api.echo(aNullableIntArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableIntChannel.setMessageHandler(nil) - } - /// Returns passed in double. - let echoNullableDoubleChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableDoubleChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aNullableDoubleArg: Double? = nilOrValue(args[0]) - do { - let result = try api.echo(aNullableDoubleArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableDoubleChannel.setMessageHandler(nil) - } - /// Returns the passed in boolean. - let echoNullableBoolChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableBoolChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aNullableBoolArg: Bool? = nilOrValue(args[0]) - do { - let result = try api.echo(aNullableBoolArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableBoolChannel.setMessageHandler(nil) - } - /// Returns the passed in string. - let echoNullableStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aNullableStringArg: String? = nilOrValue(args[0]) - do { - let result = try api.echo(aNullableStringArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableStringChannel.setMessageHandler(nil) - } - /// Returns the passed in Uint8List. - let echoNullableUint8ListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableUint8ListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aNullableUint8ListArg: FlutterStandardTypedData? = nilOrValue(args[0]) - do { - let result = try api.echo(aNullableUint8ListArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableUint8ListChannel.setMessageHandler(nil) - } - /// Returns the passed in generic Object. - let echoNullableObjectChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableObjectChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aNullableObjectArg: Any? = args[0] - do { - let result = try api.echo(aNullableObjectArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableObjectChannel.setMessageHandler(nil) - } - /// Returns the passed list, to test serialization and deserialization. - let echoNullableListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aNullableListArg: [Any?]? = nilOrValue(args[0]) - do { - let result = try api.echoNullable(aNullableListArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableListChannel.setMessageHandler(nil) - } - /// Returns the passed list, to test serialization and deserialization. - let echoNullableEnumListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnumList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableEnumListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let enumListArg: [AnEnum?]? = nilOrValue(args[0]) - do { - let result = try api.echoNullable(enumList: enumListArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableEnumListChannel.setMessageHandler(nil) - } - /// Returns the passed list, to test serialization and deserialization. - let echoNullableClassListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableClassList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableClassListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let classListArg: [AllNullableTypes?]? = nilOrValue(args[0]) - do { - let result = try api.echoNullable(classList: classListArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableClassListChannel.setMessageHandler(nil) - } - /// Returns the passed list, to test serialization and deserialization. - let echoNullableNonNullEnumListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullEnumList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableNonNullEnumListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let enumListArg: [AnEnum]? = nilOrValue(args[0]) - do { - let result = try api.echoNullableNonNull(enumList: enumListArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableNonNullEnumListChannel.setMessageHandler(nil) - } - /// Returns the passed list, to test serialization and deserialization. - let echoNullableNonNullClassListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullClassList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableNonNullClassListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let classListArg: [AllNullableTypes]? = nilOrValue(args[0]) - do { - let result = try api.echoNullableNonNull(classList: classListArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableNonNullClassListChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test serialization and deserialization. - let echoNullableMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let mapArg: [AnyHashable?: Any?]? = nilOrValue(args[0]) - do { - let result = try api.echoNullable(mapArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableMapChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test serialization and deserialization. - let echoNullableStringMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableStringMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableStringMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let stringMapArg: [String?: String?]? = nilOrValue(args[0]) - do { - let result = try api.echoNullable(stringMap: stringMapArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableStringMapChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test serialization and deserialization. - let echoNullableIntMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableIntMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableIntMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let intMapArg: [Int64?: Int64?]? = nilOrValue(args[0]) - do { - let result = try api.echoNullable(intMap: intMapArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableIntMapChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test serialization and deserialization. - let echoNullableEnumMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnumMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableEnumMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let enumMapArg: [AnEnum?: AnEnum?]? = args[0] as? [AnEnum?: AnEnum?] - do { - let result = try api.echoNullable(enumMap: enumMapArg!) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableEnumMapChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test serialization and deserialization. - let echoNullableClassMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableClassMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableClassMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let classMapArg: [Int64?: AllNullableTypes?]? = nilOrValue(args[0]) - do { - let result = try api.echoNullable(classMap: classMapArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableClassMapChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test serialization and deserialization. - let echoNullableNonNullStringMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullStringMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableNonNullStringMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let stringMapArg: [String: String]? = nilOrValue(args[0]) - do { - let result = try api.echoNullableNonNull(stringMap: stringMapArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableNonNullStringMapChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test serialization and deserialization. - let echoNullableNonNullIntMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullIntMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableNonNullIntMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let intMapArg: [Int64: Int64]? = nilOrValue(args[0]) - do { - let result = try api.echoNullableNonNull(intMap: intMapArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableNonNullIntMapChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test serialization and deserialization. - let echoNullableNonNullEnumMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullEnumMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableNonNullEnumMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let enumMapArg: [AnEnum: AnEnum]? = args[0] as? [AnEnum: AnEnum] - do { - let result = try api.echoNullableNonNull(enumMap: enumMapArg!) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableNonNullEnumMapChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test serialization and deserialization. - let echoNullableNonNullClassMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullClassMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableNonNullClassMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let classMapArg: [Int64: AllNullableTypes]? = nilOrValue(args[0]) - do { - let result = try api.echoNullableNonNull(classMap: classMapArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableNonNullClassMapChannel.setMessageHandler(nil) - } - let echoNullableEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableEnumChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let anEnumArg: AnEnum? = nilOrValue(args[0]) - do { - let result = try api.echoNullable(anEnumArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableEnumChannel.setMessageHandler(nil) - } - let echoAnotherNullableEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherNullableEnum\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAnotherNullableEnumChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let anotherEnumArg: AnotherEnum? = nilOrValue(args[0]) - do { - let result = try api.echoNullable(anotherEnumArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoAnotherNullableEnumChannel.setMessageHandler(nil) - } - /// Returns passed in int. - let echoOptionalNullableIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoOptionalNullableIntChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aNullableIntArg: Int64? = nilOrValue(args[0]) - do { - let result = try api.echoOptional(aNullableIntArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoOptionalNullableIntChannel.setMessageHandler(nil) - } - /// Returns the passed in string. - let echoNamedNullableStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNamedNullableStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aNullableStringArg: String? = nilOrValue(args[0]) - do { - let result = try api.echoNamed(aNullableStringArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNamedNullableStringChannel.setMessageHandler(nil) - } - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic asynchronous calling. - let noopAsyncChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - noopAsyncChannel.setMessageHandler { _, reply in - api.noopAsync { result in - switch result { - case .success: - reply(wrapResult(nil)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - noopAsyncChannel.setMessageHandler(nil) - } - /// Returns passed in int asynchronously. - let echoAsyncIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncIntChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let anIntArg = args[0] as! Int64 - api.echoAsync(anIntArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncIntChannel.setMessageHandler(nil) - } - /// Returns passed in double asynchronously. - let echoAsyncDoubleChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncDoubleChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aDoubleArg = args[0] as! Double - api.echoAsync(aDoubleArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncDoubleChannel.setMessageHandler(nil) - } - /// Returns the passed in boolean asynchronously. - let echoAsyncBoolChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncBoolChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aBoolArg = args[0] as! Bool - api.echoAsync(aBoolArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncBoolChannel.setMessageHandler(nil) - } - /// Returns the passed string asynchronously. - let echoAsyncStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aStringArg = args[0] as! String - api.echoAsync(aStringArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncStringChannel.setMessageHandler(nil) - } - /// Returns the passed in Uint8List asynchronously. - let echoAsyncUint8ListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncUint8ListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aUint8ListArg = args[0] as! FlutterStandardTypedData - api.echoAsync(aUint8ListArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncUint8ListChannel.setMessageHandler(nil) - } - /// Returns the passed in generic Object asynchronously. - let echoAsyncObjectChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncObjectChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let anObjectArg = args[0]! - api.echoAsync(anObjectArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncObjectChannel.setMessageHandler(nil) - } - /// Returns the passed list, to test asynchronous serialization and deserialization. - let echoAsyncListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let listArg = args[0] as! [Any?] - api.echoAsync(listArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncListChannel.setMessageHandler(nil) - } - /// Returns the passed list, to test asynchronous serialization and deserialization. - let echoAsyncEnumListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnumList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncEnumListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let enumListArg = args[0] as! [AnEnum?] - api.echoAsync(enumList: enumListArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncEnumListChannel.setMessageHandler(nil) - } - /// Returns the passed list, to test asynchronous serialization and deserialization. - let echoAsyncClassListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncClassList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncClassListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let classListArg = args[0] as! [AllNullableTypes?] - api.echoAsync(classList: classListArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncClassListChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test asynchronous serialization and deserialization. - let echoAsyncMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let mapArg = args[0] as! [AnyHashable?: Any?] - api.echoAsync(mapArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncMapChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test asynchronous serialization and deserialization. - let echoAsyncStringMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncStringMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncStringMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let stringMapArg = args[0] as! [String?: String?] - api.echoAsync(stringMap: stringMapArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncStringMapChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test asynchronous serialization and deserialization. - let echoAsyncIntMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncIntMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncIntMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let intMapArg = args[0] as! [Int64?: Int64?] - api.echoAsync(intMap: intMapArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncIntMapChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test asynchronous serialization and deserialization. - let echoAsyncEnumMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnumMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncEnumMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let enumMapArg = args[0] as? [AnEnum?: AnEnum?] - api.echoAsync(enumMap: enumMapArg!) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncEnumMapChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test asynchronous serialization and deserialization. - let echoAsyncClassMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncClassMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncClassMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let classMapArg = args[0] as! [Int64?: AllNullableTypes?] - api.echoAsync(classMap: classMapArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncClassMapChannel.setMessageHandler(nil) - } - /// Returns the passed enum, to test asynchronous serialization and deserialization. - let echoAsyncEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncEnumChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let anEnumArg = args[0] as! AnEnum - api.echoAsync(anEnumArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncEnumChannel.setMessageHandler(nil) - } - /// Returns the passed enum, to test asynchronous serialization and deserialization. - let echoAnotherAsyncEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherAsyncEnum\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAnotherAsyncEnumChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let anotherEnumArg = args[0] as! AnotherEnum - api.echoAsync(anotherEnumArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAnotherAsyncEnumChannel.setMessageHandler(nil) - } - /// Responds with an error from an async function returning a value. - let throwAsyncErrorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - throwAsyncErrorChannel.setMessageHandler { _, reply in - api.throwAsyncError { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - throwAsyncErrorChannel.setMessageHandler(nil) - } - /// Responds with an error from an async void function. - let throwAsyncErrorFromVoidChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - throwAsyncErrorFromVoidChannel.setMessageHandler { _, reply in - api.throwAsyncErrorFromVoid { result in - switch result { - case .success: - reply(wrapResult(nil)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - throwAsyncErrorFromVoidChannel.setMessageHandler(nil) - } - /// Responds with a Flutter error from an async function returning a value. - let throwAsyncFlutterErrorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - throwAsyncFlutterErrorChannel.setMessageHandler { _, reply in - api.throwAsyncFlutterError { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - throwAsyncFlutterErrorChannel.setMessageHandler(nil) - } - /// Returns the passed object, to test async serialization and deserialization. - let echoAsyncAllTypesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncAllTypesChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let everythingArg = args[0] as! AllTypes - api.echoAsync(everythingArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncAllTypesChannel.setMessageHandler(nil) - } - /// Returns the passed object, to test serialization and deserialization. - let echoAsyncNullableAllNullableTypesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableAllNullableTypesChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let everythingArg: AllNullableTypes? = nilOrValue(args[0]) - api.echoAsync(everythingArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableAllNullableTypesChannel.setMessageHandler(nil) - } - /// Returns the passed object, to test serialization and deserialization. - let echoAsyncNullableAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableAllNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let everythingArg: AllNullableTypesWithoutRecursion? = nilOrValue(args[0]) - api.echoAsync(everythingArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableAllNullableTypesWithoutRecursionChannel.setMessageHandler(nil) - } - /// Returns passed in int asynchronously. - let echoAsyncNullableIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableIntChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let anIntArg: Int64? = nilOrValue(args[0]) - api.echoAsyncNullable(anIntArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableIntChannel.setMessageHandler(nil) - } - /// Returns passed in double asynchronously. - let echoAsyncNullableDoubleChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableDoubleChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aDoubleArg: Double? = nilOrValue(args[0]) - api.echoAsyncNullable(aDoubleArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableDoubleChannel.setMessageHandler(nil) - } - /// Returns the passed in boolean asynchronously. - let echoAsyncNullableBoolChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableBoolChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aBoolArg: Bool? = nilOrValue(args[0]) - api.echoAsyncNullable(aBoolArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableBoolChannel.setMessageHandler(nil) - } - /// Returns the passed string asynchronously. - let echoAsyncNullableStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aStringArg: String? = nilOrValue(args[0]) - api.echoAsyncNullable(aStringArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableStringChannel.setMessageHandler(nil) - } - /// Returns the passed in Uint8List asynchronously. - let echoAsyncNullableUint8ListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableUint8ListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aUint8ListArg: FlutterStandardTypedData? = nilOrValue(args[0]) - api.echoAsyncNullable(aUint8ListArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableUint8ListChannel.setMessageHandler(nil) - } - /// Returns the passed in generic Object asynchronously. - let echoAsyncNullableObjectChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableObjectChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let anObjectArg: Any? = args[0] - api.echoAsyncNullable(anObjectArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableObjectChannel.setMessageHandler(nil) - } - /// Returns the passed list, to test asynchronous serialization and deserialization. - let echoAsyncNullableListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let listArg: [Any?]? = nilOrValue(args[0]) - api.echoAsyncNullable(listArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableListChannel.setMessageHandler(nil) - } - /// Returns the passed list, to test asynchronous serialization and deserialization. - let echoAsyncNullableEnumListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnumList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableEnumListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let enumListArg: [AnEnum?]? = nilOrValue(args[0]) - api.echoAsyncNullable(enumList: enumListArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableEnumListChannel.setMessageHandler(nil) - } - /// Returns the passed list, to test asynchronous serialization and deserialization. - let echoAsyncNullableClassListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableClassList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableClassListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let classListArg: [AllNullableTypes?]? = nilOrValue(args[0]) - api.echoAsyncNullable(classList: classListArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableClassListChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test asynchronous serialization and deserialization. - let echoAsyncNullableMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let mapArg: [AnyHashable?: Any?]? = nilOrValue(args[0]) - api.echoAsyncNullable(mapArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableMapChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test asynchronous serialization and deserialization. - let echoAsyncNullableStringMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableStringMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableStringMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let stringMapArg: [String?: String?]? = nilOrValue(args[0]) - api.echoAsyncNullable(stringMap: stringMapArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableStringMapChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test asynchronous serialization and deserialization. - let echoAsyncNullableIntMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableIntMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableIntMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let intMapArg: [Int64?: Int64?]? = nilOrValue(args[0]) - api.echoAsyncNullable(intMap: intMapArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableIntMapChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test asynchronous serialization and deserialization. - let echoAsyncNullableEnumMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnumMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableEnumMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let enumMapArg: [AnEnum?: AnEnum?]? = args[0] as? [AnEnum?: AnEnum?] - api.echoAsyncNullable(enumMap: enumMapArg!) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableEnumMapChannel.setMessageHandler(nil) - } - /// Returns the passed map, to test asynchronous serialization and deserialization. - let echoAsyncNullableClassMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableClassMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableClassMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let classMapArg: [Int64?: AllNullableTypes?]? = nilOrValue(args[0]) - api.echoAsyncNullable(classMap: classMapArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableClassMapChannel.setMessageHandler(nil) - } - /// Returns the passed enum, to test asynchronous serialization and deserialization. - let echoAsyncNullableEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableEnumChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let anEnumArg: AnEnum? = nilOrValue(args[0]) - api.echoAsyncNullable(anEnumArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableEnumChannel.setMessageHandler(nil) - } - /// Returns the passed enum, to test asynchronous serialization and deserialization. - let echoAnotherAsyncNullableEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherAsyncNullableEnum\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAnotherAsyncNullableEnumChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let anotherEnumArg: AnotherEnum? = nilOrValue(args[0]) - api.echoAsyncNullable(anotherEnumArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAnotherAsyncNullableEnumChannel.setMessageHandler(nil) - } - /// Returns true if the handler is run on a main thread, which should be - /// true since there is no TaskQueue annotation. - let defaultIsMainThreadChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.defaultIsMainThread\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - defaultIsMainThreadChannel.setMessageHandler { _, reply in - do { - let result = try api.defaultIsMainThread() - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - defaultIsMainThreadChannel.setMessageHandler(nil) - } - /// Returns true if the handler is run on a non-main thread, which should be - /// true for any platform with TaskQueue support. - let taskQueueIsBackgroundThreadChannel = - taskQueue == nil - ? FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.taskQueueIsBackgroundThread\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - : FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.taskQueueIsBackgroundThread\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec, taskQueue: taskQueue) - if let api = api { - taskQueueIsBackgroundThreadChannel.setMessageHandler { _, reply in - do { - let result = try api.taskQueueIsBackgroundThread() - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - taskQueueIsBackgroundThreadChannel.setMessageHandler(nil) - } - let callFlutterNoopChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterNoopChannel.setMessageHandler { _, reply in - api.callFlutterNoop { result in - switch result { - case .success: - reply(wrapResult(nil)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterNoopChannel.setMessageHandler(nil) - } - let callFlutterThrowErrorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterThrowErrorChannel.setMessageHandler { _, reply in - api.callFlutterThrowError { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterThrowErrorChannel.setMessageHandler(nil) - } - let callFlutterThrowErrorFromVoidChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterThrowErrorFromVoidChannel.setMessageHandler { _, reply in - api.callFlutterThrowErrorFromVoid { result in - switch result { - case .success: - reply(wrapResult(nil)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterThrowErrorFromVoidChannel.setMessageHandler(nil) - } - let callFlutterEchoAllTypesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoAllTypesChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let everythingArg = args[0] as! AllTypes - api.callFlutterEcho(everythingArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoAllTypesChannel.setMessageHandler(nil) - } - let callFlutterEchoAllNullableTypesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoAllNullableTypesChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let everythingArg: AllNullableTypes? = nilOrValue(args[0]) - api.callFlutterEcho(everythingArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoAllNullableTypesChannel.setMessageHandler(nil) - } - let callFlutterSendMultipleNullableTypesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterSendMultipleNullableTypesChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = nilOrValue(args[1]) - let aNullableStringArg: String? = nilOrValue(args[2]) - api.callFlutterSendMultipleNullableTypes( - aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterSendMultipleNullableTypesChannel.setMessageHandler(nil) - } - let callFlutterEchoAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoAllNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let everythingArg: AllNullableTypesWithoutRecursion? = nilOrValue(args[0]) - api.callFlutterEcho(everythingArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoAllNullableTypesWithoutRecursionChannel.setMessageHandler(nil) - } - let callFlutterSendMultipleNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterSendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler { - message, reply in - let args = message as! [Any?] - let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = nilOrValue(args[1]) - let aNullableStringArg: String? = nilOrValue(args[2]) - api.callFlutterSendMultipleNullableTypesWithoutRecursion( - aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterSendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler(nil) - } - let callFlutterEchoBoolChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoBoolChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aBoolArg = args[0] as! Bool - api.callFlutterEcho(aBoolArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoBoolChannel.setMessageHandler(nil) - } - let callFlutterEchoIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoIntChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let anIntArg = args[0] as! Int64 - api.callFlutterEcho(anIntArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoIntChannel.setMessageHandler(nil) - } - let callFlutterEchoDoubleChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoDoubleChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aDoubleArg = args[0] as! Double - api.callFlutterEcho(aDoubleArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoDoubleChannel.setMessageHandler(nil) - } - let callFlutterEchoStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aStringArg = args[0] as! String - api.callFlutterEcho(aStringArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoStringChannel.setMessageHandler(nil) - } - let callFlutterEchoUint8ListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoUint8ListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let listArg = args[0] as! FlutterStandardTypedData - api.callFlutterEcho(listArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoUint8ListChannel.setMessageHandler(nil) - } - let callFlutterEchoListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let listArg = args[0] as! [Any?] - api.callFlutterEcho(listArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoListChannel.setMessageHandler(nil) - } - let callFlutterEchoEnumListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnumList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoEnumListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let enumListArg = args[0] as! [AnEnum?] - api.callFlutterEcho(enumList: enumListArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoEnumListChannel.setMessageHandler(nil) - } - let callFlutterEchoClassListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoClassList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoClassListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let classListArg = args[0] as! [AllNullableTypes?] - api.callFlutterEcho(classList: classListArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoClassListChannel.setMessageHandler(nil) - } - let callFlutterEchoNonNullEnumListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullEnumList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNonNullEnumListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let enumListArg = args[0] as! [AnEnum] - api.callFlutterEchoNonNull(enumList: enumListArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNonNullEnumListChannel.setMessageHandler(nil) - } - let callFlutterEchoNonNullClassListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullClassList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNonNullClassListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let classListArg = args[0] as! [AllNullableTypes] - api.callFlutterEchoNonNull(classList: classListArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNonNullClassListChannel.setMessageHandler(nil) - } - let callFlutterEchoMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let mapArg = args[0] as! [AnyHashable?: Any?] - api.callFlutterEcho(mapArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoMapChannel.setMessageHandler(nil) - } - let callFlutterEchoStringMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoStringMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoStringMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let stringMapArg = args[0] as! [String?: String?] - api.callFlutterEcho(stringMap: stringMapArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoStringMapChannel.setMessageHandler(nil) - } - let callFlutterEchoIntMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoIntMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoIntMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let intMapArg = args[0] as! [Int64?: Int64?] - api.callFlutterEcho(intMap: intMapArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoIntMapChannel.setMessageHandler(nil) - } - let callFlutterEchoEnumMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnumMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoEnumMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let enumMapArg = args[0] as? [AnEnum?: AnEnum?] - api.callFlutterEcho(enumMap: enumMapArg!) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoEnumMapChannel.setMessageHandler(nil) - } - let callFlutterEchoClassMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoClassMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoClassMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let classMapArg = args[0] as! [Int64?: AllNullableTypes?] - api.callFlutterEcho(classMap: classMapArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoClassMapChannel.setMessageHandler(nil) - } - let callFlutterEchoNonNullStringMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullStringMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNonNullStringMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let stringMapArg = args[0] as! [String: String] - api.callFlutterEchoNonNull(stringMap: stringMapArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNonNullStringMapChannel.setMessageHandler(nil) - } - let callFlutterEchoNonNullIntMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullIntMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNonNullIntMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let intMapArg = args[0] as! [Int64: Int64] - api.callFlutterEchoNonNull(intMap: intMapArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNonNullIntMapChannel.setMessageHandler(nil) - } - let callFlutterEchoNonNullEnumMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullEnumMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNonNullEnumMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let enumMapArg = args[0] as? [AnEnum: AnEnum] - api.callFlutterEchoNonNull(enumMap: enumMapArg!) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNonNullEnumMapChannel.setMessageHandler(nil) - } - let callFlutterEchoNonNullClassMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullClassMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNonNullClassMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let classMapArg = args[0] as! [Int64: AllNullableTypes] - api.callFlutterEchoNonNull(classMap: classMapArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNonNullClassMapChannel.setMessageHandler(nil) - } - let callFlutterEchoEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoEnumChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let anEnumArg = args[0] as! AnEnum - api.callFlutterEcho(anEnumArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoEnumChannel.setMessageHandler(nil) - } - let callFlutterEchoAnotherEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherEnum\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoAnotherEnumChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let anotherEnumArg = args[0] as! AnotherEnum - api.callFlutterEcho(anotherEnumArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoAnotherEnumChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableBoolChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableBoolChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aBoolArg: Bool? = nilOrValue(args[0]) - api.callFlutterEchoNullable(aBoolArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableBoolChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableIntChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let anIntArg: Int64? = nilOrValue(args[0]) - api.callFlutterEchoNullable(anIntArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableIntChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableDoubleChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableDoubleChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aDoubleArg: Double? = nilOrValue(args[0]) - api.callFlutterEchoNullable(aDoubleArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableDoubleChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aStringArg: String? = nilOrValue(args[0]) - api.callFlutterEchoNullable(aStringArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableStringChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableUint8ListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableUint8ListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let listArg: FlutterStandardTypedData? = nilOrValue(args[0]) - api.callFlutterEchoNullable(listArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableUint8ListChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let listArg: [Any?]? = nilOrValue(args[0]) - api.callFlutterEchoNullable(listArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableListChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableEnumListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnumList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableEnumListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let enumListArg: [AnEnum?]? = nilOrValue(args[0]) - api.callFlutterEchoNullable(enumList: enumListArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableEnumListChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableClassListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableClassList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableClassListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let classListArg: [AllNullableTypes?]? = nilOrValue(args[0]) - api.callFlutterEchoNullable(classList: classListArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableClassListChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableNonNullEnumListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableNonNullEnumListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let enumListArg: [AnEnum]? = nilOrValue(args[0]) - api.callFlutterEchoNullableNonNull(enumList: enumListArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableNonNullEnumListChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableNonNullClassListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableNonNullClassListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let classListArg: [AllNullableTypes]? = nilOrValue(args[0]) - api.callFlutterEchoNullableNonNull(classList: classListArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableNonNullClassListChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let mapArg: [AnyHashable?: Any?]? = nilOrValue(args[0]) - api.callFlutterEchoNullable(mapArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableMapChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableStringMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableStringMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableStringMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let stringMapArg: [String?: String?]? = nilOrValue(args[0]) - api.callFlutterEchoNullable(stringMap: stringMapArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableStringMapChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableIntMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableIntMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableIntMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let intMapArg: [Int64?: Int64?]? = nilOrValue(args[0]) - api.callFlutterEchoNullable(intMap: intMapArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableIntMapChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableEnumMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnumMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableEnumMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let enumMapArg: [AnEnum?: AnEnum?]? = args[0] as? [AnEnum?: AnEnum?] - api.callFlutterEchoNullable(enumMap: enumMapArg!) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableEnumMapChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableClassMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableClassMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableClassMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let classMapArg: [Int64?: AllNullableTypes?]? = nilOrValue(args[0]) - api.callFlutterEchoNullable(classMap: classMapArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableClassMapChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableNonNullStringMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullStringMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableNonNullStringMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let stringMapArg: [String: String]? = nilOrValue(args[0]) - api.callFlutterEchoNullableNonNull(stringMap: stringMapArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableNonNullStringMapChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableNonNullIntMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullIntMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableNonNullIntMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let intMapArg: [Int64: Int64]? = nilOrValue(args[0]) - api.callFlutterEchoNullableNonNull(intMap: intMapArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableNonNullIntMapChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableNonNullEnumMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableNonNullEnumMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let enumMapArg: [AnEnum: AnEnum]? = args[0] as? [AnEnum: AnEnum] - api.callFlutterEchoNullableNonNull(enumMap: enumMapArg!) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableNonNullEnumMapChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableNonNullClassMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableNonNullClassMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let classMapArg: [Int64: AllNullableTypes]? = nilOrValue(args[0]) - api.callFlutterEchoNullableNonNull(classMap: classMapArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableNonNullClassMapChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableEnumChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let anEnumArg: AnEnum? = nilOrValue(args[0]) - api.callFlutterEchoNullable(anEnumArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableEnumChannel.setMessageHandler(nil) - } - let callFlutterEchoAnotherNullableEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherNullableEnum\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoAnotherNullableEnumChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let anotherEnumArg: AnotherEnum? = nilOrValue(args[0]) - api.callFlutterEchoNullable(anotherEnumArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoAnotherNullableEnumChannel.setMessageHandler(nil) - } - let callFlutterSmallApiEchoStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterSmallApiEchoStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aStringArg = args[0] as! String - api.callFlutterSmallApiEcho(aStringArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterSmallApiEchoStringChannel.setMessageHandler(nil) - } - } -} -/// The core interface that the Dart platform_test code implements for host -/// integration tests to call into. -/// -/// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift. -protocol FlutterIntegrationCoreApiProtocol { - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic calling. - func noop(completion: @escaping (Result) -> Void) - /// Responds with an error from an async function returning a value. - func throwError(completion: @escaping (Result) -> Void) - /// Responds with an error from an async void function. - func throwErrorFromVoid(completion: @escaping (Result) -> Void) - /// Returns the passed object, to test serialization and deserialization. - func echo( - _ everythingArg: AllTypes, completion: @escaping (Result) -> Void) - /// Returns the passed object, to test serialization and deserialization. - func echoNullable( - _ everythingArg: AllNullableTypes?, - completion: @escaping (Result) -> Void) - /// Returns passed in arguments of multiple types. - /// - /// Tests multiple-arity FlutterApi handling. - func sendMultipleNullableTypes( - aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, - aString aNullableStringArg: String?, - completion: @escaping (Result) -> Void) - /// Returns the passed object, to test serialization and deserialization. - func echoNullable( - _ everythingArg: AllNullableTypesWithoutRecursion?, - completion: @escaping (Result) -> Void) - /// Returns passed in arguments of multiple types. - /// - /// Tests multiple-arity FlutterApi handling. - func sendMultipleNullableTypesWithoutRecursion( - aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, - aString aNullableStringArg: String?, - completion: @escaping (Result) -> Void) - /// Returns the passed boolean, to test serialization and deserialization. - func echo(_ aBoolArg: Bool, completion: @escaping (Result) -> Void) - /// Returns the passed int, to test serialization and deserialization. - func echo(_ anIntArg: Int64, completion: @escaping (Result) -> Void) - /// Returns the passed double, to test serialization and deserialization. - func echo(_ aDoubleArg: Double, completion: @escaping (Result) -> Void) - /// Returns the passed string, to test serialization and deserialization. - func echo(_ aStringArg: String, completion: @escaping (Result) -> Void) - /// Returns the passed byte list, to test serialization and deserialization. - func echo( - _ listArg: FlutterStandardTypedData, - completion: @escaping (Result) -> Void) - /// Returns the passed list, to test serialization and deserialization. - func echo(_ listArg: [Any?], completion: @escaping (Result<[Any?], PigeonError>) -> Void) - /// Returns the passed list, to test serialization and deserialization. - func echo( - enumList enumListArg: [AnEnum?], completion: @escaping (Result<[AnEnum?], PigeonError>) -> Void) - /// Returns the passed list, to test serialization and deserialization. - func echo( - classList classListArg: [AllNullableTypes?], - completion: @escaping (Result<[AllNullableTypes?], PigeonError>) -> Void) - /// Returns the passed list, to test serialization and deserialization. - func echoNonNull( - enumList enumListArg: [AnEnum], completion: @escaping (Result<[AnEnum], PigeonError>) -> Void) - /// Returns the passed list, to test serialization and deserialization. - func echoNonNull( - classList classListArg: [AllNullableTypes], - completion: @escaping (Result<[AllNullableTypes], PigeonError>) -> Void) - /// Returns the passed map, to test serialization and deserialization. - func echo( - _ mapArg: [AnyHashable?: Any?], - completion: @escaping (Result<[AnyHashable?: Any?], PigeonError>) -> Void) - /// Returns the passed map, to test serialization and deserialization. - func echo( - stringMap stringMapArg: [String?: String?], - completion: @escaping (Result<[String?: String?], PigeonError>) -> Void) - /// Returns the passed map, to test serialization and deserialization. - func echo( - intMap intMapArg: [Int64?: Int64?], - completion: @escaping (Result<[Int64?: Int64?], PigeonError>) -> Void) - /// Returns the passed map, to test serialization and deserialization. - func echo( - enumMap enumMapArg: [AnEnum?: AnEnum?], - completion: @escaping (Result<[AnEnum?: AnEnum?], PigeonError>) -> Void) - /// Returns the passed map, to test serialization and deserialization. - func echo( - classMap classMapArg: [Int64?: AllNullableTypes?], - completion: @escaping (Result<[Int64?: AllNullableTypes?], PigeonError>) -> Void) - /// Returns the passed map, to test serialization and deserialization. - func echoNonNull( - stringMap stringMapArg: [String: String], - completion: @escaping (Result<[String: String], PigeonError>) -> Void) - /// Returns the passed map, to test serialization and deserialization. - func echoNonNull( - intMap intMapArg: [Int64: Int64], - completion: @escaping (Result<[Int64: Int64], PigeonError>) -> Void) - /// Returns the passed map, to test serialization and deserialization. - func echoNonNull( - enumMap enumMapArg: [AnEnum: AnEnum], - completion: @escaping (Result<[AnEnum: AnEnum], PigeonError>) -> Void) - /// Returns the passed map, to test serialization and deserialization. - func echoNonNull( - classMap classMapArg: [Int64: AllNullableTypes], - completion: @escaping (Result<[Int64: AllNullableTypes], PigeonError>) -> Void) - /// Returns the passed enum to test serialization and deserialization. - func echo(_ anEnumArg: AnEnum, completion: @escaping (Result) -> Void) - /// Returns the passed enum to test serialization and deserialization. - func echo( - _ anotherEnumArg: AnotherEnum, 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. - func echoNullable(_ anIntArg: Int64?, completion: @escaping (Result) -> Void) - /// Returns the passed double, to test serialization and deserialization. - func echoNullable( - _ aDoubleArg: Double?, completion: @escaping (Result) -> Void) - /// Returns the passed string, to test serialization and deserialization. - func echoNullable( - _ aStringArg: String?, completion: @escaping (Result) -> Void) - /// Returns the passed byte list, to test serialization and deserialization. - func echoNullable( - _ listArg: FlutterStandardTypedData?, - completion: @escaping (Result) -> Void) - /// Returns the passed list, to test serialization and deserialization. - func echoNullable( - _ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void) - /// Returns the passed list, to test serialization and deserialization. - func echoNullable( - enumList enumListArg: [AnEnum?]?, - completion: @escaping (Result<[AnEnum?]?, PigeonError>) -> Void) - /// Returns the passed list, to test serialization and deserialization. - func echoNullable( - classList classListArg: [AllNullableTypes?]?, - completion: @escaping (Result<[AllNullableTypes?]?, PigeonError>) -> Void) - /// Returns the passed list, to test serialization and deserialization. - func echoNullableNonNull( - enumList enumListArg: [AnEnum]?, completion: @escaping (Result<[AnEnum]?, PigeonError>) -> Void) - /// Returns the passed list, to test serialization and deserialization. - func echoNullableNonNull( - classList classListArg: [AllNullableTypes]?, - completion: @escaping (Result<[AllNullableTypes]?, PigeonError>) -> Void) - /// Returns the passed map, to test serialization and deserialization. - func echoNullable( - _ mapArg: [AnyHashable?: Any?]?, - completion: @escaping (Result<[AnyHashable?: Any?]?, PigeonError>) -> Void) - /// Returns the passed map, to test serialization and deserialization. - func echoNullable( - stringMap stringMapArg: [String?: String?]?, - completion: @escaping (Result<[String?: String?]?, PigeonError>) -> Void) - /// Returns the passed map, to test serialization and deserialization. - func echoNullable( - intMap intMapArg: [Int64?: Int64?]?, - completion: @escaping (Result<[Int64?: Int64?]?, PigeonError>) -> Void) - /// Returns the passed map, to test serialization and deserialization. - func echoNullable( - enumMap enumMapArg: [AnEnum?: AnEnum?]?, - completion: @escaping (Result<[AnEnum?: AnEnum?]?, PigeonError>) -> Void) - /// Returns the passed map, to test serialization and deserialization. - func echoNullable( - classMap classMapArg: [Int64?: AllNullableTypes?]?, - completion: @escaping (Result<[Int64?: AllNullableTypes?]?, PigeonError>) -> Void) - /// Returns the passed map, to test serialization and deserialization. - func echoNullableNonNull( - stringMap stringMapArg: [String: String]?, - completion: @escaping (Result<[String: String]?, PigeonError>) -> Void) - /// Returns the passed map, to test serialization and deserialization. - func echoNullableNonNull( - intMap intMapArg: [Int64: Int64]?, - completion: @escaping (Result<[Int64: Int64]?, PigeonError>) -> Void) - /// Returns the passed map, to test serialization and deserialization. - func echoNullableNonNull( - enumMap enumMapArg: [AnEnum: AnEnum]?, - completion: @escaping (Result<[AnEnum: AnEnum]?, PigeonError>) -> Void) - /// Returns the passed map, to test serialization and deserialization. - func echoNullableNonNull( - classMap classMapArg: [Int64: AllNullableTypes]?, - completion: @escaping (Result<[Int64: AllNullableTypes]?, PigeonError>) -> Void) - /// Returns the passed enum to test serialization and deserialization. - func echoNullable( - _ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void) - /// Returns the passed enum to test serialization and deserialization. - func echoNullable( - _ anotherEnumArg: AnotherEnum?, - 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) - /// Returns the passed in generic Object asynchronously. - func echoAsync(_ aStringArg: String, completion: @escaping (Result) -> Void) -} -class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { - private let binaryMessenger: FlutterBinaryMessenger - private let messageChannelSuffix: String - init(binaryMessenger: FlutterBinaryMessenger, messageChannelSuffix: String = "") { - self.binaryMessenger = binaryMessenger - self.messageChannelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" - } - var codec: CoreTestsPigeonCodec { - return CoreTestsPigeonCodec.shared - } - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic calling. - func noop(completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage(nil) { 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(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(())) - } - } - } - /// Responds with an error from an async function returning a value. - func throwError(completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage(nil) { 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(PigeonError(code: code, message: message, details: details))) - } else { - let result: Any? = listResponse[0] - completion(.success(result)) - } - } - } - /// Responds with an error from an async void function. - func throwErrorFromVoid(completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage(nil) { 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(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(())) - } - } - } - /// Returns the passed object, to test serialization and deserialization. - func echo( - _ everythingArg: AllTypes, completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([everythingArg] 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! AllTypes - completion(.success(result)) - } - } - } - /// Returns the passed object, to test serialization and deserialization. - func echoNullable( - _ everythingArg: AllNullableTypes?, - completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([everythingArg] 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(PigeonError(code: code, message: message, details: details))) - } else { - let result: AllNullableTypes? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - /// Returns passed in arguments of multiple types. - /// - /// Tests multiple-arity FlutterApi handling. - func sendMultipleNullableTypes( - aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, - aString aNullableStringArg: String?, - completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { - response in - 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! AllNullableTypes - completion(.success(result)) - } - } - } - /// Returns the passed object, to test serialization and deserialization. - func echoNullable( - _ everythingArg: AllNullableTypesWithoutRecursion?, - completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([everythingArg] 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(PigeonError(code: code, message: message, details: details))) - } else { - let result: AllNullableTypesWithoutRecursion? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - /// Returns passed in arguments of multiple types. - /// - /// Tests multiple-arity FlutterApi handling. - func sendMultipleNullableTypesWithoutRecursion( - aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, - aString aNullableStringArg: String?, - completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { - response in - 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! AllNullableTypesWithoutRecursion - completion(.success(result)) - } - } - } - /// Returns the passed boolean, to test serialization and deserialization. - func echo(_ aBoolArg: Bool, completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aBoolArg] 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! Bool - completion(.success(result)) - } - } - } - /// Returns the passed int, to test serialization and deserialization. - func echo(_ anIntArg: Int64, completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([anIntArg] 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! Int64 - completion(.success(result)) - } - } - } - /// Returns the passed double, to test serialization and deserialization. - func echo(_ aDoubleArg: Double, completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aDoubleArg] 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! Double - completion(.success(result)) - } - } - } - /// Returns the passed string, to test serialization and deserialization. - func echo(_ aStringArg: String, completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! String - completion(.success(result)) - } - } - } - /// Returns the passed byte list, to test serialization and deserialization. - func echo( - _ listArg: FlutterStandardTypedData, - completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([listArg] 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! FlutterStandardTypedData - completion(.success(result)) - } - } - } - /// Returns the passed list, to test serialization and deserialization. - func echo(_ listArg: [Any?], completion: @escaping (Result<[Any?], PigeonError>) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([listArg] 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! [Any?] - completion(.success(result)) - } - } - } - /// Returns the passed list, to test serialization and deserialization. - func echo( - enumList enumListArg: [AnEnum?], completion: @escaping (Result<[AnEnum?], PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumList\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([enumListArg] 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! [AnEnum?] - completion(.success(result)) - } - } - } - /// Returns the passed list, to test serialization and deserialization. - func echo( - classList classListArg: [AllNullableTypes?], - completion: @escaping (Result<[AllNullableTypes?], PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassList\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([classListArg] 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! [AllNullableTypes?] - completion(.success(result)) - } - } - } - /// Returns the passed list, to test serialization and deserialization. - func echoNonNull( - enumList enumListArg: [AnEnum], completion: @escaping (Result<[AnEnum], PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullEnumList\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([enumListArg] 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! [AnEnum] - completion(.success(result)) - } - } - } - /// Returns the passed list, to test serialization and deserialization. - func echoNonNull( - classList classListArg: [AllNullableTypes], - completion: @escaping (Result<[AllNullableTypes], PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullClassList\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([classListArg] 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! [AllNullableTypes] - completion(.success(result)) - } - } - } - /// Returns the passed map, to test serialization and deserialization. - func echo( - _ mapArg: [AnyHashable?: Any?], - completion: @escaping (Result<[AnyHashable?: Any?], PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([mapArg] 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! [AnyHashable?: Any?] - completion(.success(result)) - } - } - } - /// Returns the passed map, to test serialization and deserialization. - func echo( - stringMap stringMapArg: [String?: String?], - completion: @escaping (Result<[String?: String?], PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoStringMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([stringMapArg] 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! [String?: String?] - completion(.success(result)) - } - } - } - /// Returns the passed map, to test serialization and deserialization. - func echo( - intMap intMapArg: [Int64?: Int64?], - completion: @escaping (Result<[Int64?: Int64?], PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoIntMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([intMapArg] 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! [Int64?: Int64?] - completion(.success(result)) - } - } - } - /// Returns the passed map, to test serialization and deserialization. - func echo( - enumMap enumMapArg: [AnEnum?: AnEnum?], - completion: @escaping (Result<[AnEnum?: AnEnum?], PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([enumMapArg] 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as? [AnEnum?: AnEnum?] - completion(.success(result!)) - } - } - } - /// Returns the passed map, to test serialization and deserialization. - func echo( - classMap classMapArg: [Int64?: AllNullableTypes?], - completion: @escaping (Result<[Int64?: AllNullableTypes?], PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([classMapArg] 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! [Int64?: AllNullableTypes?] - completion(.success(result)) - } - } - } - /// Returns the passed map, to test serialization and deserialization. - func echoNonNull( - stringMap stringMapArg: [String: String], - completion: @escaping (Result<[String: String], PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullStringMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([stringMapArg] 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! [String: String] - completion(.success(result)) - } - } - } - /// Returns the passed map, to test serialization and deserialization. - func echoNonNull( - intMap intMapArg: [Int64: Int64], - completion: @escaping (Result<[Int64: Int64], PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullIntMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([intMapArg] 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! [Int64: Int64] - completion(.success(result)) - } - } - } - /// Returns the passed map, to test serialization and deserialization. - func echoNonNull( - enumMap enumMapArg: [AnEnum: AnEnum], - completion: @escaping (Result<[AnEnum: AnEnum], PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullEnumMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([enumMapArg] 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as? [AnEnum: AnEnum] - completion(.success(result!)) - } - } - } - /// Returns the passed map, to test serialization and deserialization. - func echoNonNull( - classMap classMapArg: [Int64: AllNullableTypes], - completion: @escaping (Result<[Int64: AllNullableTypes], PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullClassMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([classMapArg] 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! [Int64: AllNullableTypes] - completion(.success(result)) - } - } - } - /// Returns the passed enum to test serialization and deserialization. - func echo(_ anEnumArg: AnEnum, completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([anEnumArg] 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! AnEnum - completion(.success(result)) - } - } - } - /// Returns the passed enum to test serialization and deserialization. - func echo( - _ anotherEnumArg: AnotherEnum, completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAnotherEnum\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([anotherEnumArg] 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! AnotherEnum - 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\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aBoolArg] as [Any?]) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - 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(PigeonError(code: code, message: message, details: details))) - } else { - let result: Bool? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - /// Returns the passed int, to test serialization and deserialization. - func echoNullable(_ anIntArg: Int64?, completion: @escaping (Result) -> Void) - { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([anIntArg] 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(PigeonError(code: code, message: message, details: details))) - } else { - let result: Int64? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - /// Returns the passed double, to test serialization and deserialization. - func echoNullable( - _ aDoubleArg: Double?, completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aDoubleArg] 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(PigeonError(code: code, message: message, details: details))) - } else { - let result: Double? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - /// Returns the passed string, to test serialization and deserialization. - func echoNullable( - _ aStringArg: String?, completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - 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(PigeonError(code: code, message: message, details: details))) - } else { - let result: String? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - /// Returns the passed byte list, to test serialization and deserialization. - func echoNullable( - _ listArg: FlutterStandardTypedData?, - completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([listArg] 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(PigeonError(code: code, message: message, details: details))) - } else { - let result: FlutterStandardTypedData? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - /// Returns the passed list, to test serialization and deserialization. - func echoNullable( - _ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([listArg] 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(PigeonError(code: code, message: message, details: details))) - } else { - let result: [Any?]? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - /// Returns the passed list, to test serialization and deserialization. - func echoNullable( - enumList enumListArg: [AnEnum?]?, - completion: @escaping (Result<[AnEnum?]?, PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnumList\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([enumListArg] 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(PigeonError(code: code, message: message, details: details))) - } else { - let result: [AnEnum?]? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - /// Returns the passed list, to test serialization and deserialization. - func echoNullable( - classList classListArg: [AllNullableTypes?]?, - completion: @escaping (Result<[AllNullableTypes?]?, PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableClassList\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([classListArg] 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(PigeonError(code: code, message: message, details: details))) - } else { - let result: [AllNullableTypes?]? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - /// Returns the passed list, to test serialization and deserialization. - func echoNullableNonNull( - enumList enumListArg: [AnEnum]?, completion: @escaping (Result<[AnEnum]?, PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullEnumList\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([enumListArg] 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(PigeonError(code: code, message: message, details: details))) - } else { - let result: [AnEnum]? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - /// Returns the passed list, to test serialization and deserialization. - func echoNullableNonNull( - classList classListArg: [AllNullableTypes]?, - completion: @escaping (Result<[AllNullableTypes]?, PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullClassList\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([classListArg] 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(PigeonError(code: code, message: message, details: details))) - } else { - let result: [AllNullableTypes]? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - /// Returns the passed map, to test serialization and deserialization. - func echoNullable( - _ mapArg: [AnyHashable?: Any?]?, - completion: @escaping (Result<[AnyHashable?: Any?]?, PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([mapArg] 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(PigeonError(code: code, message: message, details: details))) - } else { - let result: [AnyHashable?: Any?]? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - /// Returns the passed map, to test serialization and deserialization. - func echoNullable( - stringMap stringMapArg: [String?: String?]?, - completion: @escaping (Result<[String?: String?]?, PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableStringMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([stringMapArg] 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(PigeonError(code: code, message: message, details: details))) - } else { - let result: [String?: String?]? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - /// Returns the passed map, to test serialization and deserialization. - func echoNullable( - intMap intMapArg: [Int64?: Int64?]?, - completion: @escaping (Result<[Int64?: Int64?]?, PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableIntMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([intMapArg] 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(PigeonError(code: code, message: message, details: details))) - } else { - let result: [Int64?: Int64?]? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - /// Returns the passed map, to test serialization and deserialization. - func echoNullable( - enumMap enumMapArg: [AnEnum?: AnEnum?]?, - completion: @escaping (Result<[AnEnum?: AnEnum?]?, PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnumMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([enumMapArg] 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(PigeonError(code: code, message: message, details: details))) - } else { - let result: [AnEnum?: AnEnum?]? = listResponse[0] as? [AnEnum?: AnEnum?] - completion(.success(result!)) - } - } - } - /// Returns the passed map, to test serialization and deserialization. - func echoNullable( - classMap classMapArg: [Int64?: AllNullableTypes?]?, - completion: @escaping (Result<[Int64?: AllNullableTypes?]?, PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableClassMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([classMapArg] 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(PigeonError(code: code, message: message, details: details))) - } else { - let result: [Int64?: AllNullableTypes?]? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - /// Returns the passed map, to test serialization and deserialization. - func echoNullableNonNull( - stringMap stringMapArg: [String: String]?, - completion: @escaping (Result<[String: String]?, PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullStringMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([stringMapArg] 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(PigeonError(code: code, message: message, details: details))) - } else { - let result: [String: String]? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - /// Returns the passed map, to test serialization and deserialization. - func echoNullableNonNull( - intMap intMapArg: [Int64: Int64]?, - completion: @escaping (Result<[Int64: Int64]?, PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullIntMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([intMapArg] 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(PigeonError(code: code, message: message, details: details))) - } else { - let result: [Int64: Int64]? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - /// Returns the passed map, to test serialization and deserialization. - func echoNullableNonNull( - enumMap enumMapArg: [AnEnum: AnEnum]?, - completion: @escaping (Result<[AnEnum: AnEnum]?, PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullEnumMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([enumMapArg] 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(PigeonError(code: code, message: message, details: details))) - } else { - let result: [AnEnum: AnEnum]? = listResponse[0] as? [AnEnum: AnEnum] - completion(.success(result!)) - } - } - } - /// Returns the passed map, to test serialization and deserialization. - func echoNullableNonNull( - classMap classMapArg: [Int64: AllNullableTypes]?, - completion: @escaping (Result<[Int64: AllNullableTypes]?, PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullClassMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([classMapArg] 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(PigeonError(code: code, message: message, details: details))) - } else { - let result: [Int64: AllNullableTypes]? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - /// Returns the passed enum to test serialization and deserialization. - func echoNullable( - _ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([anEnumArg] 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(PigeonError(code: code, message: message, details: details))) - } else { - let result: AnEnum? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - /// Returns the passed enum to test serialization and deserialization. - func echoNullable( - _ anotherEnumArg: AnotherEnum?, - completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAnotherNullableEnum\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([anotherEnumArg] 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(PigeonError(code: code, message: message, details: details))) - } else { - let result: AnotherEnum? = 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) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage(nil) { response in - guard let listResponse = response as? [Any?] else { - completion(.failure(createConnectionError(withChannelName: channelName))) - 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(PigeonError(code: code, message: message, details: details))) - } else { - completion(.success(())) - } - } - } - /// Returns the passed in generic Object asynchronously. - func echoAsync(_ aStringArg: String, completion: @escaping (Result) -> Void) - { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! String - completion(.success(result)) - } - } - } -} -/// An API that can be implemented for minimal, compile-only tests. -/// -/// Generated protocol from Pigeon that represents a handler of messages from Flutter. -protocol HostTrivialApi { - func noop() throws -} - -/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. -class HostTrivialApiSetup { - static var codec: FlutterStandardMessageCodec { CoreTestsPigeonCodec.shared } - /// Sets up an instance of `HostTrivialApi` to handle messages through the `binaryMessenger`. - static func setUp( - binaryMessenger: FlutterBinaryMessenger, api: HostTrivialApi?, messageChannelSuffix: String = "" - ) { - let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" - let noopChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - noopChannel.setMessageHandler { _, reply in - do { - try api.noop() - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - noopChannel.setMessageHandler(nil) - } - } -} -/// A simple API implemented in some unit tests. -/// -/// Generated protocol from Pigeon that represents a handler of messages from Flutter. -protocol HostSmallApi { - func echo(aString: String, completion: @escaping (Result) -> Void) - func voidVoid(completion: @escaping (Result) -> Void) -} - -/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. -class HostSmallApiSetup { - static var codec: FlutterStandardMessageCodec { CoreTestsPigeonCodec.shared } - /// Sets up an instance of `HostSmallApi` to handle messages through the `binaryMessenger`. - static func setUp( - binaryMessenger: FlutterBinaryMessenger, api: HostSmallApi?, messageChannelSuffix: String = "" - ) { - let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" - let echoChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aStringArg = args[0] as! String - api.echo(aString: aStringArg) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoChannel.setMessageHandler(nil) - } - let voidVoidChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - voidVoidChannel.setMessageHandler { _, reply in - api.voidVoid { result in - switch result { - case .success: - reply(wrapResult(nil)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - voidVoidChannel.setMessageHandler(nil) - } - } -} -/// A simple API called in some unit tests. -/// -/// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift. -protocol FlutterSmallApiProtocol { - func echo(_ msgArg: TestMessage, completion: @escaping (Result) -> Void) - func echo(string aStringArg: String, completion: @escaping (Result) -> Void) -} -class FlutterSmallApi: FlutterSmallApiProtocol { - private let binaryMessenger: FlutterBinaryMessenger - private let messageChannelSuffix: String - init(binaryMessenger: FlutterBinaryMessenger, messageChannelSuffix: String = "") { - self.binaryMessenger = binaryMessenger - self.messageChannelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" - } - var codec: CoreTestsPigeonCodec { - return CoreTestsPigeonCodec.shared - } - func echo(_ msgArg: TestMessage, completion: @escaping (Result) -> Void) - { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([msgArg] 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! TestMessage - completion(.success(result)) - } - } - } - func echo(string aStringArg: String, completion: @escaping (Result) -> Void) - { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - 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(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! String - completion(.success(result)) - } - } - } -} diff --git a/packages/pigeon/platform_tests/test_plugin/macos/Classes/EventChannelTests.gen.swift b/packages/pigeon/platform_tests/test_plugin/macos/Classes/EventChannelTests.gen.swift deleted file mode 100644 index 16b881e2ea5..00000000000 --- a/packages/pigeon/platform_tests/test_plugin/macos/Classes/EventChannelTests.gen.swift +++ /dev/null @@ -1,707 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// -// Autogenerated from Pigeon, do not edit directly. -// See also: https://pub.dev/packages/pigeon - -import Foundation - -#if os(iOS) - import Flutter -#elseif os(macOS) - import FlutterMacOS -#else - #error("Unsupported platform.") -#endif - -/// Error class for passing custom error details to Dart side. -final class EventChannelTestsError: Error { - let code: String - let message: String? - let details: Sendable? - - init(code: String, message: String?, details: Sendable?) { - self.code = code - self.message = message - self.details = details - } - - var localizedDescription: String { - return - "EventChannelTestsError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" - } -} - -private func isNullish(_ value: Any?) -> Bool { - return value is NSNull || value == nil -} - -private func nilOrValue(_ value: Any?) -> T? { - if value is NSNull { return nil } - return value as! T? -} - -func deepEqualsEventChannelTests(_ lhs: Any?, _ rhs: Any?) -> Bool { - let cleanLhs = nilOrValue(lhs) as Any? - let cleanRhs = nilOrValue(rhs) as Any? - switch (cleanLhs, cleanRhs) { - case (nil, nil): - return true - - case (nil, _), (_, nil): - return false - - case is (Void, Void): - return true - - case let (cleanLhsHashable, cleanRhsHashable) as (AnyHashable, AnyHashable): - return cleanLhsHashable == cleanRhsHashable - - case let (cleanLhsArray, cleanRhsArray) as ([Any?], [Any?]): - guard cleanLhsArray.count == cleanRhsArray.count else { return false } - for (index, element) in cleanLhsArray.enumerated() { - if !deepEqualsEventChannelTests(element, cleanRhsArray[index]) { - return false - } - } - return true - - case let (cleanLhsDictionary, cleanRhsDictionary) as ([AnyHashable: Any?], [AnyHashable: Any?]): - guard cleanLhsDictionary.count == cleanRhsDictionary.count else { return false } - for (key, cleanLhsValue) in cleanLhsDictionary { - guard cleanRhsDictionary.index(forKey: key) != nil else { return false } - if !deepEqualsEventChannelTests(cleanLhsValue, cleanRhsDictionary[key]!) { - return false - } - } - return true - - default: - // Any other type shouldn't be able to be used with pigeon. File an issue if you find this to be untrue. - return false - } -} - -func deepHashEventChannelTests(value: Any?, hasher: inout Hasher) { - if let valueList = value as? [AnyHashable] { - for item in valueList { deepHashEventChannelTests(value: item, hasher: &hasher) } - return - } - - if let valueDict = value as? [AnyHashable: AnyHashable] { - for key in valueDict.keys { - hasher.combine(key) - deepHashEventChannelTests(value: valueDict[key]!, hasher: &hasher) - } - return - } - - if let hashableValue = value as? AnyHashable { - hasher.combine(hashableValue.hashValue) - } - - return hasher.combine(String(describing: value)) -} - -enum EventEnum: Int { - case one = 0 - case two = 1 - case three = 2 - case fortyTwo = 3 - case fourHundredTwentyTwo = 4 -} - -enum AnotherEventEnum: Int { - case justInCase = 0 -} - -/// A class containing all supported nullable types. -/// -/// Generated class from Pigeon that represents data sent in messages. -class EventAllNullableTypes: Hashable { - init( - aNullableBool: Bool? = nil, - aNullableInt: Int64? = nil, - aNullableInt64: Int64? = nil, - aNullableDouble: Double? = nil, - aNullableByteArray: FlutterStandardTypedData? = nil, - aNullable4ByteArray: FlutterStandardTypedData? = nil, - aNullable8ByteArray: FlutterStandardTypedData? = nil, - aNullableFloatArray: FlutterStandardTypedData? = nil, - aNullableEnum: EventEnum? = nil, - anotherNullableEnum: AnotherEventEnum? = nil, - aNullableString: String? = nil, - aNullableObject: Any? = nil, - allNullableTypes: EventAllNullableTypes? = nil, - list: [Any?]? = nil, - stringList: [String?]? = nil, - intList: [Int64?]? = nil, - doubleList: [Double?]? = nil, - boolList: [Bool?]? = nil, - enumList: [EventEnum?]? = nil, - objectList: [Any?]? = nil, - listList: [[Any?]?]? = nil, - mapList: [[AnyHashable?: Any?]?]? = nil, - recursiveClassList: [EventAllNullableTypes?]? = nil, - map: [AnyHashable?: Any?]? = nil, - stringMap: [String?: String?]? = nil, - intMap: [Int64?: Int64?]? = nil, - enumMap: [EventEnum?: EventEnum?]? = nil, - objectMap: [AnyHashable?: Any?]? = nil, - listMap: [Int64?: [Any?]?]? = nil, - mapMap: [Int64?: [AnyHashable?: Any?]?]? = nil, - recursiveClassMap: [Int64?: EventAllNullableTypes?]? = nil - ) { - self.aNullableBool = aNullableBool - self.aNullableInt = aNullableInt - self.aNullableInt64 = aNullableInt64 - self.aNullableDouble = aNullableDouble - self.aNullableByteArray = aNullableByteArray - self.aNullable4ByteArray = aNullable4ByteArray - self.aNullable8ByteArray = aNullable8ByteArray - self.aNullableFloatArray = aNullableFloatArray - self.aNullableEnum = aNullableEnum - self.anotherNullableEnum = anotherNullableEnum - self.aNullableString = aNullableString - self.aNullableObject = aNullableObject - self.allNullableTypes = allNullableTypes - self.list = list - self.stringList = stringList - self.intList = intList - self.doubleList = doubleList - self.boolList = boolList - self.enumList = enumList - self.objectList = objectList - self.listList = listList - self.mapList = mapList - self.recursiveClassList = recursiveClassList - self.map = map - self.stringMap = stringMap - self.intMap = intMap - self.enumMap = enumMap - self.objectMap = objectMap - self.listMap = listMap - self.mapMap = mapMap - self.recursiveClassMap = recursiveClassMap - } - var aNullableBool: Bool? - var aNullableInt: Int64? - var aNullableInt64: Int64? - var aNullableDouble: Double? - var aNullableByteArray: FlutterStandardTypedData? - var aNullable4ByteArray: FlutterStandardTypedData? - var aNullable8ByteArray: FlutterStandardTypedData? - var aNullableFloatArray: FlutterStandardTypedData? - var aNullableEnum: EventEnum? - var anotherNullableEnum: AnotherEventEnum? - var aNullableString: String? - var aNullableObject: Any? - var allNullableTypes: EventAllNullableTypes? - var list: [Any?]? - var stringList: [String?]? - var intList: [Int64?]? - var doubleList: [Double?]? - var boolList: [Bool?]? - var enumList: [EventEnum?]? - var objectList: [Any?]? - var listList: [[Any?]?]? - var mapList: [[AnyHashable?: Any?]?]? - var recursiveClassList: [EventAllNullableTypes?]? - var map: [AnyHashable?: Any?]? - var stringMap: [String?: String?]? - var intMap: [Int64?: Int64?]? - var enumMap: [EventEnum?: EventEnum?]? - var objectMap: [AnyHashable?: Any?]? - var listMap: [Int64?: [Any?]?]? - var mapMap: [Int64?: [AnyHashable?: Any?]?]? - var recursiveClassMap: [Int64?: EventAllNullableTypes?]? - - // swift-format-ignore: AlwaysUseLowerCamelCase - static func fromList(_ pigeonVar_list: [Any?]) -> EventAllNullableTypes? { - let aNullableBool: Bool? = nilOrValue(pigeonVar_list[0]) - let aNullableInt: Int64? = nilOrValue(pigeonVar_list[1]) - let aNullableInt64: Int64? = nilOrValue(pigeonVar_list[2]) - let aNullableDouble: Double? = nilOrValue(pigeonVar_list[3]) - let aNullableByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[4]) - let aNullable4ByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[5]) - let aNullable8ByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[6]) - let aNullableFloatArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[7]) - let aNullableEnum: EventEnum? = nilOrValue(pigeonVar_list[8]) - let anotherNullableEnum: AnotherEventEnum? = nilOrValue(pigeonVar_list[9]) - let aNullableString: String? = nilOrValue(pigeonVar_list[10]) - let aNullableObject: Any? = pigeonVar_list[11] - let allNullableTypes: EventAllNullableTypes? = nilOrValue(pigeonVar_list[12]) - let list: [Any?]? = nilOrValue(pigeonVar_list[13]) - let stringList: [String?]? = nilOrValue(pigeonVar_list[14]) - let intList: [Int64?]? = nilOrValue(pigeonVar_list[15]) - let doubleList: [Double?]? = nilOrValue(pigeonVar_list[16]) - let boolList: [Bool?]? = nilOrValue(pigeonVar_list[17]) - let enumList: [EventEnum?]? = nilOrValue(pigeonVar_list[18]) - let objectList: [Any?]? = nilOrValue(pigeonVar_list[19]) - let listList: [[Any?]?]? = nilOrValue(pigeonVar_list[20]) - let mapList: [[AnyHashable?: Any?]?]? = nilOrValue(pigeonVar_list[21]) - let recursiveClassList: [EventAllNullableTypes?]? = nilOrValue(pigeonVar_list[22]) - let map: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[23]) - let stringMap: [String?: String?]? = nilOrValue(pigeonVar_list[24]) - let intMap: [Int64?: Int64?]? = nilOrValue(pigeonVar_list[25]) - let enumMap: [EventEnum?: EventEnum?]? = pigeonVar_list[26] as? [EventEnum?: EventEnum?] - let objectMap: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[27]) - let listMap: [Int64?: [Any?]?]? = nilOrValue(pigeonVar_list[28]) - let mapMap: [Int64?: [AnyHashable?: Any?]?]? = nilOrValue(pigeonVar_list[29]) - let recursiveClassMap: [Int64?: EventAllNullableTypes?]? = nilOrValue(pigeonVar_list[30]) - - return EventAllNullableTypes( - aNullableBool: aNullableBool, - aNullableInt: aNullableInt, - aNullableInt64: aNullableInt64, - aNullableDouble: aNullableDouble, - aNullableByteArray: aNullableByteArray, - aNullable4ByteArray: aNullable4ByteArray, - aNullable8ByteArray: aNullable8ByteArray, - aNullableFloatArray: aNullableFloatArray, - aNullableEnum: aNullableEnum, - anotherNullableEnum: anotherNullableEnum, - aNullableString: aNullableString, - aNullableObject: aNullableObject, - allNullableTypes: allNullableTypes, - list: list, - stringList: stringList, - intList: intList, - doubleList: doubleList, - boolList: boolList, - enumList: enumList, - objectList: objectList, - listList: listList, - mapList: mapList, - recursiveClassList: recursiveClassList, - map: map, - stringMap: stringMap, - intMap: intMap, - enumMap: enumMap, - objectMap: objectMap, - listMap: listMap, - mapMap: mapMap, - recursiveClassMap: recursiveClassMap - ) - } - func toList() -> [Any?] { - return [ - aNullableBool, - aNullableInt, - aNullableInt64, - aNullableDouble, - aNullableByteArray, - aNullable4ByteArray, - aNullable8ByteArray, - aNullableFloatArray, - aNullableEnum, - anotherNullableEnum, - aNullableString, - aNullableObject, - allNullableTypes, - list, - stringList, - intList, - doubleList, - boolList, - enumList, - objectList, - listList, - mapList, - recursiveClassList, - map, - stringMap, - intMap, - enumMap, - objectMap, - listMap, - mapMap, - recursiveClassMap, - ] - } - static func == (lhs: EventAllNullableTypes, rhs: EventAllNullableTypes) -> Bool { - if lhs === rhs { - return true - } - return deepEqualsEventChannelTests(lhs.toList(), rhs.toList()) - } - func hash(into hasher: inout Hasher) { - deepHashEventChannelTests(value: toList(), hasher: &hasher) - } -} - -/// Generated class from Pigeon that represents data sent in messages. -/// This protocol should not be extended by any user class outside of the generated file. -protocol PlatformEvent { - -} - -/// Generated class from Pigeon that represents data sent in messages. -struct IntEvent: PlatformEvent { - var value: Int64 - - // swift-format-ignore: AlwaysUseLowerCamelCase - static func fromList(_ pigeonVar_list: [Any?]) -> IntEvent? { - let value = pigeonVar_list[0] as! Int64 - - return IntEvent( - value: value - ) - } - func toList() -> [Any?] { - return [ - value - ] - } - static func == (lhs: IntEvent, rhs: IntEvent) -> Bool { - return deepEqualsEventChannelTests(lhs.toList(), rhs.toList()) - } - func hash(into hasher: inout Hasher) { - deepHashEventChannelTests(value: toList(), hasher: &hasher) - } -} - -/// Generated class from Pigeon that represents data sent in messages. -struct StringEvent: PlatformEvent { - var value: String - - // swift-format-ignore: AlwaysUseLowerCamelCase - static func fromList(_ pigeonVar_list: [Any?]) -> StringEvent? { - let value = pigeonVar_list[0] as! String - - return StringEvent( - value: value - ) - } - func toList() -> [Any?] { - return [ - value - ] - } - static func == (lhs: StringEvent, rhs: StringEvent) -> Bool { - return deepEqualsEventChannelTests(lhs.toList(), rhs.toList()) - } - func hash(into hasher: inout Hasher) { - deepHashEventChannelTests(value: toList(), hasher: &hasher) - } -} - -/// Generated class from Pigeon that represents data sent in messages. -struct BoolEvent: PlatformEvent { - var value: Bool - - // swift-format-ignore: AlwaysUseLowerCamelCase - static func fromList(_ pigeonVar_list: [Any?]) -> BoolEvent? { - let value = pigeonVar_list[0] as! Bool - - return BoolEvent( - value: value - ) - } - func toList() -> [Any?] { - return [ - value - ] - } - static func == (lhs: BoolEvent, rhs: BoolEvent) -> Bool { - return deepEqualsEventChannelTests(lhs.toList(), rhs.toList()) - } - func hash(into hasher: inout Hasher) { - deepHashEventChannelTests(value: toList(), hasher: &hasher) - } -} - -/// Generated class from Pigeon that represents data sent in messages. -struct DoubleEvent: PlatformEvent { - var value: Double - - // swift-format-ignore: AlwaysUseLowerCamelCase - static func fromList(_ pigeonVar_list: [Any?]) -> DoubleEvent? { - let value = pigeonVar_list[0] as! Double - - return DoubleEvent( - value: value - ) - } - func toList() -> [Any?] { - return [ - value - ] - } - static func == (lhs: DoubleEvent, rhs: DoubleEvent) -> Bool { - return deepEqualsEventChannelTests(lhs.toList(), rhs.toList()) - } - func hash(into hasher: inout Hasher) { - deepHashEventChannelTests(value: toList(), hasher: &hasher) - } -} - -/// Generated class from Pigeon that represents data sent in messages. -struct ObjectsEvent: PlatformEvent { - var value: Any - - // swift-format-ignore: AlwaysUseLowerCamelCase - static func fromList(_ pigeonVar_list: [Any?]) -> ObjectsEvent? { - let value = pigeonVar_list[0]! - - return ObjectsEvent( - value: value - ) - } - func toList() -> [Any?] { - return [ - value - ] - } - static func == (lhs: ObjectsEvent, rhs: ObjectsEvent) -> Bool { - return deepEqualsEventChannelTests(lhs.toList(), rhs.toList()) - } - func hash(into hasher: inout Hasher) { - deepHashEventChannelTests(value: toList(), hasher: &hasher) - } -} - -/// Generated class from Pigeon that represents data sent in messages. -struct EnumEvent: PlatformEvent { - var value: EventEnum - - // swift-format-ignore: AlwaysUseLowerCamelCase - static func fromList(_ pigeonVar_list: [Any?]) -> EnumEvent? { - let value = pigeonVar_list[0] as! EventEnum - - return EnumEvent( - value: value - ) - } - func toList() -> [Any?] { - return [ - value - ] - } - static func == (lhs: EnumEvent, rhs: EnumEvent) -> Bool { - return deepEqualsEventChannelTests(lhs.toList(), rhs.toList()) - } - func hash(into hasher: inout Hasher) { - deepHashEventChannelTests(value: toList(), hasher: &hasher) - } -} - -/// Generated class from Pigeon that represents data sent in messages. -struct ClassEvent: PlatformEvent { - var value: EventAllNullableTypes - - // swift-format-ignore: AlwaysUseLowerCamelCase - static func fromList(_ pigeonVar_list: [Any?]) -> ClassEvent? { - let value = pigeonVar_list[0] as! EventAllNullableTypes - - return ClassEvent( - value: value - ) - } - func toList() -> [Any?] { - return [ - value - ] - } - static func == (lhs: ClassEvent, rhs: ClassEvent) -> Bool { - return deepEqualsEventChannelTests(lhs.toList(), rhs.toList()) - } - func hash(into hasher: inout Hasher) { - deepHashEventChannelTests(value: toList(), hasher: &hasher) - } -} - -private class EventChannelTestsPigeonCodecReader: FlutterStandardReader { - override func readValue(ofType type: UInt8) -> Any? { - switch type { - case 129: - let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) - if let enumResultAsInt = enumResultAsInt { - return EventEnum(rawValue: enumResultAsInt) - } - return nil - case 130: - let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) - if let enumResultAsInt = enumResultAsInt { - return AnotherEventEnum(rawValue: enumResultAsInt) - } - return nil - case 131: - return EventAllNullableTypes.fromList(self.readValue() as! [Any?]) - case 132: - return IntEvent.fromList(self.readValue() as! [Any?]) - case 133: - return StringEvent.fromList(self.readValue() as! [Any?]) - case 134: - return BoolEvent.fromList(self.readValue() as! [Any?]) - case 135: - return DoubleEvent.fromList(self.readValue() as! [Any?]) - case 136: - return ObjectsEvent.fromList(self.readValue() as! [Any?]) - case 137: - return EnumEvent.fromList(self.readValue() as! [Any?]) - case 138: - return ClassEvent.fromList(self.readValue() as! [Any?]) - default: - return super.readValue(ofType: type) - } - } -} - -private class EventChannelTestsPigeonCodecWriter: FlutterStandardWriter { - override func writeValue(_ value: Any) { - if let value = value as? EventEnum { - super.writeByte(129) - super.writeValue(value.rawValue) - } else if let value = value as? AnotherEventEnum { - super.writeByte(130) - super.writeValue(value.rawValue) - } else if let value = value as? EventAllNullableTypes { - super.writeByte(131) - super.writeValue(value.toList()) - } else if let value = value as? IntEvent { - super.writeByte(132) - super.writeValue(value.toList()) - } else if let value = value as? StringEvent { - super.writeByte(133) - super.writeValue(value.toList()) - } else if let value = value as? BoolEvent { - super.writeByte(134) - super.writeValue(value.toList()) - } else if let value = value as? DoubleEvent { - super.writeByte(135) - super.writeValue(value.toList()) - } else if let value = value as? ObjectsEvent { - super.writeByte(136) - super.writeValue(value.toList()) - } else if let value = value as? EnumEvent { - super.writeByte(137) - super.writeValue(value.toList()) - } else if let value = value as? ClassEvent { - super.writeByte(138) - super.writeValue(value.toList()) - } else { - super.writeValue(value) - } - } -} - -private class EventChannelTestsPigeonCodecReaderWriter: FlutterStandardReaderWriter { - override func reader(with data: Data) -> FlutterStandardReader { - return EventChannelTestsPigeonCodecReader(data: data) - } - - override func writer(with data: NSMutableData) -> FlutterStandardWriter { - return EventChannelTestsPigeonCodecWriter(data: data) - } -} - -class EventChannelTestsPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable { - static let shared = EventChannelTestsPigeonCodec( - readerWriter: EventChannelTestsPigeonCodecReaderWriter()) -} - -var eventChannelTestsPigeonMethodCodec = FlutterStandardMethodCodec( - readerWriter: EventChannelTestsPigeonCodecReaderWriter()) - -private class PigeonStreamHandler: NSObject, FlutterStreamHandler { - private let wrapper: PigeonEventChannelWrapper - private var pigeonSink: PigeonEventSink? = nil - - init(wrapper: PigeonEventChannelWrapper) { - self.wrapper = wrapper - } - - func onListen(withArguments arguments: Any?, eventSink events: @escaping FlutterEventSink) - -> FlutterError? - { - pigeonSink = PigeonEventSink(events) - wrapper.onListen(withArguments: arguments, sink: pigeonSink!) - return nil - } - - func onCancel(withArguments arguments: Any?) -> FlutterError? { - pigeonSink = nil - wrapper.onCancel(withArguments: arguments) - return nil - } -} - -class PigeonEventChannelWrapper { - func onListen(withArguments arguments: Any?, sink: PigeonEventSink) {} - func onCancel(withArguments arguments: Any?) {} -} - -class PigeonEventSink { - private let sink: FlutterEventSink - - init(_ sink: @escaping FlutterEventSink) { - self.sink = sink - } - - func success(_ value: ReturnType) { - sink(value) - } - - func error(code: String, message: String?, details: Any?) { - sink(FlutterError(code: code, message: message, details: details)) - } - - func endOfStream() { - sink(FlutterEndOfEventStream) - } - -} - -class StreamIntsStreamHandler: PigeonEventChannelWrapper { - static func register( - with messenger: FlutterBinaryMessenger, - instanceName: String = "", - streamHandler: StreamIntsStreamHandler - ) { - var channelName = "dev.flutter.pigeon.pigeon_integration_tests.EventChannelMethods.streamInts" - if !instanceName.isEmpty { - channelName += ".\(instanceName)" - } - let internalStreamHandler = PigeonStreamHandler(wrapper: streamHandler) - let channel = FlutterEventChannel( - name: channelName, binaryMessenger: messenger, codec: eventChannelTestsPigeonMethodCodec) - channel.setStreamHandler(internalStreamHandler) - } -} - -class StreamEventsStreamHandler: PigeonEventChannelWrapper { - static func register( - with messenger: FlutterBinaryMessenger, - instanceName: String = "", - streamHandler: StreamEventsStreamHandler - ) { - var channelName = "dev.flutter.pigeon.pigeon_integration_tests.EventChannelMethods.streamEvents" - if !instanceName.isEmpty { - channelName += ".\(instanceName)" - } - let internalStreamHandler = PigeonStreamHandler(wrapper: streamHandler) - let channel = FlutterEventChannel( - name: channelName, binaryMessenger: messenger, codec: eventChannelTestsPigeonMethodCodec) - channel.setStreamHandler(internalStreamHandler) - } -} - -class StreamConsistentNumbersStreamHandler: PigeonEventChannelWrapper { - static func register( - with messenger: FlutterBinaryMessenger, - instanceName: String = "", - streamHandler: StreamConsistentNumbersStreamHandler - ) { - var channelName = - "dev.flutter.pigeon.pigeon_integration_tests.EventChannelMethods.streamConsistentNumbers" - if !instanceName.isEmpty { - channelName += ".\(instanceName)" - } - let internalStreamHandler = PigeonStreamHandler(wrapper: streamHandler) - let channel = FlutterEventChannel( - name: channelName, binaryMessenger: messenger, codec: eventChannelTestsPigeonMethodCodec) - channel.setStreamHandler(internalStreamHandler) - } -} diff --git a/packages/pigeon/platform_tests/test_plugin/macos/Classes/ProxyApiTests.gen.swift b/packages/pigeon/platform_tests/test_plugin/macos/Classes/ProxyApiTests.gen.swift deleted file mode 100644 index bc369d16ee2..00000000000 --- a/packages/pigeon/platform_tests/test_plugin/macos/Classes/ProxyApiTests.gen.swift +++ /dev/null @@ -1,4153 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// -// Autogenerated from Pigeon, do not edit directly. -// See also: https://pub.dev/packages/pigeon - -import Foundation - -#if os(iOS) - import Flutter -#elseif os(macOS) - import FlutterMacOS -#else - #error("Unsupported platform.") -#endif - -/// Error class for passing custom error details to Dart side. -final class ProxyApiTestsError: Error { - let code: String - let message: String? - let details: Sendable? - - init(code: String, message: String?, details: Sendable?) { - self.code = code - self.message = message - self.details = details - } - - var localizedDescription: String { - return - "ProxyApiTestsError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" - } -} - -private func wrapResult(_ result: Any?) -> [Any?] { - return [result] -} - -private func wrapError(_ error: Any) -> [Any?] { - if let pigeonError = error as? ProxyApiTestsError { - return [ - pigeonError.code, - pigeonError.message, - pigeonError.details, - ] - } - if let flutterError = error as? FlutterError { - return [ - flutterError.code, - flutterError.message, - flutterError.details, - ] - } - return [ - "\(error)", - "\(type(of: error))", - "Stacktrace: \(Thread.callStackSymbols)", - ] -} - -private func createConnectionError(withChannelName channelName: String) -> ProxyApiTestsError { - return ProxyApiTestsError( - code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", - details: "") -} - -private func isNullish(_ value: Any?) -> Bool { - return value is NSNull || value == nil -} - -private func nilOrValue(_ value: Any?) -> T? { - if value is NSNull { return nil } - return value as! T? -} - -/// Handles the callback when an object is deallocated. -protocol ProxyApiTestsPigeonInternalFinalizerDelegate: AnyObject { - /// Invoked when the strong reference of an object is deallocated in an `InstanceManager`. - func onDeinit(identifier: Int64) -} - -// Attaches to an object to receive a callback when the object is deallocated. -internal final class ProxyApiTestsPigeonInternalFinalizer { - private static let associatedObjectKey = malloc(1)! - - private let identifier: Int64 - // Reference to the delegate is weak because the callback should be ignored if the - // `InstanceManager` is deallocated. - private weak var delegate: ProxyApiTestsPigeonInternalFinalizerDelegate? - - private init(identifier: Int64, delegate: ProxyApiTestsPigeonInternalFinalizerDelegate) { - self.identifier = identifier - self.delegate = delegate - } - - internal static func attach( - to instance: AnyObject, identifier: Int64, - delegate: ProxyApiTestsPigeonInternalFinalizerDelegate - ) { - let finalizer = ProxyApiTestsPigeonInternalFinalizer(identifier: identifier, delegate: delegate) - objc_setAssociatedObject(instance, associatedObjectKey, finalizer, .OBJC_ASSOCIATION_RETAIN) - } - - static func detach(from instance: AnyObject) { - objc_setAssociatedObject(instance, associatedObjectKey, nil, .OBJC_ASSOCIATION_ASSIGN) - } - - deinit { - delegate?.onDeinit(identifier: identifier) - } -} - -/// Maintains instances used to communicate with the corresponding objects in Dart. -/// -/// Objects stored in this container are represented by an object in Dart that is also stored in -/// an InstanceManager with the same identifier. -/// -/// When an instance is added with an identifier, either can be used to retrieve the other. -/// -/// Added instances are added as a weak reference and a strong reference. When the strong -/// reference is removed and the weak reference is deallocated,`ProxyApiTestsPigeonInternalFinalizerDelegate.onDeinit` -/// is called with the instance's identifier. However, if the strong reference is removed and then the identifier is -/// retrieved with the intention to pass the identifier to Dart (e.g. by calling `identifierWithStrongReference`), -/// the strong reference to the instance is re-added. The strong reference will then need to be removed manually -/// again. -/// -/// Accessing and inserting to an InstanceManager is thread safe. -final class ProxyApiTestsPigeonInstanceManager { - // Identifiers are locked to a specific range to avoid collisions with objects - // created simultaneously from Dart. - // Host uses identifiers >= 2^16 and Dart is expected to use values n where, - // 0 <= n < 2^16. - private static let minHostCreatedIdentifier: Int64 = 65536 - - private let lockQueue = DispatchQueue(label: "ProxyApiTestsPigeonInstanceManager") - private let identifiers: NSMapTable = NSMapTable( - keyOptions: [.weakMemory, .objectPointerPersonality], valueOptions: .strongMemory) - private let weakInstances: NSMapTable = NSMapTable( - keyOptions: .strongMemory, valueOptions: [.weakMemory, .objectPointerPersonality]) - private let strongInstances: NSMapTable = NSMapTable( - keyOptions: .strongMemory, valueOptions: [.strongMemory, .objectPointerPersonality]) - private let finalizerDelegate: ProxyApiTestsPigeonInternalFinalizerDelegate - private var nextIdentifier: Int64 = minHostCreatedIdentifier - - public init(finalizerDelegate: ProxyApiTestsPigeonInternalFinalizerDelegate) { - self.finalizerDelegate = finalizerDelegate - } - - /// Adds a new instance that was instantiated from Dart. - /// - /// The same instance can be added multiple times, but each identifier must be unique. This allows - /// two objects that are equivalent (e.g. conforms to `Equatable`) to both be added. - /// - /// - Parameters: - /// - instance: the instance to be stored - /// - identifier: the identifier to be paired with instance. This value must be >= 0 and unique - func addDartCreatedInstance(_ instance: AnyObject, withIdentifier identifier: Int64) { - lockQueue.async { - self.addInstance(instance, withIdentifier: identifier) - } - } - - /// Adds a new instance that was instantiated from the host platform. - /// - /// - Parameters: - /// - instance: the instance to be stored. This must be unique to all other added instances. - /// - Returns: the unique identifier (>= 0) stored with instance - func addHostCreatedInstance(_ instance: AnyObject) -> Int64 { - assert(!containsInstance(instance), "Instance of \(instance) has already been added.") - var identifier: Int64 = -1 - lockQueue.sync { - identifier = nextIdentifier - nextIdentifier += 1 - self.addInstance(instance, withIdentifier: identifier) - } - return identifier - } - - /// Removes `instanceIdentifier` and its associated strongly referenced instance, if present, from the manager. - /// - /// - Parameters: - /// - instanceIdentifier: the identifier paired to an instance. - /// - Returns: removed instance if the manager contains the given identifier, otherwise `nil` if - /// the manager doesn't contain the value - func removeInstance(withIdentifier instanceIdentifier: Int64) throws -> T? { - var instance: AnyObject? = nil - lockQueue.sync { - instance = strongInstances.object(forKey: NSNumber(value: instanceIdentifier)) - strongInstances.removeObject(forKey: NSNumber(value: instanceIdentifier)) - } - return instance as? T - } - - /// Retrieves the instance associated with identifier. - /// - /// - Parameters: - /// - instanceIdentifier: the identifier associated with an instance - /// - Returns: the instance associated with `instanceIdentifier` if the manager contains the value, otherwise - /// `nil` if the manager doesn't contain the value - func instance(forIdentifier instanceIdentifier: Int64) -> T? { - var instance: AnyObject? = nil - lockQueue.sync { - instance = weakInstances.object(forKey: NSNumber(value: instanceIdentifier)) - } - return instance as? T - } - - private func addInstance(_ instance: AnyObject, withIdentifier identifier: Int64) { - assert(identifier >= 0) - assert( - weakInstances.object(forKey: identifier as NSNumber) == nil, - "Identifier has already been added: \(identifier)") - identifiers.setObject(NSNumber(value: identifier), forKey: instance) - weakInstances.setObject(instance, forKey: NSNumber(value: identifier)) - strongInstances.setObject(instance, forKey: NSNumber(value: identifier)) - ProxyApiTestsPigeonInternalFinalizer.attach( - to: instance, identifier: identifier, delegate: finalizerDelegate) - } - - /// Retrieves the identifier paired with an instance. - /// - /// If the manager contains a strong reference to `instance`, it will return the identifier - /// associated with `instance`. If the manager contains only a weak reference to `instance`, a new - /// strong reference to `instance` will be added and will need to be removed again with `removeInstance`. - /// - /// If this method returns a nonnull identifier, this method also expects the Dart - /// `ProxyApiTestsPigeonInstanceManager` to have, or recreate, a weak reference to the Dart instance the - /// identifier is associated with. - /// - /// - Parameters: - /// - instance: an instance that may be stored in the manager - /// - Returns: the identifier associated with `instance` if the manager contains the value, otherwise - /// `nil` if the manager doesn't contain the value - func identifierWithStrongReference(forInstance instance: AnyObject) -> Int64? { - var identifier: Int64? = nil - lockQueue.sync { - if let existingIdentifier = identifiers.object(forKey: instance)?.int64Value { - strongInstances.setObject(instance, forKey: NSNumber(value: existingIdentifier)) - identifier = existingIdentifier - } - } - return identifier - } - - /// Whether this manager contains the given `instance`. - /// - /// - Parameters: - /// - instance: the instance whose presence in this manager is to be tested - /// - Returns: whether this manager contains the given `instance` - func containsInstance(_ instance: AnyObject) -> Bool { - var containsInstance = false - lockQueue.sync { - containsInstance = identifiers.object(forKey: instance) != nil - } - return containsInstance - } - - /// Removes all of the instances from this manager. - /// - /// The manager will be empty after this call returns. - func removeAllObjects() throws { - lockQueue.sync { - identifiers.removeAllObjects() - weakInstances.removeAllObjects() - strongInstances.removeAllObjects() - nextIdentifier = ProxyApiTestsPigeonInstanceManager.minHostCreatedIdentifier - } - } - - /// The number of instances stored as a strong reference. - /// - /// For debugging and testing purposes. - internal var strongInstanceCount: Int { - var count: Int = 0 - lockQueue.sync { - count = strongInstances.count - } - return count - } - - /// The number of instances stored as a weak reference. - /// - /// For debugging and testing purposes. NSMapTables that store keys or objects as weak - /// reference will be reclaimed non-deterministically. - internal var weakInstanceCount: Int { - var count: Int = 0 - lockQueue.sync { - count = weakInstances.count - } - return count - } -} - -private class ProxyApiTestsPigeonInstanceManagerApi { - /// The codec used for serializing messages. - var codec: FlutterStandardMessageCodec { ProxyApiTestsPigeonCodec.shared } - - /// Handles sending and receiving messages with Dart. - unowned let binaryMessenger: FlutterBinaryMessenger - - init(binaryMessenger: FlutterBinaryMessenger) { - self.binaryMessenger = binaryMessenger - } - - /// Sets up an instance of `ProxyApiTestsPigeonInstanceManagerApi` to handle messages through the `binaryMessenger`. - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, instanceManager: ProxyApiTestsPigeonInstanceManager? - ) { - let codec = ProxyApiTestsPigeonCodec.shared - let removeStrongReferenceChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.removeStrongReference", - binaryMessenger: binaryMessenger, codec: codec) - if let instanceManager = instanceManager { - removeStrongReferenceChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let identifierArg = args[0] as! Int64 - do { - let _: AnyObject? = try instanceManager.removeInstance(withIdentifier: identifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - removeStrongReferenceChannel.setMessageHandler(nil) - } - let clearChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.clear", - binaryMessenger: binaryMessenger, codec: codec) - if let instanceManager = instanceManager { - clearChannel.setMessageHandler { _, reply in - do { - try instanceManager.removeAllObjects() - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - clearChannel.setMessageHandler(nil) - } - } - - /// Sends a message to the Dart `InstanceManager` to remove the strong reference of the instance associated with `identifier`. - func removeStrongReference( - identifier identifierArg: Int64, - completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.removeStrongReference" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([identifierArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else { - completion(.success(())) - } - } - } -} -protocol ProxyApiTestsPigeonProxyApiDelegate { - /// An implementation of [PigeonApiProxyApiTestClass] used to add a new Dart instance of - /// `ProxyApiTestClass` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiProxyApiTestClass(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) - -> PigeonApiProxyApiTestClass - /// An implementation of [PigeonApiProxyApiSuperClass] used to add a new Dart instance of - /// `ProxyApiSuperClass` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiProxyApiSuperClass(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) - -> PigeonApiProxyApiSuperClass - /// An implementation of [PigeonApiProxyApiInterface] used to add a new Dart instance of - /// `ProxyApiInterface` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiProxyApiInterface(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) - -> PigeonApiProxyApiInterface - /// An implementation of [PigeonApiClassWithApiRequirement] used to add a new Dart instance of - /// `ClassWithApiRequirement` to the Dart `InstanceManager` and make calls to Dart. - func pigeonApiClassWithApiRequirement(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) - -> PigeonApiClassWithApiRequirement -} - -extension ProxyApiTestsPigeonProxyApiDelegate { - func pigeonApiProxyApiInterface(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) - -> PigeonApiProxyApiInterface - { - return PigeonApiProxyApiInterface( - pigeonRegistrar: registrar, delegate: PigeonApiDelegateProxyApiInterface()) - } -} - -open class ProxyApiTestsPigeonProxyApiRegistrar { - let binaryMessenger: FlutterBinaryMessenger - let apiDelegate: ProxyApiTestsPigeonProxyApiDelegate - let instanceManager: ProxyApiTestsPigeonInstanceManager - /// Whether APIs should ignore calling to Dart. - public var ignoreCallsToDart = false - private var _codec: FlutterStandardMessageCodec? - var codec: FlutterStandardMessageCodec { - if _codec == nil { - _codec = FlutterStandardMessageCodec( - readerWriter: ProxyApiTestsPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: self)) - } - return _codec! - } - - private class InstanceManagerApiFinalizerDelegate: ProxyApiTestsPigeonInternalFinalizerDelegate { - let api: ProxyApiTestsPigeonInstanceManagerApi - - init(_ api: ProxyApiTestsPigeonInstanceManagerApi) { - self.api = api - } - - public func onDeinit(identifier: Int64) { - api.removeStrongReference(identifier: identifier) { - _ in - } - } - } - - init(binaryMessenger: FlutterBinaryMessenger, apiDelegate: ProxyApiTestsPigeonProxyApiDelegate) { - self.binaryMessenger = binaryMessenger - self.apiDelegate = apiDelegate - self.instanceManager = ProxyApiTestsPigeonInstanceManager( - finalizerDelegate: InstanceManagerApiFinalizerDelegate( - ProxyApiTestsPigeonInstanceManagerApi(binaryMessenger: binaryMessenger))) - } - - func setUp() { - ProxyApiTestsPigeonInstanceManagerApi.setUpMessageHandlers( - binaryMessenger: binaryMessenger, instanceManager: instanceManager) - PigeonApiProxyApiTestClass.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiProxyApiTestClass(self)) - PigeonApiProxyApiSuperClass.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiProxyApiSuperClass(self)) - PigeonApiClassWithApiRequirement.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiClassWithApiRequirement(self)) - } - func tearDown() { - ProxyApiTestsPigeonInstanceManagerApi.setUpMessageHandlers( - binaryMessenger: binaryMessenger, instanceManager: nil) - PigeonApiProxyApiTestClass.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) - PigeonApiProxyApiSuperClass.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) - PigeonApiClassWithApiRequirement.setUpMessageHandlers( - binaryMessenger: binaryMessenger, api: nil) - } -} -private class ProxyApiTestsPigeonInternalProxyApiCodecReaderWriter: FlutterStandardReaderWriter { - unowned let pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar - - private class ProxyApiTestsPigeonInternalProxyApiCodecReader: ProxyApiTestsPigeonCodecReader { - unowned let pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar - - init(data: Data, pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar) { - self.pigeonRegistrar = pigeonRegistrar - super.init(data: data) - } - - override func readValue(ofType type: UInt8) -> Any? { - switch type { - case 128: - let identifier = self.readValue() - let instance: AnyObject? = pigeonRegistrar.instanceManager.instance( - forIdentifier: identifier is Int64 ? identifier as! Int64 : Int64(identifier as! Int32)) - if instance == nil { - print("Failed to find instance with identifier: \(identifier!)") - } - return instance - default: - return super.readValue(ofType: type) - } - } - } - - private class ProxyApiTestsPigeonInternalProxyApiCodecWriter: ProxyApiTestsPigeonCodecWriter { - unowned let pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar - - init(data: NSMutableData, pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar) { - self.pigeonRegistrar = pigeonRegistrar - super.init(data: data) - } - - override func writeValue(_ value: Any) { - if value is [Any] || value is Bool || value is Data || value is [AnyHashable: Any] - || value is Double || value is FlutterStandardTypedData || value is Int64 || value is String - || value is ProxyApiTestEnum - { - super.writeValue(value) - return - } - - if let instance = value as? ProxyApiTestClass { - pigeonRegistrar.apiDelegate.pigeonApiProxyApiTestClass(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) - return - } - - if let instance = value as? ProxyApiSuperClass { - pigeonRegistrar.apiDelegate.pigeonApiProxyApiSuperClass(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) - return - } - - if let instance = value as? ProxyApiInterface { - pigeonRegistrar.apiDelegate.pigeonApiProxyApiInterface(pigeonRegistrar).pigeonNewInstance( - pigeonInstance: instance - ) { _ in } - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) - return - } - - if #available(iOS 15.0.0, macOS 10.0.0, *), let instance = value as? ClassWithApiRequirement { - pigeonRegistrar.apiDelegate.pigeonApiClassWithApiRequirement(pigeonRegistrar) - .pigeonNewInstance( - pigeonInstance: instance - ) { _ in } - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference( - forInstance: instance as AnyObject)!) - return - } - - if let instance = value as AnyObject?, - pigeonRegistrar.instanceManager.containsInstance(instance) - { - super.writeByte(128) - super.writeValue( - pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance)!) - } else { - print("Unsupported value: \(value) of \(type(of: value))") - assert(false, "Unsupported value for ProxyApiTestsPigeonInternalProxyApiCodecWriter") - } - - } - } - - init(pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar) { - self.pigeonRegistrar = pigeonRegistrar - } - - override func reader(with data: Data) -> FlutterStandardReader { - return ProxyApiTestsPigeonInternalProxyApiCodecReader( - data: data, pigeonRegistrar: pigeonRegistrar) - } - - override func writer(with data: NSMutableData) -> FlutterStandardWriter { - return ProxyApiTestsPigeonInternalProxyApiCodecWriter( - data: data, pigeonRegistrar: pigeonRegistrar) - } -} - -enum ProxyApiTestEnum: Int { - case one = 0 - case two = 1 - case three = 2 -} - -private class ProxyApiTestsPigeonCodecReader: FlutterStandardReader { - override func readValue(ofType type: UInt8) -> Any? { - switch type { - case 129: - let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) - if let enumResultAsInt = enumResultAsInt { - return ProxyApiTestEnum(rawValue: enumResultAsInt) - } - return nil - default: - return super.readValue(ofType: type) - } - } -} - -private class ProxyApiTestsPigeonCodecWriter: FlutterStandardWriter { - override func writeValue(_ value: Any) { - if let value = value as? ProxyApiTestEnum { - super.writeByte(129) - super.writeValue(value.rawValue) - } else { - super.writeValue(value) - } - } -} - -private class ProxyApiTestsPigeonCodecReaderWriter: FlutterStandardReaderWriter { - override func reader(with data: Data) -> FlutterStandardReader { - return ProxyApiTestsPigeonCodecReader(data: data) - } - - override func writer(with data: NSMutableData) -> FlutterStandardWriter { - return ProxyApiTestsPigeonCodecWriter(data: data) - } -} - -class ProxyApiTestsPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable { - static let shared = ProxyApiTestsPigeonCodec(readerWriter: ProxyApiTestsPigeonCodecReaderWriter()) -} - -protocol PigeonApiDelegateProxyApiTestClass { - func pigeonDefaultConstructor( - pigeonApi: PigeonApiProxyApiTestClass, aBool: Bool, anInt: Int64, aDouble: Double, - aString: String, aUint8List: FlutterStandardTypedData, aList: [Any?], aMap: [String?: Any?], - anEnum: ProxyApiTestEnum, aProxyApi: ProxyApiSuperClass, aNullableBool: Bool?, - aNullableInt: Int64?, aNullableDouble: Double?, aNullableString: String?, - aNullableUint8List: FlutterStandardTypedData?, aNullableList: [Any?]?, - aNullableMap: [String?: Any?]?, aNullableEnum: ProxyApiTestEnum?, - aNullableProxyApi: ProxyApiSuperClass?, boolParam: Bool, intParam: Int64, doubleParam: Double, - stringParam: String, aUint8ListParam: FlutterStandardTypedData, listParam: [Any?], - mapParam: [String?: Any?], enumParam: ProxyApiTestEnum, proxyApiParam: ProxyApiSuperClass, - nullableBoolParam: Bool?, nullableIntParam: Int64?, nullableDoubleParam: Double?, - nullableStringParam: String?, nullableUint8ListParam: FlutterStandardTypedData?, - nullableListParam: [Any?]?, nullableMapParam: [String?: Any?]?, - nullableEnumParam: ProxyApiTestEnum?, nullableProxyApiParam: ProxyApiSuperClass? - ) throws -> ProxyApiTestClass - func namedConstructor( - pigeonApi: PigeonApiProxyApiTestClass, aBool: Bool, anInt: Int64, aDouble: Double, - aString: String, aUint8List: FlutterStandardTypedData, aList: [Any?], aMap: [String?: Any?], - anEnum: ProxyApiTestEnum, aProxyApi: ProxyApiSuperClass, aNullableBool: Bool?, - aNullableInt: Int64?, aNullableDouble: Double?, aNullableString: String?, - aNullableUint8List: FlutterStandardTypedData?, aNullableList: [Any?]?, - aNullableMap: [String?: Any?]?, aNullableEnum: ProxyApiTestEnum?, - aNullableProxyApi: ProxyApiSuperClass? - ) throws -> ProxyApiTestClass - func attachedField(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) - throws -> ProxyApiSuperClass - func staticAttachedField(pigeonApi: PigeonApiProxyApiTestClass) throws -> ProxyApiSuperClass - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic calling. - func noop(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws - /// Returns an error, to test error handling. - func throwError(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws - -> Any? - /// Returns an error from a void function, to test error handling. - func throwErrorFromVoid(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) - throws - /// Returns a Flutter error, to test error handling. - func throwFlutterError(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) - throws -> Any? - /// Returns passed in int. - func echoInt( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64 - ) throws -> Int64 - /// Returns passed in double. - func echoDouble( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double - ) throws -> Double - /// Returns the passed in boolean. - func echoBool( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool - ) throws -> Bool - /// Returns the passed in string. - func echoString( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String - ) throws -> String - /// Returns the passed in Uint8List. - func echoUint8List( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aUint8List: FlutterStandardTypedData - ) throws -> FlutterStandardTypedData - /// Returns the passed in generic Object. - func echoObject( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anObject: Any - ) throws -> Any - /// Returns the passed list, to test serialization and deserialization. - func echoList( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?] - ) throws -> [Any?] - /// Returns the passed list with ProxyApis, to test serialization and - /// deserialization. - func echoProxyApiList( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aList: [ProxyApiTestClass] - ) throws -> [ProxyApiTestClass] - /// Returns the passed map, to test serialization and deserialization. - func echoMap( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aMap: [String?: Any?] - ) throws -> [String?: Any?] - /// Returns the passed map with ProxyApis, to test serialization and - /// deserialization. - func echoProxyApiMap( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aMap: [String: ProxyApiTestClass] - ) throws -> [String: ProxyApiTestClass] - /// Returns the passed enum to test serialization and deserialization. - func echoEnum( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum - ) throws -> ProxyApiTestEnum - /// Returns the passed ProxyApi to test serialization and deserialization. - func echoProxyApi( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aProxyApi: ProxyApiSuperClass - ) throws -> ProxyApiSuperClass - /// Returns passed in int. - func echoNullableInt( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aNullableInt: Int64? - ) throws -> Int64? - /// Returns passed in double. - func echoNullableDouble( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aNullableDouble: Double? - ) throws -> Double? - /// Returns the passed in boolean. - func echoNullableBool( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aNullableBool: Bool? - ) throws -> Bool? - /// Returns the passed in string. - func echoNullableString( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aNullableString: String? - ) throws -> String? - /// Returns the passed in Uint8List. - func echoNullableUint8List( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aNullableUint8List: FlutterStandardTypedData? - ) throws -> FlutterStandardTypedData? - /// Returns the passed in generic Object. - func echoNullableObject( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aNullableObject: Any? - ) throws -> Any? - /// Returns the passed list, to test serialization and deserialization. - func echoNullableList( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aNullableList: [Any?]? - ) throws -> [Any?]? - /// Returns the passed map, to test serialization and deserialization. - func echoNullableMap( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aNullableMap: [String?: Any?]? - ) throws -> [String?: Any?]? - func echoNullableEnum( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aNullableEnum: ProxyApiTestEnum? - ) throws -> ProxyApiTestEnum? - /// Returns the passed ProxyApi to test serialization and deserialization. - func echoNullableProxyApi( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aNullableProxyApi: ProxyApiSuperClass? - ) throws -> ProxyApiSuperClass? - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic asynchronous calling. - func noopAsync( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - completion: @escaping (Result) -> Void) - /// Returns passed in int asynchronously. - func echoAsyncInt( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64, - completion: @escaping (Result) -> Void) - /// Returns passed in double asynchronously. - func echoAsyncDouble( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double, - completion: @escaping (Result) -> Void) - /// Returns the passed in boolean asynchronously. - func echoAsyncBool( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool, - completion: @escaping (Result) -> Void) - /// Returns the passed string asynchronously. - func echoAsyncString( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String, - completion: @escaping (Result) -> Void) - /// Returns the passed in Uint8List asynchronously. - func echoAsyncUint8List( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aUint8List: FlutterStandardTypedData, - completion: @escaping (Result) -> Void) - /// Returns the passed in generic Object asynchronously. - func echoAsyncObject( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anObject: Any, - completion: @escaping (Result) -> Void) - /// Returns the passed list, to test asynchronous serialization and deserialization. - func echoAsyncList( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?], - completion: @escaping (Result<[Any?], Error>) -> Void) - /// Returns the passed map, to test asynchronous serialization and deserialization. - func echoAsyncMap( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aMap: [String?: Any?], - completion: @escaping (Result<[String?: Any?], Error>) -> Void) - /// Returns the passed enum, to test asynchronous serialization and deserialization. - func echoAsyncEnum( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum, completion: @escaping (Result) -> Void) - /// Responds with an error from an async function returning a value. - func throwAsyncError( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - completion: @escaping (Result) -> Void) - /// Responds with an error from an async void function. - func throwAsyncErrorFromVoid( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - completion: @escaping (Result) -> Void) - /// Responds with a Flutter error from an async function returning a value. - func throwAsyncFlutterError( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - completion: @escaping (Result) -> Void) - /// Returns passed in int asynchronously. - func echoAsyncNullableInt( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64?, - completion: @escaping (Result) -> Void) - /// Returns passed in double asynchronously. - func echoAsyncNullableDouble( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double?, - completion: @escaping (Result) -> Void) - /// Returns the passed in boolean asynchronously. - func echoAsyncNullableBool( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool?, - completion: @escaping (Result) -> Void) - /// Returns the passed string asynchronously. - func echoAsyncNullableString( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String?, - completion: @escaping (Result) -> Void) - /// Returns the passed in Uint8List asynchronously. - func echoAsyncNullableUint8List( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aUint8List: FlutterStandardTypedData?, - completion: @escaping (Result) -> Void) - /// Returns the passed in generic Object asynchronously. - func echoAsyncNullableObject( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anObject: Any?, - completion: @escaping (Result) -> Void) - /// Returns the passed list, to test asynchronous serialization and deserialization. - func echoAsyncNullableList( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?]?, - completion: @escaping (Result<[Any?]?, Error>) -> Void) - /// Returns the passed map, to test asynchronous serialization and deserialization. - func echoAsyncNullableMap( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) - /// Returns the passed enum, to test asynchronous serialization and deserialization. - func echoAsyncNullableEnum( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum?, completion: @escaping (Result) -> Void) - func staticNoop(pigeonApi: PigeonApiProxyApiTestClass) throws - func echoStaticString(pigeonApi: PigeonApiProxyApiTestClass, aString: String) throws -> String - func staticAsyncNoop( - pigeonApi: PigeonApiProxyApiTestClass, completion: @escaping (Result) -> Void) - func callFlutterNoop( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - completion: @escaping (Result) -> Void) - func callFlutterThrowError( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - completion: @escaping (Result) -> Void) - func callFlutterThrowErrorFromVoid( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - completion: @escaping (Result) -> Void) - func callFlutterEchoBool( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool, - completion: @escaping (Result) -> Void) - func callFlutterEchoInt( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64, - completion: @escaping (Result) -> Void) - func callFlutterEchoDouble( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double, - completion: @escaping (Result) -> Void) - func callFlutterEchoString( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String, - completion: @escaping (Result) -> Void) - func callFlutterEchoUint8List( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aUint8List: FlutterStandardTypedData, - completion: @escaping (Result) -> Void) - func callFlutterEchoList( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?], - completion: @escaping (Result<[Any?], Error>) -> Void) - func callFlutterEchoProxyApiList( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aList: [ProxyApiTestClass?], completion: @escaping (Result<[ProxyApiTestClass?], Error>) -> Void - ) - func callFlutterEchoMap( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aMap: [String?: Any?], - completion: @escaping (Result<[String?: Any?], Error>) -> Void) - func callFlutterEchoProxyApiMap( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aMap: [String?: ProxyApiTestClass?], - completion: @escaping (Result<[String?: ProxyApiTestClass?], Error>) -> Void) - func callFlutterEchoEnum( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum, completion: @escaping (Result) -> Void) - func callFlutterEchoProxyApi( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aProxyApi: ProxyApiSuperClass, completion: @escaping (Result) -> Void - ) - func callFlutterEchoNullableBool( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool?, - completion: @escaping (Result) -> Void) - func callFlutterEchoNullableInt( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64?, - completion: @escaping (Result) -> Void) - func callFlutterEchoNullableDouble( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double?, - completion: @escaping (Result) -> Void) - func callFlutterEchoNullableString( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String?, - completion: @escaping (Result) -> Void) - func callFlutterEchoNullableUint8List( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aUint8List: FlutterStandardTypedData?, - completion: @escaping (Result) -> Void) - func callFlutterEchoNullableList( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?]?, - completion: @escaping (Result<[Any?]?, Error>) -> Void) - func callFlutterEchoNullableMap( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) - func callFlutterEchoNullableEnum( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum?, completion: @escaping (Result) -> Void) - func callFlutterEchoNullableProxyApi( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - aProxyApi: ProxyApiSuperClass?, - completion: @escaping (Result) -> Void) - func callFlutterNoopAsync( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, - completion: @escaping (Result) -> Void) - func callFlutterEchoAsyncString( - pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String, - completion: @escaping (Result) -> Void) -} - -protocol PigeonApiProtocolProxyApiTestClass { - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic calling. - func flutterNoop( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, - completion: @escaping (Result) -> Void) - /// Responds with an error from an async function returning a value. - func flutterThrowError( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, - completion: @escaping (Result) -> Void) - /// Responds with an error from an async void function. - func flutterThrowErrorFromVoid( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, - completion: @escaping (Result) -> Void) - /// Returns the passed boolean, to test serialization and deserialization. - func flutterEchoBool( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aBool aBoolArg: Bool, - completion: @escaping (Result) -> Void) - /// Returns the passed int, to test serialization and deserialization. - func flutterEchoInt( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, anInt anIntArg: Int64, - completion: @escaping (Result) -> Void) - /// Returns the passed double, to test serialization and deserialization. - func flutterEchoDouble( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aDouble aDoubleArg: Double, - completion: @escaping (Result) -> Void) - /// Returns the passed string, to test serialization and deserialization. - func flutterEchoString( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aString aStringArg: String, - completion: @escaping (Result) -> Void) - /// Returns the passed byte list, to test serialization and deserialization. - func flutterEchoUint8List( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: FlutterStandardTypedData, - completion: @escaping (Result) -> Void) - /// Returns the passed list, to test serialization and deserialization. - func flutterEchoList( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: [Any?], - completion: @escaping (Result<[Any?], ProxyApiTestsError>) -> Void) - /// Returns the passed list with ProxyApis, to test serialization and - /// deserialization. - func flutterEchoProxyApiList( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: [ProxyApiTestClass?], - completion: @escaping (Result<[ProxyApiTestClass?], ProxyApiTestsError>) -> Void) - /// Returns the passed map, to test serialization and deserialization. - func flutterEchoMap( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aMap aMapArg: [String?: Any?], - completion: @escaping (Result<[String?: Any?], ProxyApiTestsError>) -> Void) - /// Returns the passed map with ProxyApis, to test serialization and - /// deserialization. - func flutterEchoProxyApiMap( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, - aMap aMapArg: [String?: ProxyApiTestClass?], - completion: @escaping (Result<[String?: ProxyApiTestClass?], ProxyApiTestsError>) -> Void) - /// Returns the passed enum to test serialization and deserialization. - func flutterEchoEnum( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, anEnum anEnumArg: ProxyApiTestEnum, - completion: @escaping (Result) -> Void) - /// Returns the passed ProxyApi to test serialization and deserialization. - func flutterEchoProxyApi( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aProxyApi aProxyApiArg: ProxyApiSuperClass, - completion: @escaping (Result) -> Void) - /// Returns the passed boolean, to test serialization and deserialization. - func flutterEchoNullableBool( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aBool aBoolArg: Bool?, - completion: @escaping (Result) -> Void) - /// Returns the passed int, to test serialization and deserialization. - func flutterEchoNullableInt( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, anInt anIntArg: Int64?, - completion: @escaping (Result) -> Void) - /// Returns the passed double, to test serialization and deserialization. - func flutterEchoNullableDouble( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aDouble aDoubleArg: Double?, - completion: @escaping (Result) -> Void) - /// Returns the passed string, to test serialization and deserialization. - func flutterEchoNullableString( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aString aStringArg: String?, - completion: @escaping (Result) -> Void) - /// Returns the passed byte list, to test serialization and deserialization. - func flutterEchoNullableUint8List( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: FlutterStandardTypedData?, - completion: @escaping (Result) -> Void) - /// Returns the passed list, to test serialization and deserialization. - func flutterEchoNullableList( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: [Any?]?, - completion: @escaping (Result<[Any?]?, ProxyApiTestsError>) -> Void) - /// Returns the passed map, to test serialization and deserialization. - func flutterEchoNullableMap( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aMap aMapArg: [String?: Any?]?, - completion: @escaping (Result<[String?: Any?]?, ProxyApiTestsError>) -> Void) - /// Returns the passed enum to test serialization and deserialization. - func flutterEchoNullableEnum( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, anEnum anEnumArg: ProxyApiTestEnum?, - completion: @escaping (Result) -> Void) - /// Returns the passed ProxyApi to test serialization and deserialization. - func flutterEchoNullableProxyApi( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, - aProxyApi aProxyApiArg: ProxyApiSuperClass?, - completion: @escaping (Result) -> Void) - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic asynchronous calling. - func flutterNoopAsync( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, - completion: @escaping (Result) -> Void) - /// Returns the passed in generic Object asynchronously. - func flutterEchoAsyncString( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aString aStringArg: String, - completion: @escaping (Result) -> Void) -} - -final class PigeonApiProxyApiTestClass: PigeonApiProtocolProxyApiTestClass { - unowned let pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar - let pigeonDelegate: PigeonApiDelegateProxyApiTestClass - ///An implementation of [ProxyApiSuperClass] used to access callback methods - var pigeonApiProxyApiSuperClass: PigeonApiProxyApiSuperClass { - return pigeonRegistrar.apiDelegate.pigeonApiProxyApiSuperClass(pigeonRegistrar) - } - - ///An implementation of [ProxyApiInterface] used to access callback methods - var pigeonApiProxyApiInterface: PigeonApiProxyApiInterface { - return pigeonRegistrar.apiDelegate.pigeonApiProxyApiInterface(pigeonRegistrar) - } - - init( - pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateProxyApiTestClass - ) { - self.pigeonRegistrar = pigeonRegistrar - self.pigeonDelegate = delegate - } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiProxyApiTestClass? - ) { - let codec: FlutterStandardMessageCodec = - api != nil - ? FlutterStandardMessageCodec( - readerWriter: ProxyApiTestsPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) - : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - pigeonDefaultConstructorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonIdentifierArg = args[0] as! Int64 - let aBoolArg = args[1] as! Bool - let anIntArg = args[2] as! Int64 - let aDoubleArg = args[3] as! Double - let aStringArg = args[4] as! String - let aUint8ListArg = args[5] as! FlutterStandardTypedData - let aListArg = args[6] as! [Any?] - let aMapArg = args[7] as! [String?: Any?] - let anEnumArg = args[8] as! ProxyApiTestEnum - let aProxyApiArg = args[9] as! ProxyApiSuperClass - let aNullableBoolArg: Bool? = nilOrValue(args[10]) - let aNullableIntArg: Int64? = nilOrValue(args[11]) - let aNullableDoubleArg: Double? = nilOrValue(args[12]) - let aNullableStringArg: String? = nilOrValue(args[13]) - let aNullableUint8ListArg: FlutterStandardTypedData? = nilOrValue(args[14]) - let aNullableListArg: [Any?]? = nilOrValue(args[15]) - let aNullableMapArg: [String?: Any?]? = nilOrValue(args[16]) - let aNullableEnumArg: ProxyApiTestEnum? = nilOrValue(args[17]) - let aNullableProxyApiArg: ProxyApiSuperClass? = nilOrValue(args[18]) - let boolParamArg = args[19] as! Bool - let intParamArg = args[20] as! Int64 - let doubleParamArg = args[21] as! Double - let stringParamArg = args[22] as! String - let aUint8ListParamArg = args[23] as! FlutterStandardTypedData - let listParamArg = args[24] as! [Any?] - let mapParamArg = args[25] as! [String?: Any?] - let enumParamArg = args[26] as! ProxyApiTestEnum - let proxyApiParamArg = args[27] as! ProxyApiSuperClass - let nullableBoolParamArg: Bool? = nilOrValue(args[28]) - let nullableIntParamArg: Int64? = nilOrValue(args[29]) - let nullableDoubleParamArg: Double? = nilOrValue(args[30]) - let nullableStringParamArg: String? = nilOrValue(args[31]) - let nullableUint8ListParamArg: FlutterStandardTypedData? = nilOrValue(args[32]) - let nullableListParamArg: [Any?]? = nilOrValue(args[33]) - let nullableMapParamArg: [String?: Any?]? = nilOrValue(args[34]) - let nullableEnumParamArg: ProxyApiTestEnum? = nilOrValue(args[35]) - let nullableProxyApiParamArg: ProxyApiSuperClass? = nilOrValue(args[36]) - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor( - pigeonApi: api, aBool: aBoolArg, anInt: anIntArg, aDouble: aDoubleArg, - aString: aStringArg, aUint8List: aUint8ListArg, aList: aListArg, aMap: aMapArg, - anEnum: anEnumArg, aProxyApi: aProxyApiArg, aNullableBool: aNullableBoolArg, - aNullableInt: aNullableIntArg, aNullableDouble: aNullableDoubleArg, - aNullableString: aNullableStringArg, aNullableUint8List: aNullableUint8ListArg, - aNullableList: aNullableListArg, aNullableMap: aNullableMapArg, - aNullableEnum: aNullableEnumArg, aNullableProxyApi: aNullableProxyApiArg, - boolParam: boolParamArg, intParam: intParamArg, doubleParam: doubleParamArg, - stringParam: stringParamArg, aUint8ListParam: aUint8ListParamArg, - listParam: listParamArg, mapParam: mapParamArg, enumParam: enumParamArg, - proxyApiParam: proxyApiParamArg, nullableBoolParam: nullableBoolParamArg, - nullableIntParam: nullableIntParamArg, nullableDoubleParam: nullableDoubleParamArg, - nullableStringParam: nullableStringParamArg, - nullableUint8ListParam: nullableUint8ListParamArg, - nullableListParam: nullableListParamArg, nullableMapParam: nullableMapParamArg, - nullableEnumParam: nullableEnumParamArg, - nullableProxyApiParam: nullableProxyApiParamArg), - withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - pigeonDefaultConstructorChannel.setMessageHandler(nil) - } - let namedConstructorChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.namedConstructor", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - namedConstructorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonIdentifierArg = args[0] as! Int64 - let aBoolArg = args[1] as! Bool - let anIntArg = args[2] as! Int64 - let aDoubleArg = args[3] as! Double - let aStringArg = args[4] as! String - let aUint8ListArg = args[5] as! FlutterStandardTypedData - let aListArg = args[6] as! [Any?] - let aMapArg = args[7] as! [String?: Any?] - let anEnumArg = args[8] as! ProxyApiTestEnum - let aProxyApiArg = args[9] as! ProxyApiSuperClass - let aNullableBoolArg: Bool? = nilOrValue(args[10]) - let aNullableIntArg: Int64? = nilOrValue(args[11]) - let aNullableDoubleArg: Double? = nilOrValue(args[12]) - let aNullableStringArg: String? = nilOrValue(args[13]) - let aNullableUint8ListArg: FlutterStandardTypedData? = nilOrValue(args[14]) - let aNullableListArg: [Any?]? = nilOrValue(args[15]) - let aNullableMapArg: [String?: Any?]? = nilOrValue(args[16]) - let aNullableEnumArg: ProxyApiTestEnum? = nilOrValue(args[17]) - let aNullableProxyApiArg: ProxyApiSuperClass? = nilOrValue(args[18]) - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.namedConstructor( - pigeonApi: api, aBool: aBoolArg, anInt: anIntArg, aDouble: aDoubleArg, - aString: aStringArg, aUint8List: aUint8ListArg, aList: aListArg, aMap: aMapArg, - anEnum: anEnumArg, aProxyApi: aProxyApiArg, aNullableBool: aNullableBoolArg, - aNullableInt: aNullableIntArg, aNullableDouble: aNullableDoubleArg, - aNullableString: aNullableStringArg, aNullableUint8List: aNullableUint8ListArg, - aNullableList: aNullableListArg, aNullableMap: aNullableMapArg, - aNullableEnum: aNullableEnumArg, aNullableProxyApi: aNullableProxyApiArg), - withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - namedConstructorChannel.setMessageHandler(nil) - } - let attachedFieldChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.attachedField", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - attachedFieldChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let pigeonIdentifierArg = args[1] as! Int64 - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.attachedField(pigeonApi: api, pigeonInstance: pigeonInstanceArg), - withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - attachedFieldChannel.setMessageHandler(nil) - } - let staticAttachedFieldChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAttachedField", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - staticAttachedFieldChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonIdentifierArg = args[0] as! Int64 - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.staticAttachedField(pigeonApi: api), - withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - staticAttachedFieldChannel.setMessageHandler(nil) - } - let noopChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noop", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - noopChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - do { - try api.pigeonDelegate.noop(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - noopChannel.setMessageHandler(nil) - } - let throwErrorChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwError", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - throwErrorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - do { - let result = try api.pigeonDelegate.throwError( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - throwErrorChannel.setMessageHandler(nil) - } - let throwErrorFromVoidChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwErrorFromVoid", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - throwErrorFromVoidChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - do { - try api.pigeonDelegate.throwErrorFromVoid( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - throwErrorFromVoidChannel.setMessageHandler(nil) - } - let throwFlutterErrorChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwFlutterError", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - throwFlutterErrorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - do { - let result = try api.pigeonDelegate.throwFlutterError( - pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - throwFlutterErrorChannel.setMessageHandler(nil) - } - let echoIntChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoInt", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoIntChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let anIntArg = args[1] as! Int64 - do { - let result = try api.pigeonDelegate.echoInt( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, anInt: anIntArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoIntChannel.setMessageHandler(nil) - } - let echoDoubleChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoDouble", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoDoubleChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aDoubleArg = args[1] as! Double - do { - let result = try api.pigeonDelegate.echoDouble( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aDouble: aDoubleArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoDoubleChannel.setMessageHandler(nil) - } - let echoBoolChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoBool", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoBoolChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aBoolArg = args[1] as! Bool - do { - let result = try api.pigeonDelegate.echoBool( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aBool: aBoolArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoBoolChannel.setMessageHandler(nil) - } - let echoStringChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoString", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aStringArg = args[1] as! String - do { - let result = try api.pigeonDelegate.echoString( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aString: aStringArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoStringChannel.setMessageHandler(nil) - } - let echoUint8ListChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoUint8List", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoUint8ListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aUint8ListArg = args[1] as! FlutterStandardTypedData - do { - let result = try api.pigeonDelegate.echoUint8List( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aUint8List: aUint8ListArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoUint8ListChannel.setMessageHandler(nil) - } - let echoObjectChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoObject", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoObjectChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let anObjectArg = args[1]! - do { - let result = try api.pigeonDelegate.echoObject( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, anObject: anObjectArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoObjectChannel.setMessageHandler(nil) - } - let echoListChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoList", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aListArg = args[1] as! [Any?] - do { - let result = try api.pigeonDelegate.echoList( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aList: aListArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoListChannel.setMessageHandler(nil) - } - let echoProxyApiListChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiList", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoProxyApiListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aListArg = args[1] as! [ProxyApiTestClass] - do { - let result = try api.pigeonDelegate.echoProxyApiList( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aList: aListArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoProxyApiListChannel.setMessageHandler(nil) - } - let echoMapChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoMap", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aMapArg = args[1] as! [String?: Any?] - do { - let result = try api.pigeonDelegate.echoMap( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aMap: aMapArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoMapChannel.setMessageHandler(nil) - } - let echoProxyApiMapChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiMap", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoProxyApiMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aMapArg = args[1] as! [String: ProxyApiTestClass] - do { - let result = try api.pigeonDelegate.echoProxyApiMap( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aMap: aMapArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoProxyApiMapChannel.setMessageHandler(nil) - } - let echoEnumChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoEnum", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoEnumChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let anEnumArg = args[1] as! ProxyApiTestEnum - do { - let result = try api.pigeonDelegate.echoEnum( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, anEnum: anEnumArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoEnumChannel.setMessageHandler(nil) - } - let echoProxyApiChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApi", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoProxyApiChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aProxyApiArg = args[1] as! ProxyApiSuperClass - do { - let result = try api.pigeonDelegate.echoProxyApi( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aProxyApi: aProxyApiArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoProxyApiChannel.setMessageHandler(nil) - } - let echoNullableIntChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableInt", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableIntChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aNullableIntArg: Int64? = nilOrValue(args[1]) - do { - let result = try api.pigeonDelegate.echoNullableInt( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aNullableInt: aNullableIntArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableIntChannel.setMessageHandler(nil) - } - let echoNullableDoubleChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableDouble", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableDoubleChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aNullableDoubleArg: Double? = nilOrValue(args[1]) - do { - let result = try api.pigeonDelegate.echoNullableDouble( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aNullableDouble: aNullableDoubleArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableDoubleChannel.setMessageHandler(nil) - } - let echoNullableBoolChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableBool", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableBoolChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aNullableBoolArg: Bool? = nilOrValue(args[1]) - do { - let result = try api.pigeonDelegate.echoNullableBool( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aNullableBool: aNullableBoolArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableBoolChannel.setMessageHandler(nil) - } - let echoNullableStringChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableString", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aNullableStringArg: String? = nilOrValue(args[1]) - do { - let result = try api.pigeonDelegate.echoNullableString( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aNullableString: aNullableStringArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableStringChannel.setMessageHandler(nil) - } - let echoNullableUint8ListChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableUint8List", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableUint8ListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aNullableUint8ListArg: FlutterStandardTypedData? = nilOrValue(args[1]) - do { - let result = try api.pigeonDelegate.echoNullableUint8List( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, - aNullableUint8List: aNullableUint8ListArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableUint8ListChannel.setMessageHandler(nil) - } - let echoNullableObjectChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableObject", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableObjectChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aNullableObjectArg: Any? = args[1] - do { - let result = try api.pigeonDelegate.echoNullableObject( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aNullableObject: aNullableObjectArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableObjectChannel.setMessageHandler(nil) - } - let echoNullableListChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableList", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aNullableListArg: [Any?]? = nilOrValue(args[1]) - do { - let result = try api.pigeonDelegate.echoNullableList( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aNullableList: aNullableListArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableListChannel.setMessageHandler(nil) - } - let echoNullableMapChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableMap", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aNullableMapArg: [String?: Any?]? = nilOrValue(args[1]) - do { - let result = try api.pigeonDelegate.echoNullableMap( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aNullableMap: aNullableMapArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableMapChannel.setMessageHandler(nil) - } - let echoNullableEnumChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableEnum", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableEnumChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aNullableEnumArg: ProxyApiTestEnum? = nilOrValue(args[1]) - do { - let result = try api.pigeonDelegate.echoNullableEnum( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aNullableEnum: aNullableEnumArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableEnumChannel.setMessageHandler(nil) - } - let echoNullableProxyApiChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableProxyApi", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoNullableProxyApiChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aNullableProxyApiArg: ProxyApiSuperClass? = nilOrValue(args[1]) - do { - let result = try api.pigeonDelegate.echoNullableProxyApi( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, - aNullableProxyApi: aNullableProxyApiArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoNullableProxyApiChannel.setMessageHandler(nil) - } - let noopAsyncChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noopAsync", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - noopAsyncChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - api.pigeonDelegate.noopAsync(pigeonApi: api, pigeonInstance: pigeonInstanceArg) { result in - switch result { - case .success: - reply(wrapResult(nil)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - noopAsyncChannel.setMessageHandler(nil) - } - let echoAsyncIntChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncInt", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncIntChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let anIntArg = args[1] as! Int64 - api.pigeonDelegate.echoAsyncInt( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, anInt: anIntArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncIntChannel.setMessageHandler(nil) - } - let echoAsyncDoubleChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncDouble", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncDoubleChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aDoubleArg = args[1] as! Double - api.pigeonDelegate.echoAsyncDouble( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aDouble: aDoubleArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncDoubleChannel.setMessageHandler(nil) - } - let echoAsyncBoolChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncBool", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncBoolChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aBoolArg = args[1] as! Bool - api.pigeonDelegate.echoAsyncBool( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aBool: aBoolArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncBoolChannel.setMessageHandler(nil) - } - let echoAsyncStringChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncString", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aStringArg = args[1] as! String - api.pigeonDelegate.echoAsyncString( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aString: aStringArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncStringChannel.setMessageHandler(nil) - } - let echoAsyncUint8ListChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncUint8List", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncUint8ListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aUint8ListArg = args[1] as! FlutterStandardTypedData - api.pigeonDelegate.echoAsyncUint8List( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aUint8List: aUint8ListArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncUint8ListChannel.setMessageHandler(nil) - } - let echoAsyncObjectChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncObject", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncObjectChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let anObjectArg = args[1]! - api.pigeonDelegate.echoAsyncObject( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, anObject: anObjectArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncObjectChannel.setMessageHandler(nil) - } - let echoAsyncListChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncList", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aListArg = args[1] as! [Any?] - api.pigeonDelegate.echoAsyncList( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aList: aListArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncListChannel.setMessageHandler(nil) - } - let echoAsyncMapChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncMap", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aMapArg = args[1] as! [String?: Any?] - api.pigeonDelegate.echoAsyncMap( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aMap: aMapArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncMapChannel.setMessageHandler(nil) - } - let echoAsyncEnumChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncEnum", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncEnumChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let anEnumArg = args[1] as! ProxyApiTestEnum - api.pigeonDelegate.echoAsyncEnum( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, anEnum: anEnumArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncEnumChannel.setMessageHandler(nil) - } - let throwAsyncErrorChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncError", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - throwAsyncErrorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - api.pigeonDelegate.throwAsyncError(pigeonApi: api, pigeonInstance: pigeonInstanceArg) { - result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - throwAsyncErrorChannel.setMessageHandler(nil) - } - let throwAsyncErrorFromVoidChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncErrorFromVoid", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - throwAsyncErrorFromVoidChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - api.pigeonDelegate.throwAsyncErrorFromVoid( - pigeonApi: api, pigeonInstance: pigeonInstanceArg - ) { result in - switch result { - case .success: - reply(wrapResult(nil)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - throwAsyncErrorFromVoidChannel.setMessageHandler(nil) - } - let throwAsyncFlutterErrorChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncFlutterError", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - throwAsyncFlutterErrorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - api.pigeonDelegate.throwAsyncFlutterError(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - throwAsyncFlutterErrorChannel.setMessageHandler(nil) - } - let echoAsyncNullableIntChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableInt", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableIntChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let anIntArg: Int64? = nilOrValue(args[1]) - api.pigeonDelegate.echoAsyncNullableInt( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, anInt: anIntArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableIntChannel.setMessageHandler(nil) - } - let echoAsyncNullableDoubleChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableDouble", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableDoubleChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aDoubleArg: Double? = nilOrValue(args[1]) - api.pigeonDelegate.echoAsyncNullableDouble( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aDouble: aDoubleArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableDoubleChannel.setMessageHandler(nil) - } - let echoAsyncNullableBoolChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableBool", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableBoolChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aBoolArg: Bool? = nilOrValue(args[1]) - api.pigeonDelegate.echoAsyncNullableBool( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aBool: aBoolArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableBoolChannel.setMessageHandler(nil) - } - let echoAsyncNullableStringChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableString", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aStringArg: String? = nilOrValue(args[1]) - api.pigeonDelegate.echoAsyncNullableString( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aString: aStringArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableStringChannel.setMessageHandler(nil) - } - let echoAsyncNullableUint8ListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableUint8List", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableUint8ListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aUint8ListArg: FlutterStandardTypedData? = nilOrValue(args[1]) - api.pigeonDelegate.echoAsyncNullableUint8List( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aUint8List: aUint8ListArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableUint8ListChannel.setMessageHandler(nil) - } - let echoAsyncNullableObjectChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableObject", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableObjectChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let anObjectArg: Any? = args[1] - api.pigeonDelegate.echoAsyncNullableObject( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, anObject: anObjectArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableObjectChannel.setMessageHandler(nil) - } - let echoAsyncNullableListChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableList", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aListArg: [Any?]? = nilOrValue(args[1]) - api.pigeonDelegate.echoAsyncNullableList( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aList: aListArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableListChannel.setMessageHandler(nil) - } - let echoAsyncNullableMapChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableMap", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aMapArg: [String?: Any?]? = nilOrValue(args[1]) - api.pigeonDelegate.echoAsyncNullableMap( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aMap: aMapArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableMapChannel.setMessageHandler(nil) - } - let echoAsyncNullableEnumChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableEnum", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoAsyncNullableEnumChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let anEnumArg: ProxyApiTestEnum? = nilOrValue(args[1]) - api.pigeonDelegate.echoAsyncNullableEnum( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, anEnum: anEnumArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - echoAsyncNullableEnumChannel.setMessageHandler(nil) - } - let staticNoopChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticNoop", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - staticNoopChannel.setMessageHandler { _, reply in - do { - try api.pigeonDelegate.staticNoop(pigeonApi: api) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - staticNoopChannel.setMessageHandler(nil) - } - let echoStaticStringChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoStaticString", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - echoStaticStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let aStringArg = args[0] as! String - do { - let result = try api.pigeonDelegate.echoStaticString(pigeonApi: api, aString: aStringArg) - reply(wrapResult(result)) - } catch { - reply(wrapError(error)) - } - } - } else { - echoStaticStringChannel.setMessageHandler(nil) - } - let staticAsyncNoopChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAsyncNoop", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - staticAsyncNoopChannel.setMessageHandler { _, reply in - api.pigeonDelegate.staticAsyncNoop(pigeonApi: api) { result in - switch result { - case .success: - reply(wrapResult(nil)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - staticAsyncNoopChannel.setMessageHandler(nil) - } - let callFlutterNoopChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoop", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterNoopChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - api.pigeonDelegate.callFlutterNoop(pigeonApi: api, pigeonInstance: pigeonInstanceArg) { - result in - switch result { - case .success: - reply(wrapResult(nil)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterNoopChannel.setMessageHandler(nil) - } - let callFlutterThrowErrorChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowError", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterThrowErrorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - api.pigeonDelegate.callFlutterThrowError(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterThrowErrorChannel.setMessageHandler(nil) - } - let callFlutterThrowErrorFromVoidChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowErrorFromVoid", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterThrowErrorFromVoidChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - api.pigeonDelegate.callFlutterThrowErrorFromVoid( - pigeonApi: api, pigeonInstance: pigeonInstanceArg - ) { result in - switch result { - case .success: - reply(wrapResult(nil)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterThrowErrorFromVoidChannel.setMessageHandler(nil) - } - let callFlutterEchoBoolChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoBool", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoBoolChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aBoolArg = args[1] as! Bool - api.pigeonDelegate.callFlutterEchoBool( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aBool: aBoolArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoBoolChannel.setMessageHandler(nil) - } - let callFlutterEchoIntChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoInt", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoIntChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let anIntArg = args[1] as! Int64 - api.pigeonDelegate.callFlutterEchoInt( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, anInt: anIntArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoIntChannel.setMessageHandler(nil) - } - let callFlutterEchoDoubleChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoDouble", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoDoubleChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aDoubleArg = args[1] as! Double - api.pigeonDelegate.callFlutterEchoDouble( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aDouble: aDoubleArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoDoubleChannel.setMessageHandler(nil) - } - let callFlutterEchoStringChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoString", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aStringArg = args[1] as! String - api.pigeonDelegate.callFlutterEchoString( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aString: aStringArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoStringChannel.setMessageHandler(nil) - } - let callFlutterEchoUint8ListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoUint8List", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoUint8ListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aUint8ListArg = args[1] as! FlutterStandardTypedData - api.pigeonDelegate.callFlutterEchoUint8List( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aUint8List: aUint8ListArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoUint8ListChannel.setMessageHandler(nil) - } - let callFlutterEchoListChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoList", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aListArg = args[1] as! [Any?] - api.pigeonDelegate.callFlutterEchoList( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aList: aListArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoListChannel.setMessageHandler(nil) - } - let callFlutterEchoProxyApiListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiList", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoProxyApiListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aListArg = args[1] as! [ProxyApiTestClass?] - api.pigeonDelegate.callFlutterEchoProxyApiList( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aList: aListArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoProxyApiListChannel.setMessageHandler(nil) - } - let callFlutterEchoMapChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoMap", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aMapArg = args[1] as! [String?: Any?] - api.pigeonDelegate.callFlutterEchoMap( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aMap: aMapArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoMapChannel.setMessageHandler(nil) - } - let callFlutterEchoProxyApiMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiMap", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoProxyApiMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aMapArg = args[1] as! [String?: ProxyApiTestClass?] - api.pigeonDelegate.callFlutterEchoProxyApiMap( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aMap: aMapArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoProxyApiMapChannel.setMessageHandler(nil) - } - let callFlutterEchoEnumChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoEnum", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoEnumChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let anEnumArg = args[1] as! ProxyApiTestEnum - api.pigeonDelegate.callFlutterEchoEnum( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, anEnum: anEnumArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoEnumChannel.setMessageHandler(nil) - } - let callFlutterEchoProxyApiChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApi", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoProxyApiChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aProxyApiArg = args[1] as! ProxyApiSuperClass - api.pigeonDelegate.callFlutterEchoProxyApi( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aProxyApi: aProxyApiArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoProxyApiChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableBoolChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableBool", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableBoolChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aBoolArg: Bool? = nilOrValue(args[1]) - api.pigeonDelegate.callFlutterEchoNullableBool( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aBool: aBoolArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableBoolChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableInt", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableIntChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let anIntArg: Int64? = nilOrValue(args[1]) - api.pigeonDelegate.callFlutterEchoNullableInt( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, anInt: anIntArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableIntChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableDoubleChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableDouble", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableDoubleChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aDoubleArg: Double? = nilOrValue(args[1]) - api.pigeonDelegate.callFlutterEchoNullableDouble( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aDouble: aDoubleArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableDoubleChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableString", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aStringArg: String? = nilOrValue(args[1]) - api.pigeonDelegate.callFlutterEchoNullableString( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aString: aStringArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableStringChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableUint8ListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableUint8List", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableUint8ListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aUint8ListArg: FlutterStandardTypedData? = nilOrValue(args[1]) - api.pigeonDelegate.callFlutterEchoNullableUint8List( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aUint8List: aUint8ListArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableUint8ListChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableList", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableListChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aListArg: [Any?]? = nilOrValue(args[1]) - api.pigeonDelegate.callFlutterEchoNullableList( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aList: aListArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableListChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableMap", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableMapChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aMapArg: [String?: Any?]? = nilOrValue(args[1]) - api.pigeonDelegate.callFlutterEchoNullableMap( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aMap: aMapArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableMapChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableEnum", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableEnumChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let anEnumArg: ProxyApiTestEnum? = nilOrValue(args[1]) - api.pigeonDelegate.callFlutterEchoNullableEnum( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, anEnum: anEnumArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableEnumChannel.setMessageHandler(nil) - } - let callFlutterEchoNullableProxyApiChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableProxyApi", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoNullableProxyApiChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aProxyApiArg: ProxyApiSuperClass? = nilOrValue(args[1]) - api.pigeonDelegate.callFlutterEchoNullableProxyApi( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aProxyApi: aProxyApiArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoNullableProxyApiChannel.setMessageHandler(nil) - } - let callFlutterNoopAsyncChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoopAsync", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterNoopAsyncChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - api.pigeonDelegate.callFlutterNoopAsync(pigeonApi: api, pigeonInstance: pigeonInstanceArg) { - result in - switch result { - case .success: - reply(wrapResult(nil)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterNoopAsyncChannel.setMessageHandler(nil) - } - let callFlutterEchoAsyncStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoAsyncString", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - callFlutterEchoAsyncStringChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiTestClass - let aStringArg = args[1] as! String - api.pigeonDelegate.callFlutterEchoAsyncString( - pigeonApi: api, pigeonInstance: pigeonInstanceArg, aString: aStringArg - ) { result in - switch result { - case .success(let res): - reply(wrapResult(res)) - case .failure(let error): - reply(wrapError(error)) - } - } - } - } else { - callFlutterEchoAsyncStringChannel.setMessageHandler(nil) - } - } - - ///Creates a Dart instance of ProxyApiTestClass and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: ProxyApiTestClass, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(())) - } else { - completion( - .failure( - ProxyApiTestsError( - code: "new-instance-error", - message: - "Error: Attempting to create a new Dart instance of ProxyApiTestClass, but the class has a nonnull callback method.", - details: ""))) - } - } - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic calling. - func flutterNoop( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoop" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else { - completion(.success(())) - } - } - } - - /// Responds with an error from an async function returning a value. - func flutterThrowError( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowError" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else { - let result: Any? = listResponse[0] - completion(.success(result)) - } - } - } - - /// Responds with an error from an async void function. - func flutterThrowErrorFromVoid( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowErrorFromVoid" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else { - completion(.success(())) - } - } - } - - /// Returns the passed boolean, to test serialization and deserialization. - func flutterEchoBool( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aBool aBoolArg: Bool, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoBool" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, aBoolArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - ProxyApiTestsError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! Bool - completion(.success(result)) - } - } - } - - /// Returns the passed int, to test serialization and deserialization. - func flutterEchoInt( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, anInt anIntArg: Int64, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoInt" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, anIntArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - ProxyApiTestsError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! Int64 - completion(.success(result)) - } - } - } - - /// Returns the passed double, to test serialization and deserialization. - func flutterEchoDouble( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aDouble aDoubleArg: Double, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoDouble" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, aDoubleArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - ProxyApiTestsError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! Double - completion(.success(result)) - } - } - } - - /// Returns the passed string, to test serialization and deserialization. - func flutterEchoString( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aString aStringArg: String, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoString" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - ProxyApiTestsError( - 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 byte list, to test serialization and deserialization. - func flutterEchoUint8List( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: FlutterStandardTypedData, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoUint8List" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, aListArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - ProxyApiTestsError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! FlutterStandardTypedData - completion(.success(result)) - } - } - } - - /// Returns the passed list, to test serialization and deserialization. - func flutterEchoList( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: [Any?], - completion: @escaping (Result<[Any?], ProxyApiTestsError>) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoList" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, aListArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - ProxyApiTestsError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! [Any?] - completion(.success(result)) - } - } - } - - /// Returns the passed list with ProxyApis, to test serialization and - /// deserialization. - func flutterEchoProxyApiList( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: [ProxyApiTestClass?], - completion: @escaping (Result<[ProxyApiTestClass?], ProxyApiTestsError>) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiList" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, aListArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - ProxyApiTestsError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! [ProxyApiTestClass?] - completion(.success(result)) - } - } - } - - /// Returns the passed map, to test serialization and deserialization. - func flutterEchoMap( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aMap aMapArg: [String?: Any?], - completion: @escaping (Result<[String?: Any?], ProxyApiTestsError>) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoMap" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, aMapArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - ProxyApiTestsError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! [String?: Any?] - completion(.success(result)) - } - } - } - - /// Returns the passed map with ProxyApis, to test serialization and - /// deserialization. - func flutterEchoProxyApiMap( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, - aMap aMapArg: [String?: ProxyApiTestClass?], - completion: @escaping (Result<[String?: ProxyApiTestClass?], ProxyApiTestsError>) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiMap" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, aMapArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - ProxyApiTestsError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! [String?: ProxyApiTestClass?] - completion(.success(result)) - } - } - } - - /// Returns the passed enum to test serialization and deserialization. - func flutterEchoEnum( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, anEnum anEnumArg: ProxyApiTestEnum, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoEnum" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, anEnumArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - ProxyApiTestsError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! ProxyApiTestEnum - completion(.success(result)) - } - } - } - - /// Returns the passed ProxyApi to test serialization and deserialization. - func flutterEchoProxyApi( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aProxyApi aProxyApiArg: ProxyApiSuperClass, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApi" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, aProxyApiArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - ProxyApiTestsError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) - } else { - let result = listResponse[0] as! ProxyApiSuperClass - completion(.success(result)) - } - } - } - - /// Returns the passed boolean, to test serialization and deserialization. - func flutterEchoNullableBool( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aBool aBoolArg: Bool?, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableBool" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, aBoolArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else { - let result: Bool? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - - /// Returns the passed int, to test serialization and deserialization. - func flutterEchoNullableInt( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, anInt anIntArg: Int64?, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableInt" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, anIntArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else { - let result: Int64? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - - /// Returns the passed double, to test serialization and deserialization. - func flutterEchoNullableDouble( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aDouble aDoubleArg: Double?, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableDouble" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, aDoubleArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else { - let result: Double? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - - /// Returns the passed string, to test serialization and deserialization. - func flutterEchoNullableString( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aString aStringArg: String?, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableString" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else { - let result: String? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - - /// Returns the passed byte list, to test serialization and deserialization. - func flutterEchoNullableUint8List( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: FlutterStandardTypedData?, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableUint8List" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, aListArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else { - let result: FlutterStandardTypedData? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - - /// Returns the passed list, to test serialization and deserialization. - func flutterEchoNullableList( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: [Any?]?, - completion: @escaping (Result<[Any?]?, ProxyApiTestsError>) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableList" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, aListArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else { - let result: [Any?]? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - - /// Returns the passed map, to test serialization and deserialization. - func flutterEchoNullableMap( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aMap aMapArg: [String?: Any?]?, - completion: @escaping (Result<[String?: Any?]?, ProxyApiTestsError>) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableMap" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, aMapArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else { - let result: [String?: Any?]? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - - /// Returns the passed enum to test serialization and deserialization. - func flutterEchoNullableEnum( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, anEnum anEnumArg: ProxyApiTestEnum?, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableEnum" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, anEnumArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else { - let result: ProxyApiTestEnum? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - - /// Returns the passed ProxyApi to test serialization and deserialization. - func flutterEchoNullableProxyApi( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, - aProxyApi aProxyApiArg: ProxyApiSuperClass?, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableProxyApi" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, aProxyApiArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else { - let result: ProxyApiSuperClass? = nilOrValue(listResponse[0]) - completion(.success(result)) - } - } - } - - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic asynchronous calling. - func flutterNoopAsync( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoopAsync" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else { - completion(.success(())) - } - } - } - - /// Returns the passed in generic Object asynchronously. - func flutterEchoAsyncString( - pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aString aStringArg: String, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoAsyncString" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg, 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - ProxyApiTestsError( - 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)) - } - } - } - -} -protocol PigeonApiDelegateProxyApiSuperClass { - func pigeonDefaultConstructor(pigeonApi: PigeonApiProxyApiSuperClass) throws -> ProxyApiSuperClass - func aSuperMethod(pigeonApi: PigeonApiProxyApiSuperClass, pigeonInstance: ProxyApiSuperClass) - throws -} - -protocol PigeonApiProtocolProxyApiSuperClass { -} - -final class PigeonApiProxyApiSuperClass: PigeonApiProtocolProxyApiSuperClass { - unowned let pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar - let pigeonDelegate: PigeonApiDelegateProxyApiSuperClass - init( - pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateProxyApiSuperClass - ) { - self.pigeonRegistrar = pigeonRegistrar - self.pigeonDelegate = delegate - } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiProxyApiSuperClass? - ) { - let codec: FlutterStandardMessageCodec = - api != nil - ? FlutterStandardMessageCodec( - readerWriter: ProxyApiTestsPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) - : FlutterStandardMessageCodec.sharedInstance() - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - pigeonDefaultConstructorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonIdentifierArg = args[0] as! Int64 - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), - withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - pigeonDefaultConstructorChannel.setMessageHandler(nil) - } - let aSuperMethodChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.aSuperMethod", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - aSuperMethodChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ProxyApiSuperClass - do { - try api.pigeonDelegate.aSuperMethod(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - aSuperMethodChannel.setMessageHandler(nil) - } - } - - ///Creates a Dart instance of ProxyApiSuperClass and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: ProxyApiSuperClass, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else { - completion(.success(())) - } - } - } - } -} -open class PigeonApiDelegateProxyApiInterface { -} - -protocol PigeonApiProtocolProxyApiInterface { - func anInterfaceMethod( - pigeonInstance pigeonInstanceArg: ProxyApiInterface, - completion: @escaping (Result) -> Void) -} - -final class PigeonApiProxyApiInterface: PigeonApiProtocolProxyApiInterface { - unowned let pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar - let pigeonDelegate: PigeonApiDelegateProxyApiInterface - init( - pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateProxyApiInterface - ) { - self.pigeonRegistrar = pigeonRegistrar - self.pigeonDelegate = delegate - } - ///Creates a Dart instance of ProxyApiInterface and attaches it to [pigeonInstance]. - func pigeonNewInstance( - pigeonInstance: ProxyApiInterface, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else { - completion(.success(())) - } - } - } - } - func anInterfaceMethod( - pigeonInstance pigeonInstanceArg: ProxyApiInterface, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - return - } - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.anInterfaceMethod" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonInstanceArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else { - completion(.success(())) - } - } - } - -} -protocol PigeonApiDelegateClassWithApiRequirement { - @available(iOS 15.0.0, macOS 10.0.0, *) - func pigeonDefaultConstructor(pigeonApi: PigeonApiClassWithApiRequirement) throws - -> ClassWithApiRequirement - @available(iOS 15.0.0, macOS 10.0.0, *) - func aMethod(pigeonApi: PigeonApiClassWithApiRequirement, pigeonInstance: ClassWithApiRequirement) - throws -} - -protocol PigeonApiProtocolClassWithApiRequirement { -} - -final class PigeonApiClassWithApiRequirement: PigeonApiProtocolClassWithApiRequirement { - unowned let pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar - let pigeonDelegate: PigeonApiDelegateClassWithApiRequirement - init( - pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar, - delegate: PigeonApiDelegateClassWithApiRequirement - ) { - self.pigeonRegistrar = pigeonRegistrar - self.pigeonDelegate = delegate - } - static func setUpMessageHandlers( - binaryMessenger: FlutterBinaryMessenger, api: PigeonApiClassWithApiRequirement? - ) { - let codec: FlutterStandardMessageCodec = - api != nil - ? FlutterStandardMessageCodec( - readerWriter: ProxyApiTestsPigeonInternalProxyApiCodecReaderWriter( - pigeonRegistrar: api!.pigeonRegistrar)) - : FlutterStandardMessageCodec.sharedInstance() - if #available(iOS 15.0.0, macOS 10.0.0, *) { - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - pigeonDefaultConstructorChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonIdentifierArg = args[0] as! Int64 - do { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), - withIdentifier: pigeonIdentifierArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - pigeonDefaultConstructorChannel.setMessageHandler(nil) - } - } else { - let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_defaultConstructor", - binaryMessenger: binaryMessenger, codec: codec) - if api != nil { - pigeonDefaultConstructorChannel.setMessageHandler { message, reply in - reply( - wrapError( - FlutterError( - code: "PigeonUnsupportedOperationError", - message: - "Call to pigeonDefaultConstructor requires @available(iOS 15.0.0, macOS 10.0.0, *).", - details: nil - ))) - } - } else { - pigeonDefaultConstructorChannel.setMessageHandler(nil) - } - } - if #available(iOS 15.0.0, macOS 10.0.0, *) { - let aMethodChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.aMethod", - binaryMessenger: binaryMessenger, codec: codec) - if let api = api { - aMethodChannel.setMessageHandler { message, reply in - let args = message as! [Any?] - let pigeonInstanceArg = args[0] as! ClassWithApiRequirement - do { - try api.pigeonDelegate.aMethod(pigeonApi: api, pigeonInstance: pigeonInstanceArg) - reply(wrapResult(nil)) - } catch { - reply(wrapError(error)) - } - } - } else { - aMethodChannel.setMessageHandler(nil) - } - } else { - let aMethodChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.aMethod", - binaryMessenger: binaryMessenger, codec: codec) - if api != nil { - aMethodChannel.setMessageHandler { message, reply in - reply( - wrapError( - FlutterError( - code: "PigeonUnsupportedOperationError", - message: "Call to aMethod requires @available(iOS 15.0.0, macOS 10.0.0, *).", - details: nil - ))) - } - } else { - aMethodChannel.setMessageHandler(nil) - } - } - } - - ///Creates a Dart instance of ClassWithApiRequirement and attaches it to [pigeonInstance]. - @available(iOS 15.0.0, macOS 10.0.0, *) - func pigeonNewInstance( - pigeonInstance: ClassWithApiRequirement, - completion: @escaping (Result) -> Void - ) { - if pigeonRegistrar.ignoreCallsToDart { - completion( - .failure( - ProxyApiTestsError( - code: "ignore-calls-error", - message: "Calls to Dart are being ignored.", details: ""))) - } else if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { - completion(.success(())) - } else { - let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( - pigeonInstance as AnyObject) - let binaryMessenger = pigeonRegistrar.binaryMessenger - let codec = pigeonRegistrar.codec - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_newInstance" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([pigeonIdentifierArg] 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(ProxyApiTestsError(code: code, message: message, details: details))) - } else { - completion(.success(())) - } - } - } - } -} diff --git a/packages/pigeon/platform_tests/test_plugin/macos/test_plugin.podspec b/packages/pigeon/platform_tests/test_plugin/macos/test_plugin.podspec deleted file mode 100644 index 77a7e3bbfbd..00000000000 --- a/packages/pigeon/platform_tests/test_plugin/macos/test_plugin.podspec +++ /dev/null @@ -1,23 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. -# Run `pod lib lint test_plugin.podspec` to validate before publishing. -# -Pod::Spec.new do |s| - s.name = 'test_plugin' - s.version = '0.0.1' - s.summary = 'Pigeon test plugin' - s.description = <<-DESC - A plugin to test Pigeon generation for primary languages. - DESC - s.homepage = 'http://example.com' - s.license = { :type => 'BSD', :file => '../../../LICENSE' } - s.author = { 'Your Company' => 'email@example.com' } - - s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/pigeon' } - s.source_files = 'Classes/**/*' - s.dependency 'FlutterMacOS' - - s.platform = :osx, '10.14' - s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } - s.swift_version = '5.0' -end diff --git a/packages/pigeon/platform_tests/test_plugin/pubspec.yaml b/packages/pigeon/platform_tests/test_plugin/pubspec.yaml index 0547092ec50..f50e5da3cd1 100644 --- a/packages/pigeon/platform_tests/test_plugin/pubspec.yaml +++ b/packages/pigeon/platform_tests/test_plugin/pubspec.yaml @@ -15,10 +15,12 @@ flutter: pluginClass: TestPlugin ios: pluginClass: TestPlugin + sharedDarwinSource: true linux: pluginClass: TestPlugin macos: pluginClass: TestPlugin + sharedDarwinSource: true windows: pluginClass: TestPluginCApi diff --git a/packages/pigeon/tool/shared/generation.dart b/packages/pigeon/tool/shared/generation.dart index ec52d0b25c9..8972745553c 100644 --- a/packages/pigeon/tool/shared/generation.dart +++ b/packages/pigeon/tool/shared/generation.dart @@ -141,10 +141,10 @@ Future generateTestPigeons( kotlinPackage: 'com.example.test_plugin', kotlinErrorClassName: kotlinErrorName, kotlinIncludeErrorClass: input != 'primitive', - // iOS + // iOS/macOS swiftOut: skipLanguages.contains(GeneratorLanguage.swift) ? null - : '$outputBase/ios/Classes/$pascalCaseName.gen.swift', + : '$outputBase/darwin/Classes/$pascalCaseName.gen.swift', swiftErrorClassName: swiftErrorClassName, swiftIncludeErrorClass: input != 'primitive', // Linux @@ -169,24 +169,6 @@ Future generateTestPigeons( return generateCode; } - // macOS has to be run as a separate generation, since currently Pigeon - // doesn't have a way to output separate macOS and iOS Swift output in a - // single invocation. - generateCode = await runPigeon( - input: './pigeons/$input.dart', - swiftOut: skipLanguages.contains(GeneratorLanguage.swift) - ? null - : '$outputBase/macos/Classes/$pascalCaseName.gen.swift', - swiftErrorClassName: swiftErrorClassName, - swiftIncludeErrorClass: input != 'primitive', - suppressVersion: true, - dartPackageName: 'pigeon_integration_tests', - injectOverflowTypes: includeOverflow && input == 'core_tests', - ); - if (generateCode != 0) { - return generateCode; - } - // Generate the alternate language test plugin output. generateCode = await runPigeon( input: './pigeons/$input.dart', @@ -198,38 +180,13 @@ Future generateTestPigeons( : '$alternateOutputBase/android/src/main/java/com/example/' 'alternate_language_test_plugin/${_javaFilenameForName(input)}.java', javaPackage: 'com.example.alternate_language_test_plugin', - // iOS - objcHeaderOut: skipLanguages.contains(GeneratorLanguage.objc) - ? null - : '$alternateOutputBase/ios/Classes/$pascalCaseName.gen.h', - objcSourceOut: skipLanguages.contains(GeneratorLanguage.objc) - ? null - : '$alternateOutputBase/ios/Classes/$pascalCaseName.gen.m', - objcPrefix: input == 'core_tests' - ? 'FLT' - : input == 'enum' - ? 'PGN' - : '', - suppressVersion: true, - dartPackageName: 'pigeon_integration_tests', - injectOverflowTypes: includeOverflow && input == 'core_tests', - mergeDefinitionFileOptions: input != 'enum', - ); - if (generateCode != 0) { - return generateCode; - } - - // macOS has to be run as a separate generation, since currently Pigeon - // doesn't have a way to output separate macOS and iOS Swift output in a - // single invocation. - generateCode = await runPigeon( - input: './pigeons/$input.dart', + // iOS/macOS objcHeaderOut: skipLanguages.contains(GeneratorLanguage.objc) ? null - : '$alternateOutputBase/macos/Classes/$pascalCaseName.gen.h', + : '$alternateOutputBase/darwin/Classes/$pascalCaseName.gen.h', objcSourceOut: skipLanguages.contains(GeneratorLanguage.objc) ? null - : '$alternateOutputBase/macos/Classes/$pascalCaseName.gen.m', + : '$alternateOutputBase/darwin/Classes/$pascalCaseName.gen.m', objcPrefix: input == 'core_tests' ? 'FLT' : input == 'enum'