diff --git a/packages/pigeon/CHANGELOG.md b/packages/pigeon/CHANGELOG.md index 97c1f972659e..b3e5ebb0baa7 100644 --- a/packages/pigeon/CHANGELOG.md +++ b/packages/pigeon/CHANGELOG.md @@ -1,3 +1,7 @@ +## 29.0.13 + +* [dart] Separates generated Dart native interop bindings into a conditionally imported companion file (`*.native_interop.g.dart`) so that the main generated Dart file can be imported on Web without pulling in `dart:ffi` or `dart:io`. + ## 29.0.12 * [kotlin] Warns after JNI code generation if the `jni` version constraint in `pubspec.yaml` allows versions below `1.1.1`. diff --git a/packages/pigeon/example/native_interop_app/lib/src/native_interop_example.g.dart b/packages/pigeon/example/native_interop_app/lib/src/native_interop_example.g.dart index 0da455f54927..0a6483ff9d00 100644 --- a/packages/pigeon/example/native_interop_app/lib/src/native_interop_example.g.dart +++ b/packages/pigeon/example/native_interop_app/lib/src/native_interop_example.g.dart @@ -7,17 +7,14 @@ // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, omit_local_variable_types, omit_obvious_local_variable_types import 'dart:async'; -import 'dart:ffi'; -import 'dart:io' show Platform; -import 'dart:typed_data' show Float32List, Float64List, Int32List, Int64List, Int8List, TypedData; +import 'dart:typed_data' show Float64List, Int32List, Int64List; -import 'package:ffi/ffi.dart'; +import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter/services.dart'; -import 'package:jni/jni.dart'; -import 'package:meta/meta.dart' show immutable, protected, visibleForTesting; -import 'package:objective_c/objective_c.dart'; -import './native_interop_example.g.ffi.dart' as ffi_bridge; -import './native_interop_example.g.jni.dart' as jni_bridge; +import 'package:meta/meta.dart' show immutable, internal, protected, visibleForTesting; +import './native_interop_example.g.dart' + if (dart.library.ffi) './native_interop_example.native_interop.g.dart' + as pigeon_native; Object? _extractReplyValueOrThrow( List? replyList, @@ -44,379 +41,6 @@ Object? _extractReplyValueOrThrow( return replyList.firstOrNull; } -class _PigeonJniCodec { - static JObject get _kotlinUnit { - final JClass unitClass = JClass.forName('kotlin/Unit'); - try { - return unitClass.staticFieldId('INSTANCE', 'Lkotlin/Unit;').get(unitClass, JObject.type); - } finally { - unitClass.release(); - } - } - - static Object? readValue(JObject? value) { - if (value == null) { - return null; - } - if (value.isA(JLong.type)) { - return value.as(JLong.type).longValue(); - } else if (value.isA(JDouble.type)) { - return value.as(JDouble.type).doubleValue(); - } else if (value.isA(JString.type)) { - return value.as(JString.type).toDartString(); - } else if (value.isA(JBoolean.type)) { - return value.as(JBoolean.type).booleanValue(); - } else if (value.isA(JByteArray.type)) { - final JByteArray array = value.as(JByteArray.type); - return Uint8List.fromList(array.getRange(0, array.length).buffer.asUint8List()); - } else if (value.isA(JIntArray.type)) { - final JIntArray array = value.as(JIntArray.type); - return Int32List.fromList(array.getRange(0, array.length)); - } else if (value.isA(JLongArray.type)) { - final JLongArray array = value.as(JLongArray.type); - return Int64List.fromList(array.getRange(0, array.length)); - } else if (value.isA(JDoubleArray.type)) { - final JDoubleArray array = value.as(JDoubleArray.type); - return Float64List.fromList(array.getRange(0, array.length)); - } else if (value.isA>(JList.type as JType>)) { - final List list = value.as(JList.type).asDart(); - final res = []; - // Cache the length before iterating to avoid a JNI hop per iteration. - final int len = list.length; - for (int i = 0; i < len; i++) { - res.add(readValue(list[i])); - } - return res; - } else if (value.isA>(JMap.type as JType>)) { - final Map map = value.as(JMap.type).asDart(); - final res = {}; - for (final MapEntry entry in map.entries) { - res[readValue(entry.key)] = readValue(entry.value); - } - return res; - } else { - throw ArgumentError.value(value); - } - } - - static T writeValue(Object? value) { - if (value == null) { - return null as T; - } - if (value is bool) { - return JBoolean(value) as T; - } else if (value is double) { - return JDouble(value) as T; - // ignore: avoid_double_and_int_checks - } else if (value is int) { - return JLong(value) as T; - } else if (value is String) { - return value.toJString() as T; - } else if (value is Uint8List) { - final JByteArray array = JByteArray(value.length); - array.setRange( - 0, - value.length, - Int8List.view(value.buffer, value.offsetInBytes, value.length), - ); - return array as T; - } else if (value is Int32List) { - final JIntArray array = JIntArray(value.length); - array.setRange(0, value.length, value); - return array as T; - } else if (value is Int64List) { - final JLongArray array = JLongArray(value.length); - array.setRange(0, value.length, value); - return array as T; - } else if (value is Float64List) { - final JDoubleArray array = JDoubleArray(value.length); - array.setRange(0, value.length, value); - return array as T; - } else if (value is List) { - return value.map((e) => writeValue(e)).toJList() as T; - } else if (value is List) { - return value.map((e) => writeValue(e)).toJList() as T; - } else if (value is Map) { - return value - .map( - (k, v) => MapEntry(writeValue(k), writeValue(v)), - ) - .toJMap() - as T; - } else if (value is Map) { - return value - .map( - (k, v) => MapEntry(writeValue(k), writeValue(v)), - ) - .toJMap() - as T; - } else if (value is Map) { - return value - .map( - (k, v) => MapEntry(writeValue(k), writeValue(v)), - ) - .toJMap() - as T; - } else { - throw ArgumentError.value(value); - } - } -} - -class _PigeonFfiCodec { - static Object? readValue(ObjCObject? value, [Type? type, Type? type2]) { - if (value == null || ffi_bridge.NativeInteropExamplePigeonInternalNull.isA(value)) { - return null; - } else if (NSNumber.isA(value)) { - final NSNumber numValue = NSNumber.as(value); - if (type == double) { - return numValue.doubleValue; - } else if (type == bool) { - return numValue.boolValue; - } - - return numValue.longValue; - } else if (NSString.isA(value)) { - return NSString.as(value).toDartString(); - } else if (ffi_bridge.NativeInteropExamplePigeonTypedData.isA(value)) { - return _getValueFromPigeonTypedData(value as ffi_bridge.NativeInteropExamplePigeonTypedData); - } else if (NSArray.isA(value)) { - final NSArray array = NSArray.as(value); - final List res = []; - for (int i = 0; i < array.count; i++) { - res.add(readValue(array.objectAtIndex(i), type)); - } - return res; - } else if (NSDictionary.isA(value)) { - final NSDictionary dict = NSDictionary.as(value); - final NSArray keys = dict.allKeys; - final Map res = {}; - for (int i = 0; i < keys.count; i++) { - final ObjCObject key = keys.objectAtIndex(i); - res[readValue(key, type, type2)] = readValue(dict.objectForKey(key), type, type2); - } - return res; - } else if (ffi_bridge.NativeInteropExampleNumberWrapper.isA(value)) { - return _convertNumberWrapperToDart(ffi_bridge.NativeInteropExampleNumberWrapper.as(value)); - } else { - throw ArgumentError.value(value); - } - } - - static T writeValue(Object? value, {bool generic = false}) { - if (value == null) { - if (_isTypeOrNullableType(ObjCObject) || _isTypeOrNullableType(NSObject)) { - return ffi_bridge.NativeInteropExamplePigeonInternalNull() as T; - } - return null as T; - } - if (value is bool) { - return (generic - ? _convertToFfiNumberWrapper(value) - : NSNumber.alloc().initWithLong(value ? 1 : 0)) - as T; - } else if (value is double) { - return (generic ? _convertToFfiNumberWrapper(value) : NSNumber.alloc().initWithDouble(value)) - as T; - // ignore: avoid_double_and_int_checks - } else if (value is int) { - return (generic ? _convertToFfiNumberWrapper(value) : NSNumber.alloc().initWithLong(value)) - as T; - } else if (value is Enum) { - return (generic - ? _convertToFfiNumberWrapper(value) - : NSNumber.alloc().initWithLong(value.index)) - as T; - } else if (value is String) { - return NSString(value) as T; - } else if (value is TypedData) { - return _toPigeonTypedData(value) as T; - } else if (value is List) { - final NSMutableArray res = NSMutableArray(); - for (final Object? entry in value) { - res.addObject( - entry == null - ? ffi_bridge.NativeInteropExamplePigeonInternalNull() - : writeValue(entry, generic: true), - ); - } - return res as T; - } else if (value is Map) { - final NSMutableDictionary res = NSMutableDictionary(); - for (final MapEntry entry in value.entries) { - res.setObject( - writeValue(entry.value, generic: true), - forKey: NSCopying.as(writeValue(entry.key, generic: true)), - ); - } - return res as T; - } else { - throw ArgumentError.value(value); - } - } -} - -ffi_bridge.NativeInteropExamplePigeonTypedData _toPigeonTypedData(TypedData value) { - final int lengthInBytes = value.lengthInBytes; - if (value is Uint8List) { - final int length = value.length; - final Pointer ptr = calloc(length); - ptr.asTypedList(length).setAll(0, value); - final NSData nsData = NSData.dataWithBytes(ptr.cast(), length: lengthInBytes); - calloc.free(ptr); - return ffi_bridge.NativeInteropExamplePigeonTypedData.alloc().initWithData(nsData, type: 0); - } else if (value is Int32List) { - final int length = value.length; - final Pointer ptr = calloc(length); - ptr.asTypedList(length).setAll(0, value); - final NSData nsData = NSData.dataWithBytes(ptr.cast(), length: lengthInBytes); - calloc.free(ptr); - return ffi_bridge.NativeInteropExamplePigeonTypedData.alloc().initWithData(nsData, type: 1); - } else if (value is Int64List) { - final int length = value.length; - final Pointer ptr = calloc(length); - ptr.asTypedList(length).setAll(0, value); - final NSData nsData = NSData.dataWithBytes(ptr.cast(), length: lengthInBytes); - calloc.free(ptr); - return ffi_bridge.NativeInteropExamplePigeonTypedData.alloc().initWithData(nsData, type: 2); - } else if (value is Float32List) { - final int length = value.length; - final Pointer ptr = calloc(length); - ptr.asTypedList(length).setAll(0, value); - final NSData nsData = NSData.dataWithBytes(ptr.cast(), length: lengthInBytes); - calloc.free(ptr); - return ffi_bridge.NativeInteropExamplePigeonTypedData.alloc().initWithData(nsData, type: 3); - } else if (value is Float64List) { - final int length = value.length; - final Pointer ptr = calloc(length); - ptr.asTypedList(length).setAll(0, value); - final NSData nsData = NSData.dataWithBytes(ptr.cast(), length: lengthInBytes); - calloc.free(ptr); - return ffi_bridge.NativeInteropExamplePigeonTypedData.alloc().initWithData(nsData, type: 4); - } - throw ArgumentError.value(value); -} - -Object? _getValueFromPigeonTypedData(ffi_bridge.NativeInteropExamplePigeonTypedData value) { - final NSData data = value.data; - final ObjCObjectRef dataRef = data.object$.ref; - try { - final int lengthInBytes = data.length; - if (lengthInBytes == 0) { - return switch (value.type) { - 0 => Uint8List(0), - 1 => Int32List(0), - 2 => Int64List(0), - 3 => Float32List(0), - 4 => Float64List(0), - _ => throw ArgumentError.value(value), - }; - } - final Pointer bytes = data.bytes; - return switch (value.type) { - 0 => Uint8List.fromList(bytes.cast().asTypedList(lengthInBytes)), - 1 => Int32List.fromList(bytes.cast().asTypedList(lengthInBytes ~/ 4)), - 2 => Int64List.fromList(bytes.cast().asTypedList(lengthInBytes ~/ 8)), - 3 => Float32List.fromList(bytes.cast().asTypedList(lengthInBytes ~/ 4)), - 4 => Float64List.fromList(bytes.cast().asTypedList(lengthInBytes ~/ 8)), - _ => throw ArgumentError.value(value), - }; - } finally { - dataRef.release(); - } -} - -Object? _convertNumberWrapperToDart(ffi_bridge.NativeInteropExampleNumberWrapper value) { - switch (value.type) { - case 1: - return value.number.longValue; - case 2: - return value.number.doubleValue; - case 3: - return value.number.boolValue; - default: - throw ArgumentError.value(value); - } -} - -ffi_bridge.NativeInteropExampleNumberWrapper _convertToFfiNumberWrapper(Object value) { - switch (value) { - case int _: - return ffi_bridge.NativeInteropExampleNumberWrapper.alloc().initWithNumber( - NSNumber.alloc().initWithLong(value), - type: 1, - ); - case double _: - return ffi_bridge.NativeInteropExampleNumberWrapper.alloc().initWithNumber( - NSNumber.alloc().initWithDouble(value), - type: 2, - ); - case bool _: - return ffi_bridge.NativeInteropExampleNumberWrapper.alloc().initWithNumber( - NSNumber.alloc().initWithLong(value ? 1 : 0), - type: 3, - ); - default: - throw ArgumentError.value(value); - } -} - -bool _isType(Type t) => T == t; -bool _isTypeOrNullableType(Type t) => _isType(t) || _isType(t); - -void _throwNoInstanceError(String channelName) { - String nameString = 'named $channelName'; - if (channelName == defaultInstanceName) { - nameString = 'with no name'; - } - final String error = 'No instance $nameString has been registered.'; - throw ArgumentError(error); -} - -void _throwIfFfiError(ffi_bridge.PigeonError error) { - if (error.code != null) { - throw _wrapFfiError(error); - } -} - -PlatformException _wrapFfiError(ffi_bridge.PigeonError error) => PlatformException( - code: error.code!.toDartString(), - message: error.message?.toDartString(), - details: NSString.isA(error.details) ? error.details!.toDartString() : error.details, -); - -void _reportFfiError(ffi_bridge.PigeonError errorOut, Object e) { - if (e is PlatformException) { - errorOut.code = NSString(e.code); - errorOut.message = NSString(e.message ?? ''); - errorOut.details = NSString((e.details ?? '').toString()); - } else { - errorOut.code = NSString('error'); - errorOut.message = NSString(e.toString()); - errorOut.details = null; - } -} - -PlatformException _wrapJniException(JThrowable e) { - if (e.isA(jni_bridge.FlutterError.type)) { - final jni_bridge.FlutterError pigeonError = e.as(jni_bridge.FlutterError.type); - return PlatformException( - code: pigeonError.code.toDartString(), - message: pigeonError.message?.toDartString(), - details: pigeonError.details?.isA(JString.type) ?? false - ? pigeonError.details!.as(JString.type).toDartString() - : pigeonError.details, - stacktrace: e.javaStackTrace, - ); - } - return PlatformException( - code: 'PlatformException', - message: e.message, - details: e, - stacktrace: e.javaStackTrace, - ); -} - class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -440,59 +64,22 @@ class _PigeonCodec extends StandardMessageCodec { const String defaultInstanceName = 'PigeonDefaultClassName32uh4ui3lh445uh4h3l2l455g4y34u'; -class NativeInteropExampleApiForNativeInterop { - NativeInteropExampleApiForNativeInterop._withRegistrar({ - jni_bridge.NativeInteropExampleApiRegistrar? jniApi, - ffi_bridge.NativeInteropExampleApiSetup? ffiApi, - }) : _jniApi = jniApi, - _ffiApi = ffiApi; +@internal +NativeInteropExampleApiForNativeInterop? pigeon_getInstance_NativeInteropExampleApi({ + String channelName = defaultInstanceName, +}) { + throw UnsupportedError( + 'Native Interop is not supported on this platform. Use NativeInteropExampleApi instead.', + ); +} +abstract class NativeInteropExampleApiForNativeInterop { /// Returns instance of NativeInteropExampleApiForNativeInterop with specified [channelName] if one has been registered. static NativeInteropExampleApiForNativeInterop? getInstance({ String channelName = defaultInstanceName, - }) { - final NativeInteropExampleApiForNativeInterop res; - if (Platform.isAndroid) { - final jni_bridge.NativeInteropExampleApiRegistrar? link = - jni_bridge.NativeInteropExampleApiRegistrar().getInstance(channelName.toJString()); - if (link == null) { - _throwNoInstanceError(channelName); - } - res = NativeInteropExampleApiForNativeInterop._withRegistrar(jniApi: link); - } else if (Platform.isIOS || Platform.isMacOS) { - final ffi_bridge.NativeInteropExampleApiSetup? link = - ffi_bridge.NativeInteropExampleApiSetup.getInstanceWithName(NSString(channelName)); - if (link == null) { - _throwNoInstanceError(channelName); - } - res = NativeInteropExampleApiForNativeInterop._withRegistrar(ffiApi: link); - } else { - throw UnsupportedError( - 'Native Interop is not supported on this platform. Use NativeInteropExampleApi instead.', - ); - } - return res; - } + }) => pigeon_native.pigeon_getInstance_NativeInteropExampleApi(channelName: channelName); - late final jni_bridge.NativeInteropExampleApiRegistrar? _jniApi; - late final ffi_bridge.NativeInteropExampleApiSetup? _ffiApi; - - void doSomething() { - try { - if (_jniApi != null) { - return _jniApi.doSomething(); - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.PigeonError(); - _ffiApi.doSomethingWithWrappedError(pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - return; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + void doSomething(); } class NativeInteropExampleApi { @@ -520,7 +107,7 @@ class NativeInteropExampleApi { }) { NativeInteropExampleApiForNativeInterop? nativeInteropApi; String nativeInteropApiInstanceName = ''; - if (Platform.isAndroid || Platform.isIOS || Platform.isMacOS) { + if (!kIsWeb) { if (messageChannelSuffix.isEmpty) { nativeInteropApi = NativeInteropExampleApiForNativeInterop.getInstance(); } else { diff --git a/packages/pigeon/example/native_interop_app/lib/src/native_interop_example.native_interop.g.dart b/packages/pigeon/example/native_interop_app/lib/src/native_interop_example.native_interop.g.dart new file mode 100644 index 000000000000..8d16983e83dc --- /dev/null +++ b/packages/pigeon/example/native_interop_app/lib/src/native_interop_example.native_interop.g.dart @@ -0,0 +1,453 @@ +// Copyright 2013 The Flutter Authors +// 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 +// ignore_for_file: unused_import, unused_shown_name +// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, omit_local_variable_types, omit_obvious_local_variable_types + +import 'dart:async'; +import 'dart:ffi'; +import 'dart:io' show Platform; +import 'dart:typed_data' show Float32List, Float64List, Int32List, Int64List, Int8List, TypedData; + +import 'package:ffi/ffi.dart'; +import 'package:flutter/services.dart'; +import 'package:jni/jni.dart'; +import 'package:objective_c/objective_c.dart'; +import './native_interop_example.g.dart'; +import './native_interop_example.g.ffi.dart' as ffi_bridge; +import './native_interop_example.g.jni.dart' as jni_bridge; + +class _PigeonJniCodec { + static JObject get _kotlinUnit { + final JClass unitClass = JClass.forName('kotlin/Unit'); + try { + return unitClass.staticFieldId('INSTANCE', 'Lkotlin/Unit;').get(unitClass, JObject.type); + } finally { + unitClass.release(); + } + } + + static Object? readValue(JObject? value) { + if (value == null) { + return null; + } + if (value.isA(JLong.type)) { + return value.as(JLong.type).longValue(); + } else if (value.isA(JDouble.type)) { + return value.as(JDouble.type).doubleValue(); + } else if (value.isA(JString.type)) { + return value.as(JString.type).toDartString(); + } else if (value.isA(JBoolean.type)) { + return value.as(JBoolean.type).booleanValue(); + } else if (value.isA(JByteArray.type)) { + final JByteArray array = value.as(JByteArray.type); + return Uint8List.fromList(array.getRange(0, array.length).buffer.asUint8List()); + } else if (value.isA(JIntArray.type)) { + final JIntArray array = value.as(JIntArray.type); + return Int32List.fromList(array.getRange(0, array.length)); + } else if (value.isA(JLongArray.type)) { + final JLongArray array = value.as(JLongArray.type); + return Int64List.fromList(array.getRange(0, array.length)); + } else if (value.isA(JDoubleArray.type)) { + final JDoubleArray array = value.as(JDoubleArray.type); + return Float64List.fromList(array.getRange(0, array.length)); + } else if (value.isA>(JList.type as JType>)) { + final List list = value.as(JList.type).asDart(); + final res = []; + // Cache the length before iterating to avoid a JNI hop per iteration. + final int len = list.length; + for (int i = 0; i < len; i++) { + res.add(readValue(list[i])); + } + return res; + } else if (value.isA>(JMap.type as JType>)) { + final Map map = value.as(JMap.type).asDart(); + final res = {}; + for (final MapEntry entry in map.entries) { + res[readValue(entry.key)] = readValue(entry.value); + } + return res; + } else { + throw ArgumentError.value(value); + } + } + + static T writeValue(Object? value) { + if (value == null) { + return null as T; + } + if (value is bool) { + return JBoolean(value) as T; + } else if (value is double) { + return JDouble(value) as T; + // ignore: avoid_double_and_int_checks + } else if (value is int) { + return JLong(value) as T; + } else if (value is String) { + return value.toJString() as T; + } else if (value is Uint8List) { + final JByteArray array = JByteArray(value.length); + array.setRange( + 0, + value.length, + Int8List.view(value.buffer, value.offsetInBytes, value.length), + ); + return array as T; + } else if (value is Int32List) { + final JIntArray array = JIntArray(value.length); + array.setRange(0, value.length, value); + return array as T; + } else if (value is Int64List) { + final JLongArray array = JLongArray(value.length); + array.setRange(0, value.length, value); + return array as T; + } else if (value is Float64List) { + final JDoubleArray array = JDoubleArray(value.length); + array.setRange(0, value.length, value); + return array as T; + } else if (value is List) { + return value.map((e) => writeValue(e)).toJList() as T; + } else if (value is List) { + return value.map((e) => writeValue(e)).toJList() as T; + } else if (value is Map) { + return value + .map( + (k, v) => MapEntry(writeValue(k), writeValue(v)), + ) + .toJMap() + as T; + } else if (value is Map) { + return value + .map( + (k, v) => MapEntry(writeValue(k), writeValue(v)), + ) + .toJMap() + as T; + } else if (value is Map) { + return value + .map( + (k, v) => MapEntry(writeValue(k), writeValue(v)), + ) + .toJMap() + as T; + } else { + throw ArgumentError.value(value); + } + } +} + +class _PigeonFfiCodec { + static Object? readValue(ObjCObject? value, [Type? type, Type? type2]) { + if (value == null || ffi_bridge.NativeInteropExamplePigeonInternalNull.isA(value)) { + return null; + } else if (NSNumber.isA(value)) { + final NSNumber numValue = NSNumber.as(value); + if (type == double) { + return numValue.doubleValue; + } else if (type == bool) { + return numValue.boolValue; + } + + return numValue.longValue; + } else if (NSString.isA(value)) { + return NSString.as(value).toDartString(); + } else if (ffi_bridge.NativeInteropExamplePigeonTypedData.isA(value)) { + return _getValueFromPigeonTypedData(value as ffi_bridge.NativeInteropExamplePigeonTypedData); + } else if (NSArray.isA(value)) { + final NSArray array = NSArray.as(value); + final List res = []; + for (int i = 0; i < array.count; i++) { + res.add(readValue(array.objectAtIndex(i), type)); + } + return res; + } else if (NSDictionary.isA(value)) { + final NSDictionary dict = NSDictionary.as(value); + final NSArray keys = dict.allKeys; + final Map res = {}; + for (int i = 0; i < keys.count; i++) { + final ObjCObject key = keys.objectAtIndex(i); + res[readValue(key, type, type2)] = readValue(dict.objectForKey(key), type, type2); + } + return res; + } else if (ffi_bridge.NativeInteropExampleNumberWrapper.isA(value)) { + return _convertNumberWrapperToDart(ffi_bridge.NativeInteropExampleNumberWrapper.as(value)); + } else { + throw ArgumentError.value(value); + } + } + + static T writeValue(Object? value, {bool generic = false}) { + if (value == null) { + if (_isTypeOrNullableType(ObjCObject) || _isTypeOrNullableType(NSObject)) { + return ffi_bridge.NativeInteropExamplePigeonInternalNull() as T; + } + return null as T; + } + if (value is bool) { + return (generic + ? _convertToFfiNumberWrapper(value) + : NSNumber.alloc().initWithLong(value ? 1 : 0)) + as T; + } else if (value is double) { + return (generic ? _convertToFfiNumberWrapper(value) : NSNumber.alloc().initWithDouble(value)) + as T; + // ignore: avoid_double_and_int_checks + } else if (value is int) { + return (generic ? _convertToFfiNumberWrapper(value) : NSNumber.alloc().initWithLong(value)) + as T; + } else if (value is Enum) { + return (generic + ? _convertToFfiNumberWrapper(value) + : NSNumber.alloc().initWithLong(value.index)) + as T; + } else if (value is String) { + return NSString(value) as T; + } else if (value is TypedData) { + return _toPigeonTypedData(value) as T; + } else if (value is List) { + final NSMutableArray res = NSMutableArray(); + for (final Object? entry in value) { + res.addObject( + entry == null + ? ffi_bridge.NativeInteropExamplePigeonInternalNull() + : writeValue(entry, generic: true), + ); + } + return res as T; + } else if (value is Map) { + final NSMutableDictionary res = NSMutableDictionary(); + for (final MapEntry entry in value.entries) { + res.setObject( + writeValue(entry.value, generic: true), + forKey: NSCopying.as(writeValue(entry.key, generic: true)), + ); + } + return res as T; + } else { + throw ArgumentError.value(value); + } + } +} + +ffi_bridge.NativeInteropExamplePigeonTypedData _toPigeonTypedData(TypedData value) { + final int lengthInBytes = value.lengthInBytes; + if (value is Uint8List) { + final int length = value.length; + final Pointer ptr = calloc(length); + ptr.asTypedList(length).setAll(0, value); + final NSData nsData = NSData.dataWithBytes(ptr.cast(), length: lengthInBytes); + calloc.free(ptr); + return ffi_bridge.NativeInteropExamplePigeonTypedData.alloc().initWithData(nsData, type: 0); + } else if (value is Int32List) { + final int length = value.length; + final Pointer ptr = calloc(length); + ptr.asTypedList(length).setAll(0, value); + final NSData nsData = NSData.dataWithBytes(ptr.cast(), length: lengthInBytes); + calloc.free(ptr); + return ffi_bridge.NativeInteropExamplePigeonTypedData.alloc().initWithData(nsData, type: 1); + } else if (value is Int64List) { + final int length = value.length; + final Pointer ptr = calloc(length); + ptr.asTypedList(length).setAll(0, value); + final NSData nsData = NSData.dataWithBytes(ptr.cast(), length: lengthInBytes); + calloc.free(ptr); + return ffi_bridge.NativeInteropExamplePigeonTypedData.alloc().initWithData(nsData, type: 2); + } else if (value is Float32List) { + final int length = value.length; + final Pointer ptr = calloc(length); + ptr.asTypedList(length).setAll(0, value); + final NSData nsData = NSData.dataWithBytes(ptr.cast(), length: lengthInBytes); + calloc.free(ptr); + return ffi_bridge.NativeInteropExamplePigeonTypedData.alloc().initWithData(nsData, type: 3); + } else if (value is Float64List) { + final int length = value.length; + final Pointer ptr = calloc(length); + ptr.asTypedList(length).setAll(0, value); + final NSData nsData = NSData.dataWithBytes(ptr.cast(), length: lengthInBytes); + calloc.free(ptr); + return ffi_bridge.NativeInteropExamplePigeonTypedData.alloc().initWithData(nsData, type: 4); + } + throw ArgumentError.value(value); +} + +Object? _getValueFromPigeonTypedData(ffi_bridge.NativeInteropExamplePigeonTypedData value) { + final NSData data = value.data; + final ObjCObjectRef dataRef = data.object$.ref; + try { + final int lengthInBytes = data.length; + if (lengthInBytes == 0) { + return switch (value.type) { + 0 => Uint8List(0), + 1 => Int32List(0), + 2 => Int64List(0), + 3 => Float32List(0), + 4 => Float64List(0), + _ => throw ArgumentError.value(value), + }; + } + final Pointer bytes = data.bytes; + return switch (value.type) { + 0 => Uint8List.fromList(bytes.cast().asTypedList(lengthInBytes)), + 1 => Int32List.fromList(bytes.cast().asTypedList(lengthInBytes ~/ 4)), + 2 => Int64List.fromList(bytes.cast().asTypedList(lengthInBytes ~/ 8)), + 3 => Float32List.fromList(bytes.cast().asTypedList(lengthInBytes ~/ 4)), + 4 => Float64List.fromList(bytes.cast().asTypedList(lengthInBytes ~/ 8)), + _ => throw ArgumentError.value(value), + }; + } finally { + dataRef.release(); + } +} + +Object? _convertNumberWrapperToDart(ffi_bridge.NativeInteropExampleNumberWrapper value) { + switch (value.type) { + case 1: + return value.number.longValue; + case 2: + return value.number.doubleValue; + case 3: + return value.number.boolValue; + default: + throw ArgumentError.value(value); + } +} + +ffi_bridge.NativeInteropExampleNumberWrapper _convertToFfiNumberWrapper(Object value) { + switch (value) { + case int _: + return ffi_bridge.NativeInteropExampleNumberWrapper.alloc().initWithNumber( + NSNumber.alloc().initWithLong(value), + type: 1, + ); + case double _: + return ffi_bridge.NativeInteropExampleNumberWrapper.alloc().initWithNumber( + NSNumber.alloc().initWithDouble(value), + type: 2, + ); + case bool _: + return ffi_bridge.NativeInteropExampleNumberWrapper.alloc().initWithNumber( + NSNumber.alloc().initWithLong(value ? 1 : 0), + type: 3, + ); + default: + throw ArgumentError.value(value); + } +} + +bool _isType(Type t) => T == t; +bool _isTypeOrNullableType(Type t) => _isType(t) || _isType(t); + +void _throwNoInstanceError(String channelName) { + String nameString = 'named $channelName'; + if (channelName == defaultInstanceName) { + nameString = 'with no name'; + } + final String error = 'No instance $nameString has been registered.'; + throw ArgumentError(error); +} + +void _throwIfFfiError(ffi_bridge.PigeonError error) { + if (error.code != null) { + throw _wrapFfiError(error); + } +} + +PlatformException _wrapFfiError(ffi_bridge.PigeonError error) => PlatformException( + code: error.code!.toDartString(), + message: error.message?.toDartString(), + details: NSString.isA(error.details) ? error.details!.toDartString() : error.details, +); + +void _reportFfiError(ffi_bridge.PigeonError errorOut, Object e) { + if (e is PlatformException) { + errorOut.code = NSString(e.code); + errorOut.message = NSString(e.message ?? ''); + errorOut.details = NSString((e.details ?? '').toString()); + } else { + errorOut.code = NSString('error'); + errorOut.message = NSString(e.toString()); + errorOut.details = null; + } +} + +PlatformException _wrapJniException(JThrowable e) { + if (e.isA(jni_bridge.FlutterError.type)) { + final jni_bridge.FlutterError pigeonError = e.as(jni_bridge.FlutterError.type); + return PlatformException( + code: pigeonError.code.toDartString(), + message: pigeonError.message?.toDartString(), + details: pigeonError.details?.isA(JString.type) ?? false + ? pigeonError.details!.as(JString.type).toDartString() + : pigeonError.details, + stacktrace: e.javaStackTrace, + ); + } + return PlatformException( + code: 'PlatformException', + message: e.message, + details: e, + stacktrace: e.javaStackTrace, + ); +} + +NativeInteropExampleApiForNativeInterop? pigeon_getInstance_NativeInteropExampleApi({ + String channelName = defaultInstanceName, +}) => _NativeInteropExampleApiForNativeInterop.getInstance(channelName: channelName); + +class _NativeInteropExampleApiForNativeInterop implements NativeInteropExampleApiForNativeInterop { + _NativeInteropExampleApiForNativeInterop._withRegistrar({ + jni_bridge.NativeInteropExampleApiRegistrar? jniApi, + ffi_bridge.NativeInteropExampleApiSetup? ffiApi, + }) : _jniApi = jniApi, + _ffiApi = ffiApi; + + /// Returns instance of NativeInteropExampleApiForNativeInterop with specified [channelName] if one has been registered. + static NativeInteropExampleApiForNativeInterop? getInstance({ + String channelName = defaultInstanceName, + }) { + final NativeInteropExampleApiForNativeInterop res; + if (Platform.isAndroid) { + final jni_bridge.NativeInteropExampleApiRegistrar? link = + jni_bridge.NativeInteropExampleApiRegistrar().getInstance(channelName.toJString()); + if (link == null) { + _throwNoInstanceError(channelName); + } + res = _NativeInteropExampleApiForNativeInterop._withRegistrar(jniApi: link); + } else if (Platform.isIOS || Platform.isMacOS) { + final ffi_bridge.NativeInteropExampleApiSetup? link = + ffi_bridge.NativeInteropExampleApiSetup.getInstanceWithName(NSString(channelName)); + if (link == null) { + _throwNoInstanceError(channelName); + } + res = _NativeInteropExampleApiForNativeInterop._withRegistrar(ffiApi: link); + } else { + throw UnsupportedError( + 'Native Interop is not supported on this platform. Use NativeInteropExampleApi instead.', + ); + } + return res; + } + + late final jni_bridge.NativeInteropExampleApiRegistrar? _jniApi; + late final ffi_bridge.NativeInteropExampleApiSetup? _ffiApi; + + @override + void doSomething() { + try { + if (_jniApi != null) { + return _jniApi.doSomething(); + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.PigeonError(); + _ffiApi.doSomethingWithWrappedError(pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + return; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } +} diff --git a/packages/pigeon/lib/src/dart/dart_generator.dart b/packages/pigeon/lib/src/dart/dart_generator.dart index c286d044944a..5f01620690e1 100644 --- a/packages/pigeon/lib/src/dart/dart_generator.dart +++ b/packages/pigeon/lib/src/dart/dart_generator.dart @@ -239,11 +239,6 @@ class _FfiType extends _NativeInteropType<_FfiType> { return _NativeInteropType.fromClass<_FfiType>(classDefinition, _FfiType.new); } - /// Constructs an [_FfiType] representing a user-defined Pigeon [enumDefinition]. - static _FfiType fromEnum(Enum enumDefinition) { - return _NativeInteropType.fromEnum<_FfiType>(enumDefinition, _FfiType.new); - } - /// Returns the corresponding Objective-C/FFI class or bridge type name. /// /// If [withPrefix] is true (default), types defined in the bridge module include the bridge namespace prefix (`$_ffiBridgePrefix.`). @@ -288,7 +283,7 @@ class _FfiType extends _NativeInteropType<_FfiType> { bool forceNullable = false, }) { if (type.isClass) { - return '${type.baseName}.fromFfi($varName)${getForceNonNullSymbol(!type.isNullable)}'; + return '${_nativeInteropExtensionName(type.baseName)}.fromFfi($varName)${getForceNonNullSymbol(!type.isNullable)}'; } if (type.isEnum && classField) { if (type.isNullable) { @@ -473,7 +468,7 @@ class _JniType extends _NativeInteropType<_JniType> { /// Generates a Dart code expression that converts a JNI object representation back to its corresponding Dart value. String getToDartCall(TypeDeclaration type, {String varName = '', bool forceConversion = false}) { if (type.isClass || type.isEnum) { - return '${type.baseName}.fromJni($varName)${getForceNonNullSymbol(!type.isNullable)}'; + return '${_nativeInteropExtensionName(type.baseName)}.fromJni($varName)${getForceNonNullSymbol(!type.isNullable)}'; } var asType = ' as ${getDartReturnType(true)}'; var castCall = ''; @@ -691,49 +686,79 @@ class DartGenerator extends StructuredGenerator { Root root, Indent indent, { required String dartPackageName, + }) { + indent.writeln("import 'dart:async';"); + if (root.containsProxyApi) { + indent.writeln("import 'dart:io' show Platform;"); + } + + final typedDataClasses = ['Float64List', 'Int32List', 'Int64List']; + indent.writeln("import 'dart:typed_data' show ${typedDataClasses.join(', ')};"); + indent.newln(); + if (usesNativeInterop(generatorOptions)) { + indent.writeln("import 'package:flutter/foundation.dart' show kIsWeb;"); + } + indent.writeln("import 'package:flutter/services.dart';"); + if (root.containsProxyApi) { + indent.writeln("import 'package:flutter/widgets.dart' show WidgetsFlutterBinding;"); + } + indent.writeln( + "import 'package:meta/meta.dart' show immutable, ${usesNativeInterop(generatorOptions) ? 'internal, ' : ''}protected, visibleForTesting;", + ); + if (usesNativeInterop(generatorOptions)) { + final String dartOut = generatorOptions.dartOut ?? '$dartPackageName.g.dart'; + final String baseName = path.basename(dartOut); + final String nativeInteropBaseName = path.basename(getNativeInteropDartPath(dartOut)); + indent.writeln( + "import './$baseName'\n" + " if (dart.library.ffi) './$nativeInteropBaseName'\n" + ' as pigeon_native;', + ); + } + } + + void _writeNativeInteropFileImports( + InternalDartOptions generatorOptions, + Indent indent, { + required String dartPackageName, }) { indent.writeln("import 'dart:async';"); if (generatorOptions.useFfi) { indent.writeln("import 'dart:ffi';"); } - if (usesNativeInterop(generatorOptions) || root.containsProxyApi) { - indent.writeln("import 'dart:io' show Platform;"); - } + indent.writeln("import 'dart:io' show Platform;"); final typedDataClasses = [ - if (usesNativeInterop(generatorOptions)) 'Float32List', + 'Float32List', 'Float64List', 'Int32List', 'Int64List', if (generatorOptions.useJni) 'Int8List', - if (usesNativeInterop(generatorOptions)) 'TypedData', + 'TypedData', ]; indent.writeln("import 'dart:typed_data' show ${typedDataClasses.join(', ')};"); indent.newln(); if (generatorOptions.useFfi) { indent.writeln("import 'package:ffi/ffi.dart';"); } - indent.writeln("import 'package:flutter/services.dart';"); - if (root.containsProxyApi) { - indent.writeln("import 'package:flutter/widgets.dart' show WidgetsFlutterBinding;"); - } if (generatorOptions.useJni) { indent.writeln("import 'package:jni/jni.dart';"); } - indent.writeln("import 'package:meta/meta.dart' show immutable, protected, visibleForTesting;"); if (generatorOptions.useFfi) { indent.writeln("import 'package:objective_c/objective_c.dart';"); - - final String ffiFileImportName = path.basename(generatorOptions.dartOut!); + } + final String dartOut = generatorOptions.dartOut ?? '$dartPackageName.g.dart'; + final String baseName = path.basename(dartOut); + indent.writeln("import './$baseName';"); + if (generatorOptions.useFfi) { indent.writeln( - "import './${path.withoutExtension(ffiFileImportName)}.ffi.dart' as $_ffiBridgePrefix;", + "import './${path.withoutExtension(baseName)}.ffi.dart' as $_ffiBridgePrefix;", ); } if (generatorOptions.useJni) { - final String jniFileImportName = path.basename(generatorOptions.dartOut!); indent.writeln( - "import './${path.withoutExtension(jniFileImportName)}.jni.dart' as $_jniBridgePrefix;", + "import './${path.withoutExtension(baseName)}.jni.dart' as $_jniBridgePrefix;", ); } } @@ -813,43 +838,47 @@ class DartGenerator extends StructuredGenerator { addDocumentationComments(indent, member.documentationComments, docCommentSpec); indent.writeln('${member.name}$separatorSymbol'); } + }); + } - if (generatorOptions.useJni) { - final _JniType jniType = _JniType.fromEnum(anEnum); - indent.newln(); - indent.writeScoped('${jniType.jniName} toJni() {', '}', () { - indent.writeln('return ${jniType.jniName}.Companion.ofRaw(index)!;'); - }); - - indent.newln(); - indent.writeScoped( - 'static ${anEnum.name}? fromJni(${jniType.jniName}? jniEnum) {', - '}', - () { - indent.writeln('return jniEnum == null ? null : ${anEnum.name}.values[jniEnum.raw];'); - }, - ); - } - if (generatorOptions.useFfi) { - final _FfiType ffiType = _FfiType.fromEnum(anEnum); - indent.newln(); - indent.writeScoped('${ffiType.getFfiName()} toFfi() {', '}', () { - indent.writeln('return _PigeonFfiCodec.writeValue(index);'); - }); - - indent.newln(); - indent.writeScoped('NSNumber toNSNumber() {', '}', () { - indent.writeln('return NSNumber.alloc().initWithLong(index);'); - }); + void _writeNativeInteropEnum(InternalDartOptions generatorOptions, Indent indent, Enum anEnum) { + indent.newln(); + indent.writeScoped( + 'extension ${_nativeInteropExtensionName(anEnum.name)} on ${anEnum.name} {', + '}', + () { + if (generatorOptions.useJni) { + final _JniType jniType = _JniType.fromEnum(anEnum); + indent.writeScoped('${jniType.jniName} toJni() {', '}', () { + indent.writeln('return ${jniType.jniName}.Companion.ofRaw(index)!;'); + }); - indent.newln(); - indent.writeScoped('static ${anEnum.name}? fromNSNumber(NSNumber? ffiEnum) {', '}', () { - indent.writeln( - 'return ffiEnum == null ? null : ${anEnum.name}.values[ffiEnum.intValue];', + indent.newln(); + indent.writeScoped( + 'static ${anEnum.name}? fromJni(${jniType.jniName}? jniEnum) {', + '}', + () { + indent.writeln('return jniEnum == null ? null : ${anEnum.name}.values[jniEnum.raw];'); + }, ); - }); - } - }); + } + if (generatorOptions.useFfi) { + if (generatorOptions.useJni) { + indent.newln(); + } + indent.writeScoped('NSNumber toNSNumber() {', '}', () { + indent.writeln('return NSNumber.alloc().initWithLong(index);'); + }); + + indent.newln(); + indent.writeScoped('static ${anEnum.name}? fromNSNumber(NSNumber? ffiEnum) {', '}', () { + indent.writeln( + 'return ffiEnum == null ? null : ${anEnum.name}.values[ffiEnum.intValue];', + ); + }); + } + }, + ); } @override @@ -870,7 +899,6 @@ class DartGenerator extends StructuredGenerator { indent.write('${sealed}class ${classDefinition.name} $implements'); indent.addScoped('{', '}', () { if (classDefinition.isSealed) { - _writeSealedClassNativeInteropConversions(generatorOptions, indent, classDefinition); return; } _writeConstructor(indent, classDefinition); @@ -912,6 +940,37 @@ class DartGenerator extends StructuredGenerator { }); } + void _writeNativeInteropDataClass( + InternalDartOptions generatorOptions, + Indent indent, + Class classDefinition, + ) { + indent.newln(); + indent.writeScoped( + 'extension ${_nativeInteropExtensionName(classDefinition.name)} on ${classDefinition.name} {', + '}', + () { + if (classDefinition.isSealed) { + _writeSealedClassNativeInteropConversions(generatorOptions, indent, classDefinition); + return; + } + if (generatorOptions.useJni) { + _writeToJni(indent, classDefinition); + indent.newln(); + _writeFromJni(indent, classDefinition); + } + if (generatorOptions.useFfi) { + if (generatorOptions.useJni) { + indent.newln(); + } + _writeToFfi(indent, classDefinition); + indent.newln(); + _writeFromFfi(indent, classDefinition); + } + }, + ); + } + void _writeConstructor(Indent indent, Class classDefinition) { indent.write(classDefinition.name); if (classDefinition.fields.isEmpty) { @@ -935,14 +994,6 @@ class DartGenerator extends StructuredGenerator { Class classDefinition, { required String dartPackageName, }) { - if (generatorOptions.useJni) { - _writeToJni(indent, classDefinition); - indent.newln(); - } - if (generatorOptions.useFfi) { - _writeToFfi(indent, classDefinition); - indent.newln(); - } indent.write('Object encode() '); indent.addScoped('{', '}', () { indent.write('return _toList();'); @@ -971,7 +1022,13 @@ class DartGenerator extends StructuredGenerator { ) { if (generatorOptions.useJni) { final String jniName = _JniType.fromClass(classDefinition).jniName; - indent.writeln('$jniName toJni();'); + indent.writeScoped('$jniName toJni() {', '}', () { + indent.writeScoped('return switch (this) {', '};', () { + for (final Class child in classDefinition.children) { + indent.writeln('final ${child.name} child => child.toJni(),'); + } + }); + }); indent.newln(); indent.writeScoped('static ${classDefinition.name}? fromJni($jniName? jniClass) {', '}', () { indent.writeScoped('if (jniClass == null) {', '}', () { @@ -980,7 +1037,9 @@ class DartGenerator extends StructuredGenerator { for (final Class child in classDefinition.children) { final String childJniName = _JniType.fromClass(child).jniName; indent.writeScoped('if (jniClass.isA<$childJniName>($childJniName.type)) {', '}', () { - indent.writeln('return ${child.name}.fromJni(jniClass.as($childJniName.type));'); + indent.writeln( + 'return ${_nativeInteropExtensionName(child.name)}.fromJni(jniClass.as($childJniName.type));', + ); }); } indent.writeln('throw ArgumentError.value(jniClass);'); @@ -991,7 +1050,13 @@ class DartGenerator extends StructuredGenerator { indent.newln(); } final String ffiName = _FfiType.fromClass(classDefinition).getFfiName(); - indent.writeln('$ffiName toFfi();'); + indent.writeScoped('$ffiName toFfi() {', '}', () { + indent.writeScoped('return switch (this) {', '};', () { + for (final Class child in classDefinition.children) { + indent.writeln('final ${child.name} child => child.toFfi(),'); + } + }); + }); indent.newln(); indent.writeScoped('static ${classDefinition.name}? fromFfi($ffiName? ffiClass) {', '}', () { indent.writeScoped('if (ffiClass == null) {', '}', () { @@ -1000,7 +1065,9 @@ class DartGenerator extends StructuredGenerator { for (final Class child in classDefinition.children) { final String childFfiName = _FfiType.fromClass(child).getFfiName(); indent.writeScoped('if ($childFfiName.isA(ffiClass)) {', '}', () { - indent.writeln('return ${child.name}.fromFfi($childFfiName.as(ffiClass));'); + indent.writeln( + 'return ${_nativeInteropExtensionName(child.name)}.fromFfi($childFfiName.as(ffiClass));', + ); }); } indent.writeln('throw ArgumentError.value(ffiClass);'); @@ -1009,9 +1076,6 @@ class DartGenerator extends StructuredGenerator { } void _writeToJni(Indent indent, Class classDefinition) { - if (classDefinition.superClass != null) { - indent.writeln('@override'); - } indent.writeScoped('$_jniBridgePrefix.${classDefinition.name} toJni() {', '}', () { indent.writeScoped('return $_jniBridgePrefix.${classDefinition.name} (', ');', () { for (final NamedType field in getFieldsInSerializationOrder(classDefinition)) { @@ -1024,9 +1088,6 @@ class DartGenerator extends StructuredGenerator { void _writeToFfi(Indent indent, Class classDefinition) { final _FfiType ffiClass = _FfiType.fromClass(classDefinition); - if (classDefinition.superClass != null) { - indent.writeln('@override'); - } indent.writeScoped('${ffiClass.getFfiName()} toFfi() {', '}', () { final Iterable fields = getFieldsInSerializationOrder(classDefinition); if (fields.isEmpty) { @@ -1098,15 +1159,6 @@ class DartGenerator extends StructuredGenerator { Class classDefinition, { required String dartPackageName, }) { - if (generatorOptions.useJni) { - _writeFromJni(indent, classDefinition); - indent.newln(); - } - if (generatorOptions.useFfi) { - _writeFromFfi(indent, classDefinition); - indent.newln(); - } - indent.writeScoped('static ${classDefinition.name} decode(Object result) {', '}', () { indent.writeln('result as List;'); indent.write('return ${classDefinition.name}'); @@ -1291,17 +1343,12 @@ class DartGenerator extends StructuredGenerator { required String dartPackageName, }) { final mixin = generatorOptions.useJni ? ' with $_jniBridgePrefix.\$${api.name}' : ''; - indent.writeScoped('final class ${api.name}Registrar$mixin {', '}', () { - indent.writeln('${api.name}? dartApi;'); + indent.writeScoped('final class _${api.name}Registrar$mixin {', '}', () { + indent.writeln('_${api.name}Registrar(this.dartApi);'); indent.newln(); - indent.writeScoped('${api.name} register(', ') ', () { - indent.writeScoped('${api.name} api, {', '}', () { - indent.writeln('String name = defaultInstanceName,'); - }, nestCount: 0); - }, addTrailingNewline: false); - indent.addScoped('{', '}', () { - indent.writeln('dartApi = api;'); - indent.newln(); + indent.writeln('final ${api.name} dartApi;'); + indent.newln(); + indent.writeScoped('${api.name} register({String name = defaultInstanceName}) {', '}', () { if (generatorOptions.useJni) { indent.writeScoped('if (Platform.isAndroid) {', '}', () { indent.writeln( @@ -1328,63 +1375,21 @@ class DartGenerator extends StructuredGenerator { '});', () { indent.writeScoped('try {', '}', () { - indent.writeScoped('if (dartApi != null) {', '}', () { - final methodCall = - 'dartApi!.${method.name}(${indexMap(method.parameters, (int index, Parameter p) { - final _FfiType ffiType = _FfiType.fromTypeDeclaration(p.type); - return ffiType.getToDartCall(p.type, varName: _getSafeArgumentName(index, p), forceNullable: true); - }).join(', ')})'; - if (method.isAsynchronous) { - indent.writeScoped('$methodCall.then((response) {', '},', () { - if (method.returnType.isVoid) { - indent.writeln( - '$_ffiBridgePrefix.${_getFfiBlockCallExtensionName(method.returnType)}(completionHandler).call();', - ); - } else { - final _FfiType ffiReturnType = _FfiType.fromTypeDeclaration( - method.returnType, - ); - String toFfiCall; - if (!method.returnType.isNullable && - (isPrimitiveType(method.returnType) || method.returnType.isEnum)) { - toFfiCall = - '_PigeonFfiCodec.writeValue<${ffiReturnType.getFfiName()}>(response)'; - } else { - toFfiCall = ffiReturnType.getToFfiCall( - method.returnType, - 'response', - ffiReturnType, - ); - } - indent.writeln( - '$_ffiBridgePrefix.${_getFfiBlockCallExtensionName(method.returnType)}(completionHandler).call($toFfiCall);', - ); - } - }); - indent.writeScoped('onError: (Object e) {', '});', () { - indent.writeln('_reportFfiError(errorOut, e);'); - if (method.returnType.isVoid) { - indent.writeln( - '$_ffiBridgePrefix.${_getFfiBlockCallExtensionName(method.returnType)}(completionHandler).call();', - ); - } else { - indent.writeln( - '$_ffiBridgePrefix.${_getFfiBlockCallExtensionName(method.returnType)}(completionHandler).call(null);', - ); - } - }); - indent.writeln('return;'); - } else { + final methodCall = + 'dartApi.${method.name}(${indexMap(method.parameters, (int index, Parameter p) { + final _FfiType ffiType = _FfiType.fromTypeDeclaration(p.type); + return ffiType.getToDartCall(p.type, varName: _getSafeArgumentName(index, p), forceNullable: true); + }).join(', ')})'; + if (method.isAsynchronous) { + indent.writeScoped('$methodCall.then((response) {', '},', () { if (method.returnType.isVoid) { - indent.writeln('$methodCall;'); - indent.writeln('return;'); + indent.writeln( + '$_ffiBridgePrefix.${_getFfiBlockCallExtensionName(method.returnType)}(completionHandler).call();', + ); } else { final _FfiType ffiReturnType = _FfiType.fromTypeDeclaration( method.returnType, ); - indent.writeln( - 'final ${addGenericTypes(method.returnType)} response = $methodCall;', - ); String toFfiCall; if (!method.returnType.isNullable && (isPrimitiveType(method.returnType) || method.returnType.isEnum)) { @@ -1397,23 +1402,50 @@ class DartGenerator extends StructuredGenerator { ffiReturnType, ); } - indent.writeln('return $toFfiCall;'); + indent.writeln( + '$_ffiBridgePrefix.${_getFfiBlockCallExtensionName(method.returnType)}(completionHandler).call($toFfiCall);', + ); } - } - }, addTrailingNewline: false); - indent.addScoped(' else {', '}', () { - indent.writeln( - "_reportFfiError(errorOut, 'ArgumentError: ${api.name} was not registered.');", - ); - if (method.isAsynchronous) { + }); + indent.writeScoped('onError: (Object e) {', '});', () { + indent.writeln('_reportFfiError(errorOut, e);'); + if (method.returnType.isVoid) { + indent.writeln( + '$_ffiBridgePrefix.${_getFfiBlockCallExtensionName(method.returnType)}(completionHandler).call();', + ); + } else { + indent.writeln( + '$_ffiBridgePrefix.${_getFfiBlockCallExtensionName(method.returnType)}(completionHandler).call(null);', + ); + } + }); + indent.writeln('return;'); + } else { + if (method.returnType.isVoid) { + indent.writeln('$methodCall;'); + indent.writeln('return;'); + } else { + final _FfiType ffiReturnType = _FfiType.fromTypeDeclaration( + method.returnType, + ); indent.writeln( - '$_ffiBridgePrefix.${_getFfiBlockCallExtensionName(method.returnType)}(completionHandler).call(${method.returnType.isVoid ? '' : 'null'});', + 'final ${addGenericTypes(method.returnType)} response = $methodCall;', ); + String toFfiCall; + if (!method.returnType.isNullable && + (isPrimitiveType(method.returnType) || method.returnType.isEnum)) { + toFfiCall = + '_PigeonFfiCodec.writeValue<${ffiReturnType.getFfiName()}>(response)'; + } else { + toFfiCall = ffiReturnType.getToFfiCall( + method.returnType, + 'response', + ffiReturnType, + ); + } + indent.writeln('return $toFfiCall;'); } - indent.writeln( - 'return${(method.isAsynchronous || method.returnType.isVoid) ? '' : ' null'};', - ); - }); + } }, addTrailingNewline: false); indent.addScoped(' catch (e) {', '}', () { indent.writeln('_reportFfiError(errorOut, e);'); @@ -1441,7 +1473,7 @@ class DartGenerator extends StructuredGenerator { indent.writeln(');'); }); } - indent.writeln('return api;'); + indent.writeln('return dartApi;'); }); if (generatorOptions.useJni) { @@ -1464,53 +1496,53 @@ class DartGenerator extends StructuredGenerator { ); final String jniMethodName = jniNamer.nextApiMethod(method).name; indent.writeScoped('$returnType $jniMethodName($params) {', '}', () { - indent.writeScoped('if (dartApi != null) {', '} ', () { - final methodCall = - 'dartApi!.${method.name}(${indexMap(method.parameters, (int index, Parameter p) { - final _JniType jniType = _JniType.fromTypeDeclaration(p.type); - return jniType.getToDartCall(p.type, varName: _getSafeArgumentName(index, p)); - }).join(', ')})'; - - if (method.isAsynchronous) { - indent.writeScoped('return $methodCall.then((response) {', '});', () { - if (method.returnType.isVoid) { - indent.writeln('return _PigeonJniCodec._kotlinUnit;'); + final methodCall = + 'dartApi.${method.name}(${indexMap(method.parameters, (int index, Parameter p) { + final _JniType jniType = _JniType.fromTypeDeclaration(p.type); + return jniType.getToDartCall(p.type, varName: _getSafeArgumentName(index, p)); + }).join(', ')})'; + + if (method.isAsynchronous) { + indent.writeScoped('return $methodCall.then((response) {', '});', () { + if (method.returnType.isVoid) { + indent.writeln('return _PigeonJniCodec._kotlinUnit;'); + } else { + String toJniCall; + if (!method.returnType.isNullable && isPrimitiveType(method.returnType)) { + toJniCall = '_PigeonJniCodec.writeValue<${jniReturnType.jniName}>(response)'; } else { - String toJniCall; - if (!method.returnType.isNullable && isPrimitiveType(method.returnType)) { - toJniCall = '_PigeonJniCodec.writeValue<${jniReturnType.jniName}>(response)'; - } else { - toJniCall = jniReturnType.getToJniCall( - method.returnType, - 'response', - jniReturnType, - ); - } - indent.writeln('return $toJniCall;'); + toJniCall = jniReturnType.getToJniCall( + method.returnType, + 'response', + jniReturnType, + ); } - }); - } else if (method.returnType.isVoid) { - indent.writeln('$methodCall;'); - indent.writeln('return;'); - } else { - indent.writeln( - 'final ${addGenericTypes(method.returnType)} response = $methodCall;', - ); - final String toJniCall = jniReturnType.getToJniCall( - method.returnType, - 'response', - jniReturnType, - ); - indent.writeln('return $toJniCall;'); - } - }); - indent.writeScoped('else {', '}', () { - indent.writeln("throw ArgumentError('${api.name} was not registered.');"); - }); + indent.writeln('return $toJniCall;'); + } + }); + } else if (method.returnType.isVoid) { + indent.writeln('$methodCall;'); + indent.writeln('return;'); + } else { + indent.writeln('final ${addGenericTypes(method.returnType)} response = $methodCall;'); + final String toJniCall = jniReturnType.getToJniCall( + method.returnType, + 'response', + jniReturnType, + ); + indent.writeln('return $toJniCall;'); + } }); } } }); + indent.newln(); + indent.format(''' +${api.name} ${classMemberNamePrefix}register_${api.name}( + ${api.name} api, { + String name = defaultInstanceName, +}) => _${api.name}Registrar(api).register(name: name); +'''); } /// Writes the code for host [Api], [api]. @@ -1535,16 +1567,28 @@ class DartGenerator extends StructuredGenerator { required String dartPackageName, }) { indent.newln(); - addDocumentationComments(indent, api.documentationComments, docCommentSpec); if (usesNativeInterop(generatorOptions)) { - _writeNativeInteropFlutterApi( - generatorOptions, - root, - indent, - api, - dartPackageName: dartPackageName, - ); + indent.format(''' +@internal +${api.name} ${classMemberNamePrefix}register_${api.name}( + ${api.name} api, { + String name = defaultInstanceName, +}) { + throw UnsupportedError( + 'Native Interop is not supported on this platform. Use ${api.name}.setUp instead.', + ); +} + +final class ${api.name}Registrar { + ${api.name} register( + ${api.name} api, { + String name = defaultInstanceName, + }) => pigeon_native.${classMemberNamePrefix}register_${api.name}(api, name: name); +} +'''); + indent.newln(); } + addDocumentationComments(indent, api.documentationComments, docCommentSpec); indent.write('abstract class ${api.name} '); indent.addScoped('{', '}', () { @@ -1575,18 +1619,9 @@ class DartGenerator extends StructuredGenerator { }) '''); indent.addScoped('{', '}', () { - if (generatorOptions.useJni) { - indent.format(''' - if (Platform.isAndroid && api != null) { - ${api.name}Registrar().register(api, name: messageChannelSuffix.isEmpty - ? defaultInstanceName - : messageChannelSuffix); - } - '''); - } - if (generatorOptions.useFfi) { + if (usesNativeInterop(generatorOptions)) { indent.format(''' - if ((Platform.isIOS || Platform.isMacOS) && api != null) { + if (!kIsWeb && api != null) { ${api.name}Registrar().register(api, name: messageChannelSuffix.isEmpty ? defaultInstanceName : messageChannelSuffix); @@ -1645,10 +1680,17 @@ class DartGenerator extends StructuredGenerator { required String dartPackageName, }) { final dartApiName = '${api.name}ForNativeInterop'; + final implClassName = '_$dartApiName'; final jniApiRegistrarName = '$_jniBridgePrefix.${api.name}Registrar'; final ffiApiRegistrarName = '$_ffiBridgePrefix.${api.name}Setup'; indent.newln(); - indent.writeScoped('class $dartApiName {', '}', () { + indent.format(''' +$dartApiName? ${classMemberNamePrefix}getInstance_${api.name}({ + String channelName = defaultInstanceName, +}) => $implClassName.getInstance(channelName: channelName); +'''); + indent.newln(); + indent.writeScoped('class $implClassName implements $dartApiName {', '}', () { final List constructorParams = []; final List constructorInitializers = []; final List fields = []; @@ -1670,7 +1712,7 @@ class DartGenerator extends StructuredGenerator { ? '' : ' : ${constructorInitializers.join(', ')}'; indent.writeln( - '$dartApiName._withRegistrar($constructorSignature)$constructorInitializerList;', + '$implClassName._withRegistrar($constructorSignature)$constructorInitializerList;', ); indent.newln(); @@ -1691,7 +1733,7 @@ class DartGenerator extends StructuredGenerator { indent.writeScoped('if (link == null) {', '}', () { indent.writeln('_throwNoInstanceError(channelName);'); }); - indent.writeln('res = $dartApiName._withRegistrar(jniApi: link);'); + indent.writeln('res = $implClassName._withRegistrar(jniApi: link);'); }, addTrailingNewline: false); isFirst = false; } @@ -1705,7 +1747,7 @@ class DartGenerator extends StructuredGenerator { indent.writeScoped('if (link == null) {', '}', () { indent.writeln('_throwNoInstanceError(channelName);'); }); - indent.writeln('res = $dartApiName._withRegistrar(ffiApi: link);'); + indent.writeln('res = $implClassName._withRegistrar(ffiApi: link);'); }, addTrailingNewline: false); isFirst = false; } @@ -1736,6 +1778,7 @@ class DartGenerator extends StructuredGenerator { ); for (final Method method in api.methods) { final _JniMember jniMember = jniNamer.nextApiMethod(method); + indent.writeln('@override'); indent.writeScoped( '${method.isAsynchronous ? 'Future<' : ''}${addGenericTypes(method.returnType)}${method.isAsynchronous ? '>' : ''} ${method.name}(${_getMethodParameterSignature(method.parameters)}) ${method.isAsynchronous ? 'async ' : ''}{', '}', @@ -1984,6 +2027,35 @@ return ${generatorOptions.useJni ? 'await ' : ''}$completerVar.future; .join(', '); } + void _writeHostApiNativeInteropInterface(Indent indent, AstHostApi api) { + final dartApiName = '${api.name}ForNativeInterop'; + indent.newln(); + indent.format(''' +@internal +$dartApiName? ${classMemberNamePrefix}getInstance_${api.name}({ + String channelName = defaultInstanceName, +}) { + throw UnsupportedError( + 'Native Interop is not supported on this platform. Use ${api.name} instead.', + ); +} + +abstract class $dartApiName { + /// Returns instance of $dartApiName with specified [channelName] if one has been registered. + static $dartApiName? getInstance({String channelName = defaultInstanceName}) => + pigeon_native.${classMemberNamePrefix}getInstance_${api.name}(channelName: channelName); +'''); + indent.inc(); + for (final Method method in api.methods) { + indent.newln(); + indent.writeln( + '${method.isAsynchronous ? 'Future<' : ''}${addGenericTypes(method.returnType)}${method.isAsynchronous ? '>' : ''} ${method.name}(${_getMethodParameterSignature(method.parameters)});', + ); + } + indent.dec(); + indent.writeln('}'); + } + /// Writes the code for host [Api], [api]. /// Example: /// ```dart @@ -2012,13 +2084,7 @@ return ${generatorOptions.useJni ? 'await ' : ''}$completerVar.future; required String dartPackageName, }) { if (usesNativeInterop(generatorOptions)) { - _writeNativeInteropHostApi( - generatorOptions, - root, - indent, - api, - dartPackageName: dartPackageName, - ); + _writeHostApiNativeInteropInterface(indent, api); } indent.newln(); addDocumentationComments(indent, api.documentationComments, docCommentSpec); @@ -2037,15 +2103,6 @@ ${api.name}({ '''); if (usesNativeInterop(generatorOptions)) { - final List platforms = []; - if (generatorOptions.useJni) { - platforms.add('Platform.isAndroid'); - } - if (generatorOptions.useFfi) { - platforms.add('Platform.isIOS'); - platforms.add('Platform.isMacOS'); - } - final String platformsCondition = platforms.join(' || '); indent.format(''' /// Creates an instance of [${api.name}] that requests an instance of /// [${api.name}ForNativeInterop] from the host platform with a matching instance name @@ -2058,7 +2115,7 @@ ${api.name}({ }) { ${api.name}ForNativeInterop? nativeInteropApi; String nativeInteropApiInstanceName = ''; - if ($platformsCondition) { + if (!kIsWeb) { if (messageChannelSuffix.isEmpty) { nativeInteropApi = ${api.name}ForNativeInterop.getInstance(); } else { @@ -2444,6 +2501,47 @@ ${api.name}({ indent.format(_formatter.format('${proxyApi.accept(emitter)}')); } + /// Generates Dart source code for the native interop companion file (`*.native_interop.g.dart`) + /// based on the given AST represented by [root], outputting the code to [sink]. + void generateNativeInterop( + InternalDartOptions generatorOptions, + Root root, + StringSink sink, { + required String dartPackageName, + }) { + final indent = Indent(); + writeFilePrologue(generatorOptions, root, indent, dartPackageName: dartPackageName); + _writeNativeInteropFileImports(generatorOptions, indent, dartPackageName: dartPackageName); + _writeNativeInteropGeneralUtilities(generatorOptions, root, indent); + for (final Enum anEnum in root.enums) { + _writeNativeInteropEnum(generatorOptions, indent, anEnum); + } + for (final Class classDefinition in root.classes) { + _writeNativeInteropDataClass(generatorOptions, indent, classDefinition); + } + for (final Api api in root.apis) { + if (api is AstHostApi) { + _writeNativeInteropHostApi( + generatorOptions, + root, + indent, + api, + dartPackageName: dartPackageName, + ); + } else if (api is AstFlutterApi) { + indent.newln(); + _writeNativeInteropFlutterApi( + generatorOptions, + root, + indent, + api, + dartPackageName: dartPackageName, + ); + } + } + sink.write(indent.toString()); + } + /// Generates Dart source code for test support libraries based on the given AST /// represented by [root], outputting the code to [sink]. [sourceOutPath] is the /// path of the generated Dart code to be tested. [testOutPath] is where the @@ -2552,20 +2650,26 @@ ${api.name}({ proxyApis: root.apis.whereType(), ); } - if (usesNativeInterop(generatorOptions)) { - if (generatorOptions.useJni) { - _writeJniCodec(indent, root); - } - if (generatorOptions.useFfi) { - _writeFfiCodec(indent, root); - _writeConvertNumberWrapper(indent, root); - } + } + + void _writeNativeInteropGeneralUtilities( + InternalDartOptions generatorOptions, + Root root, + Indent indent, + ) { + if (generatorOptions.useJni) { + _writeJniCodec(indent, root); + } + if (generatorOptions.useFfi) { + _writeFfiCodec(indent, root); + _writeConvertNumberWrapper(indent, root); + } - indent.writeln('bool _isType(Type t) => T == t;'); + indent.writeln('bool _isType(Type t) => T == t;'); - indent.writeln('bool _isTypeOrNullableType(Type t) => _isType(t) || _isType(t);'); - indent.newln(); - indent.format(r''' + indent.writeln('bool _isTypeOrNullableType(Type t) => _isType(t) || _isType(t);'); + indent.newln(); + indent.format(r''' void _throwNoInstanceError(String channelName) { String nameString = 'named $channelName'; if (channelName == defaultInstanceName) { @@ -2575,9 +2679,8 @@ ${api.name}({ throw ArgumentError(error); } '''); - _writeErrorHelpers(indent, generatorOptions); - indent.newln(); - } + _writeErrorHelpers(indent, generatorOptions); + indent.newln(); } void _writeJniCodec(Indent indent, Root root) { @@ -2645,7 +2748,7 @@ class _PigeonJniCodec { return ''' } else if (value.isA<${jniType.jniName}>( ${jniType.jniName}.type)) { - return ${jniType.type.baseName}.fromJni(value.as(${jniType.jniName}.type)); + return ${_nativeInteropExtensionName(jniType.type.baseName)}.fromJni(value.as(${jniType.jniName}.type)); '''; }).join()} ${root.enums.map((Enum enumDefinition) { @@ -2653,7 +2756,7 @@ class _PigeonJniCodec { return ''' } else if (value.isA<${jniType.jniName}>( ${jniType.jniName}.type)) { - return ${jniType.type.baseName}.fromJni(value.as(${jniType.jniName}.type)); + return ${_nativeInteropExtensionName(jniType.type.baseName)}.fromJni(value.as(${jniType.jniName}.type)); '''; }).join()} } else { @@ -2772,7 +2875,7 @@ class _PigeonJniCodec { for (final Enum anEnum in root.enums) { indent.format(''' case ${typeNum++}: - return ${anEnum.name}.fromNSNumber(value.number);'''); + return ${_nativeInteropExtensionName(anEnum.name)}.fromNSNumber(value.number);'''); } indent.dec(2); indent.format(''' @@ -2827,7 +2930,7 @@ class _PigeonFfiCodec { } ${root.enums.map((Enum enumDefinition) => ''' else if (type == ${enumDefinition.name}) { - return ${enumDefinition.name}.fromNSNumber(numValue); + return ${_nativeInteropExtensionName(enumDefinition.name)}.fromNSNumber(numValue); }''').join('\n')} return numValue.longValue; @@ -2857,7 +2960,7 @@ class _PigeonFfiCodec { final _FfiType ffiType = _FfiType.fromClass(dataClass); return ''' } else if (${ffiType.getFfiName()}.isA(value)) { - return ${ffiType.type.baseName}.fromFfi(${ffiType.getFfiName()}.as(value)); + return ${_nativeInteropExtensionName(ffiType.type.baseName)}.fromFfi(${ffiType.getFfiName()}.as(value)); '''; }).join()} } else { @@ -3947,3 +4050,20 @@ String? _getArgumentsForMethodCall(Iterable parameters) { bool usesNativeInterop(InternalDartOptions options) { return options.useFfi || options.useJni; } + +/// Returns the path of the generated native interop Dart file corresponding to +/// [dartOutPath]. +String getNativeInteropDartPath(String dartOutPath) { + if (dartOutPath.endsWith('.g.dart')) { + return '${dartOutPath.substring(0, dartOutPath.length - '.g.dart'.length)}.native_interop.g.dart'; + } + if (dartOutPath.endsWith('.gen.dart')) { + return '${dartOutPath.substring(0, dartOutPath.length - '.gen.dart'.length)}.native_interop.gen.dart'; + } + if (dartOutPath.endsWith('.dart')) { + return '${dartOutPath.substring(0, dartOutPath.length - '.dart'.length)}.native_interop.dart'; + } + return '$dartOutPath.native_interop.dart'; +} + +String _nativeInteropExtensionName(String typeName) => '_$classNamePrefix${typeName}NativeInterop'; diff --git a/packages/pigeon/lib/src/generator_tools.dart b/packages/pigeon/lib/src/generator_tools.dart index c6f7f2c5b85d..11aafa5d5316 100644 --- a/packages/pigeon/lib/src/generator_tools.dart +++ b/packages/pigeon/lib/src/generator_tools.dart @@ -16,7 +16,7 @@ import 'generator.dart'; /// The current version of pigeon. /// /// This must match the version in pubspec.yaml. -const String pigeonVersion = '29.0.12'; +const String pigeonVersion = '29.0.13'; /// Default plugin package name. const String defaultPluginPackageName = 'dev.flutter.pigeon'; diff --git a/packages/pigeon/lib/src/pigeon_lib_internal.dart b/packages/pigeon/lib/src/pigeon_lib_internal.dart index 2174a4106ccd..6e9bc4a891fb 100644 --- a/packages/pigeon/lib/src/pigeon_lib_internal.dart +++ b/packages/pigeon/lib/src/pigeon_lib_internal.dart @@ -521,6 +521,23 @@ class DartGeneratorAdapter implements GeneratorAdapter { const generator = DartGenerator(); generator.generate(options.dartOptions!, root, sink, dartPackageName: options.dartPackageName); + if (usesNativeInterop(options.dartOptions!) && + options.dartOptions!.dartOut != null && + options.dartOptions!.dartOut!.isNotEmpty && + options.dartOptions!.dartOut != 'stdout') { + final buffer = StringBuffer(); + generator.generateNativeInterop( + options.dartOptions!, + root, + buffer, + dartPackageName: options.dartPackageName, + ); + _writeToOutput( + getNativeInteropDartPath(options.dartOptions!.dartOut!), + buffer.toString(), + basePath: options.basePath ?? '', + ); + } } @override @@ -533,7 +550,17 @@ class DartGeneratorAdapter implements GeneratorAdapter { if (dartOptions == null || !usesNativeInterop(dartOptions)) { return []; } - return _errorOnNativeInteropReservedMethodNames(root, useJni: dartOptions.useJni); + final errors = []; + if (dartOptions.dartOut != null && + (dartOptions.dartOut!.isEmpty || dartOptions.dartOut == 'stdout')) { + errors.add( + Error( + message: 'Native interop requires a file path for dartOut (cannot be empty or "stdout").', + ), + ); + } + errors.addAll(_errorOnNativeInteropReservedMethodNames(root, useJni: dartOptions.useJni)); + return errors; } } diff --git a/packages/pigeon/native_interop_guide.md b/packages/pigeon/native_interop_guide.md index 8343fd9cd661..7ac88ae8f3d8 100644 --- a/packages/pigeon/native_interop_guide.md +++ b/packages/pigeon/native_interop_guide.md @@ -131,12 +131,12 @@ When Native Interop options (`useJni` or `useFfi`) are enabled, Pigeon automatic - **Android (JNI)**: When `kotlinOptions.useJni` is enabled: 1. Generates the JNI-compatible Kotlin bridge and the `_jnigen_config.dart` script in `tool/pigeon/`. - 2. Runs `jnigen` via the config script to parse the Kotlin bridge and produce Dart JNI bindings. - 3. Generates the final pigeon Dart output that wraps and imports those JNI bindings. + 2. Runs `jnigen` via the config script to parse the Kotlin bridge and produce Dart JNI bindings (`*.g.jni.dart`). + 3. Generates the web-safe main Pigeon Dart output (`*.g.dart`) and the conditionally imported native interop companion file (`*.native_interop.g.dart`) that wraps and imports those JNI bindings. - **iOS/macOS (FFI)**: When `swiftOptions.useFfi` is enabled: 1. Generates the Objective-C compatible Swift bridge and the `_ffigen_config.dart` script in `tool/pigeon/`. - 2. Runs `ffigen` via the config script to parse the Objective-C bridge and produce Dart FFI bindings. - 3. Generates the final pigeon Dart output that wraps and imports those FFI bindings. + 2. Runs `ffigen` via the config script to parse the Objective-C bridge and produce Dart FFI bindings (`*.g.ffi.dart`). + 3. Generates the web-safe main Pigeon Dart output (`*.g.dart`) and the conditionally imported native interop companion file (`*.native_interop.g.dart`) that wraps and imports those FFI bindings. ### Step 4: iOS/macOS Build System Configuration (FFI) diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/native_interop_tests.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/native_interop_tests.gen.dart index 821e8bc5024f..f9ea751307b2 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/native_interop_tests.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/native_interop_tests.gen.dart @@ -8,17 +8,14 @@ // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, omit_local_variable_types, omit_obvious_local_variable_types import 'dart:async'; -import 'dart:ffi'; -import 'dart:io' show Platform; -import 'dart:typed_data' show Float32List, Float64List, Int32List, Int64List, Int8List, TypedData; +import 'dart:typed_data' show Float64List, Int32List, Int64List; -import 'package:ffi/ffi.dart'; +import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter/services.dart'; -import 'package:jni/jni.dart'; -import 'package:meta/meta.dart' show immutable, protected, visibleForTesting; -import 'package:objective_c/objective_c.dart'; -import './native_interop_tests.gen.ffi.dart' as ffi_bridge; -import './native_interop_tests.gen.jni.dart' as jni_bridge; +import 'package:meta/meta.dart' show immutable, internal, protected, visibleForTesting; +import './native_interop_tests.gen.dart' + if (dart.library.ffi) './native_interop_tests.native_interop.gen.dart' + as pigeon_native; Object? _extractReplyValueOrThrow( List? replyList, @@ -116,1064 +113,9 @@ int _deepHash(Object? value) { return value.hashCode; } -class _PigeonJniCodec { - static JObject get _kotlinUnit { - final JClass unitClass = JClass.forName('kotlin/Unit'); - try { - return unitClass.staticFieldId('INSTANCE', 'Lkotlin/Unit;').get(unitClass, JObject.type); - } finally { - unitClass.release(); - } - } - - static Object? readValue(JObject? value) { - if (value == null) { - return null; - } - if (value.isA(JLong.type)) { - return value.as(JLong.type).longValue(); - } else if (value.isA(JDouble.type)) { - return value.as(JDouble.type).doubleValue(); - } else if (value.isA(JString.type)) { - return value.as(JString.type).toDartString(); - } else if (value.isA(JBoolean.type)) { - return value.as(JBoolean.type).booleanValue(); - } else if (value.isA(JByteArray.type)) { - final JByteArray array = value.as(JByteArray.type); - return Uint8List.fromList(array.getRange(0, array.length).buffer.asUint8List()); - } else if (value.isA(JIntArray.type)) { - final JIntArray array = value.as(JIntArray.type); - return Int32List.fromList(array.getRange(0, array.length)); - } else if (value.isA(JLongArray.type)) { - final JLongArray array = value.as(JLongArray.type); - return Int64List.fromList(array.getRange(0, array.length)); - } else if (value.isA(JDoubleArray.type)) { - final JDoubleArray array = value.as(JDoubleArray.type); - return Float64List.fromList(array.getRange(0, array.length)); - } else if (value.isA>(JList.type as JType>)) { - final List list = value.as(JList.type).asDart(); - final res = []; - // Cache the length before iterating to avoid a JNI hop per iteration. - final int len = list.length; - for (int i = 0; i < len; i++) { - res.add(readValue(list[i])); - } - return res; - } else if (value.isA>(JMap.type as JType>)) { - final Map map = value.as(JMap.type).asDart(); - final res = {}; - for (final MapEntry entry in map.entries) { - res[readValue(entry.key)] = readValue(entry.value); - } - return res; - } else if (value.isA( - jni_bridge.NativeInteropUnusedClass.type, - )) { - return NativeInteropUnusedClass.fromJni(value.as(jni_bridge.NativeInteropUnusedClass.type)); - } else if (value.isA(jni_bridge.NativeInteropAllTypes.type)) { - return NativeInteropAllTypes.fromJni(value.as(jni_bridge.NativeInteropAllTypes.type)); - } else if (value.isA( - jni_bridge.NativeInteropAllNullableTypes.type, - )) { - return NativeInteropAllNullableTypes.fromJni( - value.as(jni_bridge.NativeInteropAllNullableTypes.type), - ); - } else if (value.isA( - jni_bridge.NativeInteropAllNullableTypesWithoutRecursion.type, - )) { - return NativeInteropAllNullableTypesWithoutRecursion.fromJni( - value.as(jni_bridge.NativeInteropAllNullableTypesWithoutRecursion.type), - ); - } else if (value.isA( - jni_bridge.NativeInteropAllClassesWrapper.type, - )) { - return NativeInteropAllClassesWrapper.fromJni( - value.as(jni_bridge.NativeInteropAllClassesWrapper.type), - ); - } else if (value.isA( - jni_bridge.NativeInteropSealedClassWithFields.type, - )) { - return NativeInteropSealedClassWithFields.fromJni( - value.as(jni_bridge.NativeInteropSealedClassWithFields.type), - ); - } else if (value.isA( - jni_bridge.NativeInteropEmptySealedClass.type, - )) { - return NativeInteropEmptySealedClass.fromJni( - value.as(jni_bridge.NativeInteropEmptySealedClass.type), - ); - } else if (value.isA( - jni_bridge.NativeInteropSealedClassWrapper.type, - )) { - return NativeInteropSealedClassWrapper.fromJni( - value.as(jni_bridge.NativeInteropSealedClassWrapper.type), - ); - } else if (value.isA( - jni_bridge.NativeInteropReservedNames.type, - )) { - return NativeInteropReservedNames.fromJni( - value.as(jni_bridge.NativeInteropReservedNames.type), - ); - } else if (value.isA(jni_bridge.NativeInteropAnEnum.type)) { - return NativeInteropAnEnum.fromJni(value.as(jni_bridge.NativeInteropAnEnum.type)); - } else if (value.isA( - jni_bridge.NativeInteropAnotherEnum.type, - )) { - return NativeInteropAnotherEnum.fromJni(value.as(jni_bridge.NativeInteropAnotherEnum.type)); - } else { - throw ArgumentError.value(value); - } - } - - static T writeValue(Object? value) { - if (value == null) { - return null as T; - } - if (value is bool) { - return JBoolean(value) as T; - } else if (value is double) { - return JDouble(value) as T; - // ignore: avoid_double_and_int_checks - } else if (value is int) { - return JLong(value) as T; - } else if (value is String) { - return value.toJString() as T; - } else if (value is Uint8List) { - final JByteArray array = JByteArray(value.length); - array.setRange( - 0, - value.length, - Int8List.view(value.buffer, value.offsetInBytes, value.length), - ); - return array as T; - } else if (value is Int32List) { - final JIntArray array = JIntArray(value.length); - array.setRange(0, value.length, value); - return array as T; - } else if (value is Int64List) { - final JLongArray array = JLongArray(value.length); - array.setRange(0, value.length, value); - return array as T; - } else if (value is Float64List) { - final JDoubleArray array = JDoubleArray(value.length); - array.setRange(0, value.length, value); - return array as T; - } else if (value is List) { - return value - .map( - (e) => writeValue(e), - ) - .toJList() - as T; - } else if (value is List) { - return value.map((e) => writeValue(e)).toJList() as T; - } else if (value is List) { - return value.map((e) => writeValue(e)).toJList() as T; - } else if (value is List) { - return value.map((e) => writeValue(e)).toJList() as T; - } else if (value is List) { - return value.map((e) => writeValue(e)).toJList() as T; - } else if (value is List) { - return value - .map( - (e) => writeValue(e), - ) - .toJList() - as T; - } else if (value is List) { - return value - .map( - (e) => writeValue(e), - ) - .toJList() - as T; - } else if (value is List) { - return value - .map( - (e) => writeValue(e), - ) - .toJList() - as T; - } else if (value is List) { - return value.map((e) => writeValue(e)).toJList() as T; - } else if (value is List) { - return value.map((e) => writeValue(e)).toJList() as T; - } else if (value is List) { - return value.map((e) => writeValue(e)).toJList() as T; - } else if (value is List) { - return value.map((e) => writeValue(e)).toJList() as T; - } else if (value is List) { - return value - .map( - (e) => writeValue(e), - ) - .toJList() - as T; - } else if (value is List) { - return value - .map( - (e) => writeValue(e), - ) - .toJList() - as T; - } else if (value is List) { - return value - .map( - (e) => writeValue(e), - ) - .toJList() - as T; - } else if (value is List>) { - return value.map>((e) => writeValue>(e)).toJList() as T; - } else if (value is List?>) { - return value.map?>((e) => writeValue?>(e)).toJList() as T; - } else if (value is List>) { - return value - .map>((e) => writeValue>(e)) - .toJList() - as T; - } else if (value is List?>) { - return value - .map?>((e) => writeValue?>(e)) - .toJList() - as T; - } else if (value is List) { - return value.map((e) => writeValue(e)).toJList() as T; - } else if (value is List) { - return value.map((e) => writeValue(e)).toJList() as T; - } else if (value is Map) { - return value - .map( - (k, v) => MapEntry(writeValue(k), writeValue(v)), - ) - .toJMap() - as T; - } else if (value is Map) { - return value - .map((k, v) => MapEntry(writeValue(k), writeValue(v))) - .toJMap() - as T; - } else if (value is Map) { - return value - .map( - (k, v) => MapEntry( - writeValue(k), - writeValue(v), - ), - ) - .toJMap() - as T; - } else if (value is Map) { - return value - .map( - (k, v) => MapEntry( - writeValue(k), - writeValue(v), - ), - ) - .toJMap() - as T; - } else if (value is Map) { - return value - .map( - (k, v) => MapEntry( - writeValue(k), - writeValue(v), - ), - ) - .toJMap() - as T; - } else if (value is Map) { - return value - .map( - (k, v) => MapEntry(writeValue(k), writeValue(v)), - ) - .toJMap() - as T; - } else if (value is Map) { - return value - .map((k, v) => MapEntry(writeValue(k), writeValue(v))) - .toJMap() - as T; - } else if (value is Map) { - return value - .map( - (k, v) => MapEntry( - writeValue(k), - writeValue(v), - ), - ) - .toJMap() - as T; - } else if (value is Map) { - return value - .map( - (k, v) => MapEntry( - writeValue(k), - writeValue(v), - ), - ) - .toJMap() - as T; - } else if (value is Map) { - return value - .map( - (k, v) => MapEntry( - writeValue(k), - writeValue(v), - ), - ) - .toJMap() - as T; - } else if (value is Map>) { - return value - .map>( - (k, v) => MapEntry(writeValue(k), writeValue>(v)), - ) - .toJMap() - as T; - } else if (value is Map?>) { - return value - .map?>( - (k, v) => MapEntry(writeValue(k), writeValue?>(v)), - ) - .toJMap() - as T; - } else if (value is Map>) { - return value - .map>( - (k, v) => MapEntry(writeValue(k), writeValue>(v)), - ) - .toJMap() - as T; - } else if (value is Map?>) { - return value - .map?>( - (k, v) => MapEntry(writeValue(k), writeValue?>(v)), - ) - .toJMap() - as T; - } else if (value is Map) { - return value - .map( - (k, v) => MapEntry(writeValue(k), writeValue(v)), - ) - .toJMap() - as T; - } else if (value is Map) { - return value - .map( - (k, v) => MapEntry(writeValue(k), writeValue(v)), - ) - .toJMap() - as T; - } else if (value is Map) { - return value - .map( - (k, v) => MapEntry(writeValue(k), writeValue(v)), - ) - .toJMap() - as T; - } else if (value is NativeInteropUnusedClass) { - return value.toJni() as T; - } else if (value is NativeInteropAllTypes) { - return value.toJni() as T; - } else if (value is NativeInteropAllNullableTypes) { - return value.toJni() as T; - } else if (value is NativeInteropAllNullableTypesWithoutRecursion) { - return value.toJni() as T; - } else if (value is NativeInteropAllClassesWrapper) { - return value.toJni() as T; - } else if (value is NativeInteropSealedClassWithFields) { - return value.toJni() as T; - } else if (value is NativeInteropEmptySealedClass) { - return value.toJni() as T; - } else if (value is NativeInteropSealedClassWrapper) { - return value.toJni() as T; - } else if (value is NativeInteropReservedNames) { - return value.toJni() as T; - } else if (value is NativeInteropAnEnum) { - return value.toJni() as T; - } else if (value is NativeInteropAnotherEnum) { - return value.toJni() as T; - } else { - throw ArgumentError.value(value); - } - } -} - -class _PigeonFfiCodec { - static Object? readValue(ObjCObject? value, [Type? type, Type? type2]) { - if (value == null || ffi_bridge.NativeInteropTestsPigeonInternalNull.isA(value)) { - return null; - } else if (NSNumber.isA(value)) { - final NSNumber numValue = NSNumber.as(value); - if (type == double) { - return numValue.doubleValue; - } else if (type == bool) { - return numValue.boolValue; - } else if (type == NativeInteropAnEnum) { - return NativeInteropAnEnum.fromNSNumber(numValue); - } else if (type == NativeInteropAnotherEnum) { - return NativeInteropAnotherEnum.fromNSNumber(numValue); - } - - return numValue.longValue; - } else if (NSString.isA(value)) { - return NSString.as(value).toDartString(); - } else if (ffi_bridge.NativeInteropTestsPigeonTypedData.isA(value)) { - return _getValueFromPigeonTypedData(value as ffi_bridge.NativeInteropTestsPigeonTypedData); - } else if (NSArray.isA(value)) { - final NSArray array = NSArray.as(value); - final List res = []; - for (int i = 0; i < array.count; i++) { - res.add(readValue(array.objectAtIndex(i), type)); - } - return res; - } else if (NSDictionary.isA(value)) { - final NSDictionary dict = NSDictionary.as(value); - final NSArray keys = dict.allKeys; - final Map res = {}; - for (int i = 0; i < keys.count; i++) { - final ObjCObject key = keys.objectAtIndex(i); - res[readValue(key, type, type2)] = readValue(dict.objectForKey(key), type, type2); - } - return res; - } else if (ffi_bridge.NativeInteropTestsNumberWrapper.isA(value)) { - return _convertNumberWrapperToDart(ffi_bridge.NativeInteropTestsNumberWrapper.as(value)); - } else if (ffi_bridge.NativeInteropUnusedClassBridge.isA(value)) { - return NativeInteropUnusedClass.fromFfi(ffi_bridge.NativeInteropUnusedClassBridge.as(value)); - } else if (ffi_bridge.NativeInteropAllTypesBridge.isA(value)) { - return NativeInteropAllTypes.fromFfi(ffi_bridge.NativeInteropAllTypesBridge.as(value)); - } else if (ffi_bridge.NativeInteropAllNullableTypesBridge.isA(value)) { - return NativeInteropAllNullableTypes.fromFfi( - ffi_bridge.NativeInteropAllNullableTypesBridge.as(value), - ); - } else if (ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge.isA(value)) { - return NativeInteropAllNullableTypesWithoutRecursion.fromFfi( - ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge.as(value), - ); - } else if (ffi_bridge.NativeInteropAllClassesWrapperBridge.isA(value)) { - return NativeInteropAllClassesWrapper.fromFfi( - ffi_bridge.NativeInteropAllClassesWrapperBridge.as(value), - ); - } else if (ffi_bridge.NativeInteropSealedClassWithFieldsBridge.isA(value)) { - return NativeInteropSealedClassWithFields.fromFfi( - ffi_bridge.NativeInteropSealedClassWithFieldsBridge.as(value), - ); - } else if (ffi_bridge.NativeInteropEmptySealedClassBridge.isA(value)) { - return NativeInteropEmptySealedClass.fromFfi( - ffi_bridge.NativeInteropEmptySealedClassBridge.as(value), - ); - } else if (ffi_bridge.NativeInteropSealedClassWrapperBridge.isA(value)) { - return NativeInteropSealedClassWrapper.fromFfi( - ffi_bridge.NativeInteropSealedClassWrapperBridge.as(value), - ); - } else if (ffi_bridge.NativeInteropReservedNamesBridge.isA(value)) { - return NativeInteropReservedNames.fromFfi( - ffi_bridge.NativeInteropReservedNamesBridge.as(value), - ); - } else { - throw ArgumentError.value(value); - } - } - - static T writeValue(Object? value, {bool generic = false}) { - if (value == null) { - if (_isTypeOrNullableType(ObjCObject) || _isTypeOrNullableType(NSObject)) { - return ffi_bridge.NativeInteropTestsPigeonInternalNull() as T; - } - return null as T; - } - if (value is bool) { - return (generic - ? _convertToFfiNumberWrapper(value) - : NSNumber.alloc().initWithLong(value ? 1 : 0)) - as T; - } else if (value is double) { - return (generic ? _convertToFfiNumberWrapper(value) : NSNumber.alloc().initWithDouble(value)) - as T; - // ignore: avoid_double_and_int_checks - } else if (value is int) { - return (generic ? _convertToFfiNumberWrapper(value) : NSNumber.alloc().initWithLong(value)) - as T; - } else if (value is Enum) { - return (generic - ? _convertToFfiNumberWrapper(value) - : NSNumber.alloc().initWithLong(value.index)) - as T; - } else if (value is String) { - return NSString(value) as T; - } else if (value is TypedData) { - return _toPigeonTypedData(value) as T; - } else if (value is List && - _isTypeOrNullableType(T)) { - final NSMutableArray res = NSMutableArray(); - for (final NativeInteropSealedClass entry in value) { - res.addObject(writeValue(entry, generic: true)); - } - return res as T; - } else if (value is List && _isTypeOrNullableType(T)) { - final NSMutableArray res = NSMutableArray(); - for (final String entry in value) { - res.addObject(writeValue(entry, generic: true)); - } - return res as T; - } else if (value is List && _isTypeOrNullableType(T)) { - final NSMutableArray res = NSMutableArray(); - for (final int entry in value) { - res.addObject(writeValue(entry, generic: true)); - } - return res as T; - } else if (value is List && _isTypeOrNullableType(T)) { - final NSMutableArray res = NSMutableArray(); - for (final double entry in value) { - res.addObject(writeValue(entry, generic: true)); - } - return res as T; - } else if (value is List && _isTypeOrNullableType(T)) { - final NSMutableArray res = NSMutableArray(); - for (final bool entry in value) { - res.addObject(writeValue(entry, generic: true)); - } - return res as T; - } else if (value is List && _isTypeOrNullableType(T)) { - final NSMutableArray res = NSMutableArray(); - for (final NativeInteropAllTypes? entry in value) { - res.addObject( - entry == null - ? ffi_bridge.NativeInteropTestsPigeonInternalNull() - : writeValue(entry, generic: true), - ); - } - return res as T; - } else if (value is List && _isTypeOrNullableType(T)) { - final NSMutableArray res = NSMutableArray(); - for (final NativeInteropAnEnum entry in value) { - res.addObject(writeValue(entry, generic: true)); - } - return res as T; - } else if (value is List && - _isTypeOrNullableType(T)) { - final NSMutableArray res = NSMutableArray(); - for (final NativeInteropAllNullableTypes entry in value) { - res.addObject( - writeValue(entry, generic: true), - ); - } - return res as T; - } else if (value is List && _isTypeOrNullableType(T)) { - final NSMutableArray res = NSMutableArray(); - for (final String? entry in value) { - res.addObject( - entry == null - ? ffi_bridge.NativeInteropTestsPigeonInternalNull() - : writeValue(entry, generic: true), - ); - } - return res as T; - } else if (value is List && _isTypeOrNullableType(T)) { - final NSMutableArray res = NSMutableArray(); - for (final int? entry in value) { - res.addObject( - entry == null - ? ffi_bridge.NativeInteropTestsPigeonInternalNull() - : writeValue(entry, generic: true), - ); - } - return res as T; - } else if (value is List && _isTypeOrNullableType(T)) { - final NSMutableArray res = NSMutableArray(); - for (final double? entry in value) { - res.addObject( - entry == null - ? ffi_bridge.NativeInteropTestsPigeonInternalNull() - : writeValue(entry, generic: true), - ); - } - return res as T; - } else if (value is List && _isTypeOrNullableType(T)) { - final NSMutableArray res = NSMutableArray(); - for (final bool? entry in value) { - res.addObject( - entry == null - ? ffi_bridge.NativeInteropTestsPigeonInternalNull() - : writeValue(entry, generic: true), - ); - } - return res as T; - } else if (value is List && _isTypeOrNullableType(T)) { - final NSMutableArray res = NSMutableArray(); - for (final NativeInteropAnEnum? entry in value) { - res.addObject( - entry == null - ? ffi_bridge.NativeInteropTestsPigeonInternalNull() - : writeValue(entry, generic: true), - ); - } - return res as T; - } else if (value is List && - _isTypeOrNullableType(T)) { - final NSMutableArray res = NSMutableArray(); - for (final NativeInteropAllNullableTypes? entry in value) { - res.addObject( - entry == null - ? ffi_bridge.NativeInteropTestsPigeonInternalNull() - : writeValue(entry, generic: true), - ); - } - return res as T; - } else if (value is List && - _isTypeOrNullableType(T)) { - final NSMutableArray res = NSMutableArray(); - for (final NativeInteropAllNullableTypesWithoutRecursion? entry in value) { - res.addObject( - entry == null - ? ffi_bridge.NativeInteropTestsPigeonInternalNull() - : writeValue( - entry, - generic: true, - ), - ); - } - return res as T; - } else if (value is List> && _isTypeOrNullableType(T)) { - final NSMutableArray res = NSMutableArray(); - for (final List entry in value) { - res.addObject(writeValue(entry, generic: true)); - } - return res as T; - } else if (value is List?> && _isTypeOrNullableType(T)) { - final NSMutableArray res = NSMutableArray(); - for (final List? entry in value) { - res.addObject( - entry == null - ? ffi_bridge.NativeInteropTestsPigeonInternalNull() - : writeValue(entry, generic: true), - ); - } - return res as T; - } else if (value is List> && _isTypeOrNullableType(T)) { - final NSMutableArray res = NSMutableArray(); - for (final Map entry in value) { - res.addObject(writeValue(entry, generic: true)); - } - return res as T; - } else if (value is List?> && _isTypeOrNullableType(T)) { - final NSMutableArray res = NSMutableArray(); - for (final Map? entry in value) { - res.addObject( - entry == null - ? ffi_bridge.NativeInteropTestsPigeonInternalNull() - : writeValue(entry, generic: true), - ); - } - return res as T; - } else if (value is List) { - final NSMutableArray res = NSMutableArray(); - for (final Object? entry in value) { - res.addObject( - entry == null - ? ffi_bridge.NativeInteropTestsPigeonInternalNull() - : writeValue(entry, generic: true), - ); - } - return res as T; - } else if (value is Map && _isTypeOrNullableType(T)) { - final NSMutableDictionary res = NSMutableDictionary(); - for (final MapEntry entry in value.entries) { - res.setObject( - writeValue(entry.value, generic: true), - forKey: NSCopying.as(writeValue(entry.key, generic: true)), - ); - } - return res as T; - } else if (value is Map && _isTypeOrNullableType(T)) { - final NSMutableDictionary res = NSMutableDictionary(); - for (final MapEntry entry in value.entries) { - res.setObject( - writeValue(entry.value, generic: true), - forKey: NSCopying.as(writeValue(entry.key, generic: true)), - ); - } - return res as T; - } else if (value is Map && - _isTypeOrNullableType(T)) { - final NSMutableDictionary res = NSMutableDictionary(); - for (final MapEntry entry in value.entries) { - res.setObject( - writeValue(entry.value, generic: true), - forKey: NSCopying.as(writeValue(entry.key, generic: true)), - ); - } - return res as T; - } else if (value is Map && - _isTypeOrNullableType(T)) { - final NSMutableDictionary res = NSMutableDictionary(); - for (final MapEntry entry in value.entries) { - res.setObject( - writeValue(entry.value, generic: true), - forKey: NSCopying.as(writeValue(entry.key, generic: true)), - ); - } - return res as T; - } else if (value is Map && - _isTypeOrNullableType(T)) { - final NSMutableDictionary res = NSMutableDictionary(); - for (final MapEntry entry in value.entries) { - res.setObject( - writeValue(entry.value, generic: true), - forKey: NSCopying.as(writeValue(entry.key, generic: true)), - ); - } - return res as T; - } else if (value is Map && _isTypeOrNullableType(T)) { - final NSMutableDictionary res = NSMutableDictionary(); - for (final MapEntry entry in value.entries) { - res.setObject( - writeValue(entry.value, generic: true), - forKey: NSCopying.as(writeValue(entry.key, generic: true)), - ); - } - return res as T; - } else if (value is Map && _isTypeOrNullableType(T)) { - final NSMutableDictionary res = NSMutableDictionary(); - for (final MapEntry entry in value.entries) { - res.setObject( - writeValue(entry.value, generic: true), - forKey: NSCopying.as(writeValue(entry.key, generic: true)), - ); - } - return res as T; - } else if (value is Map && - _isTypeOrNullableType(T)) { - final NSMutableDictionary res = NSMutableDictionary(); - for (final MapEntry entry in value.entries) { - res.setObject( - writeValue(entry.value, generic: true), - forKey: NSCopying.as(writeValue(entry.key, generic: true)), - ); - } - return res as T; - } else if (value is Map && - _isTypeOrNullableType(T)) { - final NSMutableDictionary res = NSMutableDictionary(); - for (final MapEntry entry in value.entries) { - res.setObject( - writeValue(entry.value, generic: true), - forKey: NSCopying.as(writeValue(entry.key, generic: true)), - ); - } - return res as T; - } else if (value is Map && - _isTypeOrNullableType(T)) { - final NSMutableDictionary res = NSMutableDictionary(); - for (final MapEntry entry - in value.entries) { - res.setObject( - writeValue(entry.value, generic: true), - forKey: NSCopying.as(writeValue(entry.key, generic: true)), - ); - } - return res as T; - } else if (value is Map> && _isTypeOrNullableType(T)) { - final NSMutableDictionary res = NSMutableDictionary(); - for (final MapEntry> entry in value.entries) { - res.setObject( - writeValue(entry.value, generic: true), - forKey: NSCopying.as(writeValue(entry.key, generic: true)), - ); - } - return res as T; - } else if (value is Map?> && _isTypeOrNullableType(T)) { - final NSMutableDictionary res = NSMutableDictionary(); - for (final MapEntry?> entry in value.entries) { - res.setObject( - writeValue(entry.value, generic: true), - forKey: NSCopying.as(writeValue(entry.key, generic: true)), - ); - } - return res as T; - } else if (value is Map> && _isTypeOrNullableType(T)) { - final NSMutableDictionary res = NSMutableDictionary(); - for (final MapEntry> entry in value.entries) { - res.setObject( - writeValue(entry.value, generic: true), - forKey: NSCopying.as(writeValue(entry.key, generic: true)), - ); - } - return res as T; - } else if (value is Map?> && - _isTypeOrNullableType(T)) { - final NSMutableDictionary res = NSMutableDictionary(); - for (final MapEntry?> entry in value.entries) { - res.setObject( - writeValue(entry.value, generic: true), - forKey: NSCopying.as(writeValue(entry.key, generic: true)), - ); - } - return res as T; - } else if (value is Map) { - final NSMutableDictionary res = NSMutableDictionary(); - for (final MapEntry entry in value.entries) { - res.setObject( - writeValue(entry.value, generic: true), - forKey: NSCopying.as(writeValue(entry.key, generic: true)), - ); - } - return res as T; - } else if (value is NativeInteropUnusedClass) { - return value.toFfi() as T; - } else if (value is NativeInteropAllTypes) { - return value.toFfi() as T; - } else if (value is NativeInteropAllNullableTypes) { - return value.toFfi() as T; - } else if (value is NativeInteropAllNullableTypesWithoutRecursion) { - return value.toFfi() as T; - } else if (value is NativeInteropAllClassesWrapper) { - return value.toFfi() as T; - } else if (value is NativeInteropSealedClassWithFields) { - return value.toFfi() as T; - } else if (value is NativeInteropEmptySealedClass) { - return value.toFfi() as T; - } else if (value is NativeInteropSealedClassWrapper) { - return value.toFfi() as T; - } else if (value is NativeInteropReservedNames) { - return value.toFfi() as T; - } else { - throw ArgumentError.value(value); - } - } -} - -ffi_bridge.NativeInteropTestsPigeonTypedData _toPigeonTypedData(TypedData value) { - final int lengthInBytes = value.lengthInBytes; - if (value is Uint8List) { - final int length = value.length; - final Pointer ptr = calloc(length); - ptr.asTypedList(length).setAll(0, value); - final NSData nsData = NSData.dataWithBytes(ptr.cast(), length: lengthInBytes); - calloc.free(ptr); - return ffi_bridge.NativeInteropTestsPigeonTypedData.alloc().initWithData(nsData, type: 0); - } else if (value is Int32List) { - final int length = value.length; - final Pointer ptr = calloc(length); - ptr.asTypedList(length).setAll(0, value); - final NSData nsData = NSData.dataWithBytes(ptr.cast(), length: lengthInBytes); - calloc.free(ptr); - return ffi_bridge.NativeInteropTestsPigeonTypedData.alloc().initWithData(nsData, type: 1); - } else if (value is Int64List) { - final int length = value.length; - final Pointer ptr = calloc(length); - ptr.asTypedList(length).setAll(0, value); - final NSData nsData = NSData.dataWithBytes(ptr.cast(), length: lengthInBytes); - calloc.free(ptr); - return ffi_bridge.NativeInteropTestsPigeonTypedData.alloc().initWithData(nsData, type: 2); - } else if (value is Float32List) { - final int length = value.length; - final Pointer ptr = calloc(length); - ptr.asTypedList(length).setAll(0, value); - final NSData nsData = NSData.dataWithBytes(ptr.cast(), length: lengthInBytes); - calloc.free(ptr); - return ffi_bridge.NativeInteropTestsPigeonTypedData.alloc().initWithData(nsData, type: 3); - } else if (value is Float64List) { - final int length = value.length; - final Pointer ptr = calloc(length); - ptr.asTypedList(length).setAll(0, value); - final NSData nsData = NSData.dataWithBytes(ptr.cast(), length: lengthInBytes); - calloc.free(ptr); - return ffi_bridge.NativeInteropTestsPigeonTypedData.alloc().initWithData(nsData, type: 4); - } - throw ArgumentError.value(value); -} - -Object? _getValueFromPigeonTypedData(ffi_bridge.NativeInteropTestsPigeonTypedData value) { - final NSData data = value.data; - final ObjCObjectRef dataRef = data.object$.ref; - try { - final int lengthInBytes = data.length; - if (lengthInBytes == 0) { - return switch (value.type) { - 0 => Uint8List(0), - 1 => Int32List(0), - 2 => Int64List(0), - 3 => Float32List(0), - 4 => Float64List(0), - _ => throw ArgumentError.value(value), - }; - } - final Pointer bytes = data.bytes; - return switch (value.type) { - 0 => Uint8List.fromList(bytes.cast().asTypedList(lengthInBytes)), - 1 => Int32List.fromList(bytes.cast().asTypedList(lengthInBytes ~/ 4)), - 2 => Int64List.fromList(bytes.cast().asTypedList(lengthInBytes ~/ 8)), - 3 => Float32List.fromList(bytes.cast().asTypedList(lengthInBytes ~/ 4)), - 4 => Float64List.fromList(bytes.cast().asTypedList(lengthInBytes ~/ 8)), - _ => throw ArgumentError.value(value), - }; - } finally { - dataRef.release(); - } -} - -Object? _convertNumberWrapperToDart(ffi_bridge.NativeInteropTestsNumberWrapper value) { - switch (value.type) { - case 1: - return value.number.longValue; - case 2: - return value.number.doubleValue; - case 3: - return value.number.boolValue; - case 4: - return NativeInteropAnEnum.fromNSNumber(value.number); - case 5: - return NativeInteropAnotherEnum.fromNSNumber(value.number); - default: - throw ArgumentError.value(value); - } -} - -ffi_bridge.NativeInteropTestsNumberWrapper _convertToFfiNumberWrapper(Object value) { - switch (value) { - case int _: - return ffi_bridge.NativeInteropTestsNumberWrapper.alloc().initWithNumber( - NSNumber.alloc().initWithLong(value), - type: 1, - ); - case double _: - return ffi_bridge.NativeInteropTestsNumberWrapper.alloc().initWithNumber( - NSNumber.alloc().initWithDouble(value), - type: 2, - ); - case bool _: - return ffi_bridge.NativeInteropTestsNumberWrapper.alloc().initWithNumber( - NSNumber.alloc().initWithLong(value ? 1 : 0), - type: 3, - ); - case NativeInteropAnEnum _: - return ffi_bridge.NativeInteropTestsNumberWrapper.alloc().initWithNumber( - value.toNSNumber(), - type: 4, - ); - case NativeInteropAnotherEnum _: - return ffi_bridge.NativeInteropTestsNumberWrapper.alloc().initWithNumber( - value.toNSNumber(), - type: 5, - ); - default: - throw ArgumentError.value(value); - } -} - -bool _isType(Type t) => T == t; -bool _isTypeOrNullableType(Type t) => _isType(t) || _isType(t); - -void _throwNoInstanceError(String channelName) { - String nameString = 'named $channelName'; - if (channelName == defaultInstanceName) { - nameString = 'with no name'; - } - final String error = 'No instance $nameString has been registered.'; - throw ArgumentError(error); -} - -void _throwIfFfiError(ffi_bridge.NativeInteropTestsError error) { - if (error.code != null) { - throw _wrapFfiError(error); - } -} - -PlatformException _wrapFfiError(ffi_bridge.NativeInteropTestsError error) => PlatformException( - code: error.code!.toDartString(), - message: error.message?.toDartString(), - details: NSString.isA(error.details) ? error.details!.toDartString() : error.details, -); - -void _reportFfiError(ffi_bridge.NativeInteropTestsError errorOut, Object e) { - if (e is PlatformException) { - errorOut.code = NSString(e.code); - errorOut.message = NSString(e.message ?? ''); - errorOut.details = NSString((e.details ?? '').toString()); - } else { - errorOut.code = NSString('error'); - errorOut.message = NSString(e.toString()); - errorOut.details = null; - } -} - -PlatformException _wrapJniException(JThrowable e) { - if (e.isA(jni_bridge.NativeInteropTestsError.type)) { - final jni_bridge.NativeInteropTestsError pigeonError = e.as( - jni_bridge.NativeInteropTestsError.type, - ); - return PlatformException( - code: pigeonError.code.toDartString(), - message: pigeonError.message?.toDartString(), - details: pigeonError.details?.isA(JString.type) ?? false - ? pigeonError.details!.as(JString.type).toDartString() - : pigeonError.details, - stacktrace: e.javaStackTrace, - ); - } - return PlatformException( - code: 'PlatformException', - message: e.message, - details: e, - stacktrace: e.javaStackTrace, - ); -} - -enum NativeInteropAnEnum { - one, - two, - three, - fortyTwo, - fourHundredTwentyTwo; - - jni_bridge.NativeInteropAnEnum toJni() { - return jni_bridge.NativeInteropAnEnum.Companion.ofRaw(index)!; - } - - static NativeInteropAnEnum? fromJni(jni_bridge.NativeInteropAnEnum? jniEnum) { - return jniEnum == null ? null : NativeInteropAnEnum.values[jniEnum.raw]; - } - - NSNumber toFfi() { - return _PigeonFfiCodec.writeValue(index); - } - - NSNumber toNSNumber() { - return NSNumber.alloc().initWithLong(index); - } - - static NativeInteropAnEnum? fromNSNumber(NSNumber? ffiEnum) { - return ffiEnum == null ? null : NativeInteropAnEnum.values[ffiEnum.intValue]; - } -} - -enum NativeInteropAnotherEnum { - justInCase; +enum NativeInteropAnEnum { one, two, three, fortyTwo, fourHundredTwentyTwo } - jni_bridge.NativeInteropAnotherEnum toJni() { - return jni_bridge.NativeInteropAnotherEnum.Companion.ofRaw(index)!; - } - - static NativeInteropAnotherEnum? fromJni(jni_bridge.NativeInteropAnotherEnum? jniEnum) { - return jniEnum == null ? null : NativeInteropAnotherEnum.values[jniEnum.raw]; - } - - NSNumber toFfi() { - return _PigeonFfiCodec.writeValue(index); - } - - NSNumber toNSNumber() { - return NSNumber.alloc().initWithLong(index); - } - - static NativeInteropAnotherEnum? fromNSNumber(NSNumber? ffiEnum) { - return ffiEnum == null ? null : NativeInteropAnotherEnum.values[ffiEnum.intValue]; - } -} +enum NativeInteropAnotherEnum { justInCase } class NativeInteropUnusedClass { NativeInteropUnusedClass({this.aField}); @@ -1184,32 +126,10 @@ class NativeInteropUnusedClass { return [aField]; } - jni_bridge.NativeInteropUnusedClass toJni() { - return jni_bridge.NativeInteropUnusedClass(_PigeonJniCodec.writeValue(aField)); - } - - ffi_bridge.NativeInteropUnusedClassBridge toFfi() { - return ffi_bridge.NativeInteropUnusedClassBridge.alloc().initWithAField( - _PigeonFfiCodec.writeValue(aField, generic: true), - ); - } - Object encode() { return _toList(); } - static NativeInteropUnusedClass? fromJni(jni_bridge.NativeInteropUnusedClass? jniClass) { - return jniClass == null - ? null - : NativeInteropUnusedClass(aField: _PigeonJniCodec.readValue(jniClass.aField)); - } - - static NativeInteropUnusedClass? fromFfi(ffi_bridge.NativeInteropUnusedClassBridge? ffiClass) { - return ffiClass == null - ? null - : NativeInteropUnusedClass(aField: _PigeonFfiCodec.readValue(ffiClass.aField)); - } - static NativeInteropUnusedClass decode(Object result) { result as List; return NativeInteropUnusedClass(aField: result[0]); @@ -1359,192 +279,10 @@ class NativeInteropAllTypes { ]; } - jni_bridge.NativeInteropAllTypes toJni() { - return jni_bridge.NativeInteropAllTypes( - aBool, - anInt, - anInt64, - aDouble, - _PigeonJniCodec.writeValue(aByteArray), - _PigeonJniCodec.writeValue(a4ByteArray), - _PigeonJniCodec.writeValue(a8ByteArray), - _PigeonJniCodec.writeValue(aFloatArray), - anEnum.toJni(), - anotherEnum.toJni(), - _PigeonJniCodec.writeValue(aString), - _PigeonJniCodec.writeValue(anObject), - _PigeonJniCodec.writeValue>(list), - _PigeonJniCodec.writeValue>(stringList), - _PigeonJniCodec.writeValue>(intList), - _PigeonJniCodec.writeValue>(doubleList), - _PigeonJniCodec.writeValue>(boolList), - _PigeonJniCodec.writeValue>(enumList), - _PigeonJniCodec.writeValue>(objectList), - _PigeonJniCodec.writeValue>>(listList), - _PigeonJniCodec.writeValue>>(mapList), - _PigeonJniCodec.writeValue>(map), - _PigeonJniCodec.writeValue>(stringMap), - _PigeonJniCodec.writeValue>(intMap), - _PigeonJniCodec.writeValue< - JMap - >(enumMap), - _PigeonJniCodec.writeValue>(objectMap), - _PigeonJniCodec.writeValue>>(listMap), - _PigeonJniCodec.writeValue>>(mapMap), - ); - } - - ffi_bridge.NativeInteropAllTypesBridge toFfi() { - return ffi_bridge.NativeInteropAllTypesBridge.alloc().initWithABool( - aBool, - anInt: anInt, - anInt64: anInt64, - aDouble: aDouble, - aByteArray: _PigeonFfiCodec.writeValue( - aByteArray, - ), - a4ByteArray: _PigeonFfiCodec.writeValue( - a4ByteArray, - ), - a8ByteArray: _PigeonFfiCodec.writeValue( - a8ByteArray, - ), - aFloatArray: _PigeonFfiCodec.writeValue( - aFloatArray, - ), - anEnum: ffi_bridge.NativeInteropAnEnum.values[anEnum.index], - anotherEnum: ffi_bridge.NativeInteropAnotherEnum.values[anotherEnum.index], - aString: _PigeonFfiCodec.writeValue(aString), - anObject: _PigeonFfiCodec.writeValue(anObject, generic: true), - list: _PigeonFfiCodec.writeValue(list), - stringList: _PigeonFfiCodec.writeValue(stringList), - intList: _PigeonFfiCodec.writeValue(intList), - doubleList: _PigeonFfiCodec.writeValue(doubleList), - boolList: _PigeonFfiCodec.writeValue(boolList), - enumList: _PigeonFfiCodec.writeValue(enumList), - objectList: _PigeonFfiCodec.writeValue(objectList), - listList: _PigeonFfiCodec.writeValue(listList), - mapList: _PigeonFfiCodec.writeValue(mapList), - map: _PigeonFfiCodec.writeValue(map), - stringMap: _PigeonFfiCodec.writeValue(stringMap), - intMap: _PigeonFfiCodec.writeValue(intMap), - enumMap: _PigeonFfiCodec.writeValue(enumMap), - objectMap: _PigeonFfiCodec.writeValue(objectMap), - listMap: _PigeonFfiCodec.writeValue(listMap), - mapMap: _PigeonFfiCodec.writeValue(mapMap), - ); - } - Object encode() { return _toList(); } - static NativeInteropAllTypes? fromJni(jni_bridge.NativeInteropAllTypes? jniClass) { - return jniClass == null - ? null - : NativeInteropAllTypes( - aBool: jniClass.aBool, - anInt: jniClass.anInt, - anInt64: jniClass.anInt64, - aDouble: jniClass.aDouble, - aByteArray: _PigeonJniCodec.readValue(jniClass.aByteArray)! as Uint8List, - a4ByteArray: _PigeonJniCodec.readValue(jniClass.a4ByteArray)! as Int32List, - a8ByteArray: _PigeonJniCodec.readValue(jniClass.a8ByteArray)! as Int64List, - aFloatArray: _PigeonJniCodec.readValue(jniClass.aFloatArray)! as Float64List, - anEnum: NativeInteropAnEnum.fromJni(jniClass.anEnum)!, - anotherEnum: NativeInteropAnotherEnum.fromJni(jniClass.anotherEnum)!, - aString: jniClass.aString.toDartString(releaseOriginal: true), - anObject: _PigeonJniCodec.readValue(jniClass.anObject)!, - list: (_PigeonJniCodec.readValue(jniClass.list)! as List).cast(), - stringList: (_PigeonJniCodec.readValue(jniClass.stringList)! as List) - .cast(), - intList: (_PigeonJniCodec.readValue(jniClass.intList)! as List).cast(), - doubleList: (_PigeonJniCodec.readValue(jniClass.doubleList)! as List) - .cast(), - boolList: (_PigeonJniCodec.readValue(jniClass.boolList)! as List).cast(), - enumList: (_PigeonJniCodec.readValue(jniClass.enumList)! as List) - .cast(), - objectList: (_PigeonJniCodec.readValue(jniClass.objectList)! as List) - .cast(), - listList: (_PigeonJniCodec.readValue(jniClass.listList)! as List) - .cast>(), - mapList: (_PigeonJniCodec.readValue(jniClass.mapList)! as List) - .cast>(), - map: (_PigeonJniCodec.readValue(jniClass.map)! as Map) - .cast(), - stringMap: (_PigeonJniCodec.readValue(jniClass.stringMap)! as Map) - .cast(), - intMap: (_PigeonJniCodec.readValue(jniClass.intMap)! as Map) - .cast(), - enumMap: (_PigeonJniCodec.readValue(jniClass.enumMap)! as Map) - .cast(), - objectMap: (_PigeonJniCodec.readValue(jniClass.objectMap)! as Map) - .cast(), - listMap: (_PigeonJniCodec.readValue(jniClass.listMap)! as Map) - .cast>(), - mapMap: (_PigeonJniCodec.readValue(jniClass.mapMap)! as Map) - .cast>(), - ); - } - - static NativeInteropAllTypes? fromFfi(ffi_bridge.NativeInteropAllTypesBridge? ffiClass) { - return ffiClass == null - ? null - : NativeInteropAllTypes( - aBool: ffiClass.aBool, - anInt: ffiClass.anInt, - anInt64: ffiClass.anInt64, - aDouble: ffiClass.aDouble, - aByteArray: _PigeonFfiCodec.readValue(ffiClass.aByteArray)! as Uint8List, - a4ByteArray: _PigeonFfiCodec.readValue(ffiClass.a4ByteArray)! as Int32List, - a8ByteArray: _PigeonFfiCodec.readValue(ffiClass.a8ByteArray)! as Int64List, - aFloatArray: _PigeonFfiCodec.readValue(ffiClass.aFloatArray)! as Float64List, - anEnum: NativeInteropAnEnum.values[ffiClass.anEnum.index], - anotherEnum: NativeInteropAnotherEnum.values[ffiClass.anotherEnum.index], - aString: ffiClass.aString.toDartString(), - anObject: _PigeonFfiCodec.readValue(ffiClass.anObject)!, - list: (_PigeonFfiCodec.readValue(ffiClass.list)! as List).cast(), - stringList: (_PigeonFfiCodec.readValue(ffiClass.stringList)! as List) - .cast(), - intList: (_PigeonFfiCodec.readValue(ffiClass.intList, int)! as List) - .cast(), - doubleList: (_PigeonFfiCodec.readValue(ffiClass.doubleList, double)! as List) - .cast(), - boolList: (_PigeonFfiCodec.readValue(ffiClass.boolList, bool)! as List) - .cast(), - enumList: - (_PigeonFfiCodec.readValue(ffiClass.enumList, NativeInteropAnEnum)! - as List) - .cast(), - objectList: (_PigeonFfiCodec.readValue(ffiClass.objectList)! as List) - .cast(), - listList: (_PigeonFfiCodec.readValue(ffiClass.listList)! as List) - .cast>(), - mapList: (_PigeonFfiCodec.readValue(ffiClass.mapList)! as List) - .cast>(), - map: (_PigeonFfiCodec.readValue(ffiClass.map)! as Map) - .cast(), - stringMap: (_PigeonFfiCodec.readValue(ffiClass.stringMap)! as Map) - .cast(), - intMap: (_PigeonFfiCodec.readValue(ffiClass.intMap, int, int)! as Map) - .cast(), - enumMap: - (_PigeonFfiCodec.readValue( - ffiClass.enumMap, - NativeInteropAnEnum, - NativeInteropAnEnum, - )! - as Map) - .cast(), - objectMap: (_PigeonFfiCodec.readValue(ffiClass.objectMap)! as Map) - .cast(), - listMap: (_PigeonFfiCodec.readValue(ffiClass.listMap, int)! as Map) - .cast>(), - mapMap: (_PigeonFfiCodec.readValue(ffiClass.mapMap, int)! as Map) - .cast>(), - ); - } - static NativeInteropAllTypes decode(Object result) { result as List; return NativeInteropAllTypes( @@ -1763,237 +501,10 @@ class NativeInteropAllNullableTypes { ]; } - jni_bridge.NativeInteropAllNullableTypes toJni() { - return jni_bridge.NativeInteropAllNullableTypes( - _PigeonJniCodec.writeValue(aNullableBool), - _PigeonJniCodec.writeValue(aNullableInt), - _PigeonJniCodec.writeValue(aNullableInt64), - _PigeonJniCodec.writeValue(aNullableDouble), - _PigeonJniCodec.writeValue(aNullableByteArray), - _PigeonJniCodec.writeValue(aNullable4ByteArray), - _PigeonJniCodec.writeValue(aNullable8ByteArray), - _PigeonJniCodec.writeValue(aNullableFloatArray), - aNullableEnum?.toJni(), - anotherNullableEnum?.toJni(), - _PigeonJniCodec.writeValue(aNullableString), - _PigeonJniCodec.writeValue(aNullableObject), - allNullableTypes?.toJni(), - _PigeonJniCodec.writeValue?>(list), - _PigeonJniCodec.writeValue?>(stringList), - _PigeonJniCodec.writeValue?>(intList), - _PigeonJniCodec.writeValue?>(doubleList), - _PigeonJniCodec.writeValue?>(boolList), - _PigeonJniCodec.writeValue?>(enumList), - _PigeonJniCodec.writeValue?>(objectList), - _PigeonJniCodec.writeValue?>?>(listList), - _PigeonJniCodec.writeValue?>?>(mapList), - _PigeonJniCodec.writeValue?>( - recursiveClassList, - ), - _PigeonJniCodec.writeValue?>(map), - _PigeonJniCodec.writeValue?>(stringMap), - _PigeonJniCodec.writeValue?>(intMap), - _PigeonJniCodec.writeValue< - JMap? - >(enumMap), - _PigeonJniCodec.writeValue?>(objectMap), - _PigeonJniCodec.writeValue?>?>(listMap), - _PigeonJniCodec.writeValue?>?>(mapMap), - _PigeonJniCodec.writeValue?>( - recursiveClassMap, - ), - ); - } - - ffi_bridge.NativeInteropAllNullableTypesBridge toFfi() { - return ffi_bridge.NativeInteropAllNullableTypesBridge.alloc().initWithANullableBool( - _PigeonFfiCodec.writeValue(aNullableBool), - aNullableInt: _PigeonFfiCodec.writeValue(aNullableInt), - aNullableInt64: _PigeonFfiCodec.writeValue(aNullableInt64), - aNullableDouble: _PigeonFfiCodec.writeValue(aNullableDouble), - aNullableByteArray: _PigeonFfiCodec.writeValue( - aNullableByteArray, - ), - aNullable4ByteArray: - _PigeonFfiCodec.writeValue( - aNullable4ByteArray, - ), - aNullable8ByteArray: - _PigeonFfiCodec.writeValue( - aNullable8ByteArray, - ), - aNullableFloatArray: - _PigeonFfiCodec.writeValue( - aNullableFloatArray, - ), - aNullableEnum: _PigeonFfiCodec.writeValue(aNullableEnum?.index), - anotherNullableEnum: _PigeonFfiCodec.writeValue(anotherNullableEnum?.index), - aNullableString: _PigeonFfiCodec.writeValue(aNullableString), - aNullableObject: _PigeonFfiCodec.writeValue(aNullableObject, generic: true), - allNullableTypes: allNullableTypes?.toFfi(), - list: _PigeonFfiCodec.writeValue(list), - stringList: _PigeonFfiCodec.writeValue(stringList), - intList: _PigeonFfiCodec.writeValue(intList), - doubleList: _PigeonFfiCodec.writeValue(doubleList), - boolList: _PigeonFfiCodec.writeValue(boolList), - enumList: _PigeonFfiCodec.writeValue(enumList), - objectList: _PigeonFfiCodec.writeValue(objectList), - listList: _PigeonFfiCodec.writeValue(listList), - mapList: _PigeonFfiCodec.writeValue(mapList), - recursiveClassList: _PigeonFfiCodec.writeValue(recursiveClassList), - map: _PigeonFfiCodec.writeValue(map), - stringMap: _PigeonFfiCodec.writeValue(stringMap), - intMap: _PigeonFfiCodec.writeValue(intMap), - enumMap: _PigeonFfiCodec.writeValue(enumMap), - objectMap: _PigeonFfiCodec.writeValue(objectMap), - listMap: _PigeonFfiCodec.writeValue(listMap), - mapMap: _PigeonFfiCodec.writeValue(mapMap), - recursiveClassMap: _PigeonFfiCodec.writeValue(recursiveClassMap), - ); - } - Object encode() { return _toList(); } - static NativeInteropAllNullableTypes? fromJni( - jni_bridge.NativeInteropAllNullableTypes? jniClass, - ) { - return jniClass == null - ? null - : NativeInteropAllNullableTypes( - aNullableBool: jniClass.aNullableBool?.toDartBool(releaseOriginal: true), - aNullableInt: jniClass.aNullableInt?.toDartInt(releaseOriginal: true), - aNullableInt64: jniClass.aNullableInt64?.toDartInt(releaseOriginal: true), - aNullableDouble: jniClass.aNullableDouble?.toDartDouble(releaseOriginal: true), - aNullableByteArray: - _PigeonJniCodec.readValue(jniClass.aNullableByteArray) as Uint8List?, - aNullable4ByteArray: - _PigeonJniCodec.readValue(jniClass.aNullable4ByteArray) as Int32List?, - aNullable8ByteArray: - _PigeonJniCodec.readValue(jniClass.aNullable8ByteArray) as Int64List?, - aNullableFloatArray: - _PigeonJniCodec.readValue(jniClass.aNullableFloatArray) as Float64List?, - aNullableEnum: NativeInteropAnEnum.fromJni(jniClass.aNullableEnum), - anotherNullableEnum: NativeInteropAnotherEnum.fromJni(jniClass.anotherNullableEnum), - aNullableString: jniClass.aNullableString?.toDartString(releaseOriginal: true), - aNullableObject: _PigeonJniCodec.readValue(jniClass.aNullableObject), - allNullableTypes: NativeInteropAllNullableTypes.fromJni(jniClass.allNullableTypes), - list: (_PigeonJniCodec.readValue(jniClass.list) as List?)?.cast(), - stringList: (_PigeonJniCodec.readValue(jniClass.stringList) as List?) - ?.cast(), - intList: (_PigeonJniCodec.readValue(jniClass.intList) as List?)?.cast(), - doubleList: (_PigeonJniCodec.readValue(jniClass.doubleList) as List?) - ?.cast(), - boolList: (_PigeonJniCodec.readValue(jniClass.boolList) as List?) - ?.cast(), - enumList: (_PigeonJniCodec.readValue(jniClass.enumList) as List?) - ?.cast(), - objectList: (_PigeonJniCodec.readValue(jniClass.objectList) as List?) - ?.cast(), - listList: (_PigeonJniCodec.readValue(jniClass.listList) as List?) - ?.cast?>(), - mapList: (_PigeonJniCodec.readValue(jniClass.mapList) as List?) - ?.cast?>(), - recursiveClassList: - (_PigeonJniCodec.readValue(jniClass.recursiveClassList) as List?) - ?.cast(), - map: (_PigeonJniCodec.readValue(jniClass.map) as Map?) - ?.cast(), - stringMap: (_PigeonJniCodec.readValue(jniClass.stringMap) as Map?) - ?.cast(), - intMap: (_PigeonJniCodec.readValue(jniClass.intMap) as Map?) - ?.cast(), - enumMap: (_PigeonJniCodec.readValue(jniClass.enumMap) as Map?) - ?.cast(), - objectMap: (_PigeonJniCodec.readValue(jniClass.objectMap) as Map?) - ?.cast(), - listMap: (_PigeonJniCodec.readValue(jniClass.listMap) as Map?) - ?.cast?>(), - mapMap: (_PigeonJniCodec.readValue(jniClass.mapMap) as Map?) - ?.cast?>(), - recursiveClassMap: - (_PigeonJniCodec.readValue(jniClass.recursiveClassMap) as Map?) - ?.cast(), - ); - } - - static NativeInteropAllNullableTypes? fromFfi( - ffi_bridge.NativeInteropAllNullableTypesBridge? ffiClass, - ) { - return ffiClass == null - ? null - : NativeInteropAllNullableTypes( - aNullableBool: ffiClass.aNullableBool?.boolValue, - aNullableInt: ffiClass.aNullableInt?.longValue, - aNullableInt64: ffiClass.aNullableInt64?.longValue, - aNullableDouble: ffiClass.aNullableDouble?.doubleValue, - aNullableByteArray: - _PigeonFfiCodec.readValue(ffiClass.aNullableByteArray) as Uint8List?, - aNullable4ByteArray: - _PigeonFfiCodec.readValue(ffiClass.aNullable4ByteArray) as Int32List?, - aNullable8ByteArray: - _PigeonFfiCodec.readValue(ffiClass.aNullable8ByteArray) as Int64List?, - aNullableFloatArray: - _PigeonFfiCodec.readValue(ffiClass.aNullableFloatArray) as Float64List?, - aNullableEnum: ffiClass.aNullableEnum == null - ? null - : NativeInteropAnEnum.values[ffiClass.aNullableEnum!.longValue], - anotherNullableEnum: ffiClass.anotherNullableEnum == null - ? null - : NativeInteropAnotherEnum.values[ffiClass.anotherNullableEnum!.longValue], - aNullableString: ffiClass.aNullableString?.toDartString(), - aNullableObject: _PigeonFfiCodec.readValue(ffiClass.aNullableObject), - allNullableTypes: NativeInteropAllNullableTypes.fromFfi(ffiClass.allNullableTypes), - list: (_PigeonFfiCodec.readValue(ffiClass.list) as List?)?.cast(), - stringList: (_PigeonFfiCodec.readValue(ffiClass.stringList) as List?) - ?.cast(), - intList: (_PigeonFfiCodec.readValue(ffiClass.intList, int) as List?) - ?.cast(), - doubleList: (_PigeonFfiCodec.readValue(ffiClass.doubleList, double) as List?) - ?.cast(), - boolList: (_PigeonFfiCodec.readValue(ffiClass.boolList, bool) as List?) - ?.cast(), - enumList: - (_PigeonFfiCodec.readValue(ffiClass.enumList, NativeInteropAnEnum) - as List?) - ?.cast(), - objectList: (_PigeonFfiCodec.readValue(ffiClass.objectList) as List?) - ?.cast(), - listList: (_PigeonFfiCodec.readValue(ffiClass.listList) as List?) - ?.cast?>(), - mapList: (_PigeonFfiCodec.readValue(ffiClass.mapList) as List?) - ?.cast?>(), - recursiveClassList: - (_PigeonFfiCodec.readValue(ffiClass.recursiveClassList) as List?) - ?.cast(), - map: (_PigeonFfiCodec.readValue(ffiClass.map) as Map?) - ?.cast(), - stringMap: (_PigeonFfiCodec.readValue(ffiClass.stringMap) as Map?) - ?.cast(), - intMap: (_PigeonFfiCodec.readValue(ffiClass.intMap, int, int) as Map?) - ?.cast(), - enumMap: - (_PigeonFfiCodec.readValue( - ffiClass.enumMap, - NativeInteropAnEnum, - NativeInteropAnEnum, - ) - as Map?) - ?.cast(), - objectMap: (_PigeonFfiCodec.readValue(ffiClass.objectMap) as Map?) - ?.cast(), - listMap: (_PigeonFfiCodec.readValue(ffiClass.listMap, int) as Map?) - ?.cast?>(), - mapMap: (_PigeonFfiCodec.readValue(ffiClass.mapMap, int) as Map?) - ?.cast?>(), - recursiveClassMap: - (_PigeonFfiCodec.readValue(ffiClass.recursiveClassMap, int) - as Map?) - ?.cast(), - ); - } - static NativeInteropAllNullableTypes decode(Object result) { result as List; return NativeInteropAllNullableTypes( @@ -2213,218 +724,10 @@ class NativeInteropAllNullableTypesWithoutRecursion { ]; } - jni_bridge.NativeInteropAllNullableTypesWithoutRecursion toJni() { - return jni_bridge.NativeInteropAllNullableTypesWithoutRecursion( - _PigeonJniCodec.writeValue(aNullableBool), - _PigeonJniCodec.writeValue(aNullableInt), - _PigeonJniCodec.writeValue(aNullableInt64), - _PigeonJniCodec.writeValue(aNullableDouble), - _PigeonJniCodec.writeValue(aNullableByteArray), - _PigeonJniCodec.writeValue(aNullable4ByteArray), - _PigeonJniCodec.writeValue(aNullable8ByteArray), - _PigeonJniCodec.writeValue(aNullableFloatArray), - aNullableEnum?.toJni(), - anotherNullableEnum?.toJni(), - _PigeonJniCodec.writeValue(aNullableString), - _PigeonJniCodec.writeValue(aNullableObject), - _PigeonJniCodec.writeValue(type), - _PigeonJniCodec.writeValue?>(list), - _PigeonJniCodec.writeValue?>(stringList), - _PigeonJniCodec.writeValue?>(intList), - _PigeonJniCodec.writeValue?>(doubleList), - _PigeonJniCodec.writeValue?>(boolList), - _PigeonJniCodec.writeValue?>(enumList), - _PigeonJniCodec.writeValue?>(objectList), - _PigeonJniCodec.writeValue?>?>(listList), - _PigeonJniCodec.writeValue?>?>(mapList), - _PigeonJniCodec.writeValue?>(map), - _PigeonJniCodec.writeValue?>(stringMap), - _PigeonJniCodec.writeValue?>(intMap), - _PigeonJniCodec.writeValue< - JMap? - >(enumMap), - _PigeonJniCodec.writeValue?>(objectMap), - _PigeonJniCodec.writeValue?>?>(listMap), - _PigeonJniCodec.writeValue?>?>(mapMap), - ); - } - - ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge toFfi() { - return ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge.alloc() - .initWithANullableBool( - _PigeonFfiCodec.writeValue(aNullableBool), - aNullableInt: _PigeonFfiCodec.writeValue(aNullableInt), - aNullableInt64: _PigeonFfiCodec.writeValue(aNullableInt64), - aNullableDouble: _PigeonFfiCodec.writeValue(aNullableDouble), - aNullableByteArray: - _PigeonFfiCodec.writeValue( - aNullableByteArray, - ), - aNullable4ByteArray: - _PigeonFfiCodec.writeValue( - aNullable4ByteArray, - ), - aNullable8ByteArray: - _PigeonFfiCodec.writeValue( - aNullable8ByteArray, - ), - aNullableFloatArray: - _PigeonFfiCodec.writeValue( - aNullableFloatArray, - ), - aNullableEnum: _PigeonFfiCodec.writeValue(aNullableEnum?.index), - anotherNullableEnum: _PigeonFfiCodec.writeValue(anotherNullableEnum?.index), - aNullableString: _PigeonFfiCodec.writeValue(aNullableString), - aNullableObject: _PigeonFfiCodec.writeValue(aNullableObject, generic: true), - type: _PigeonFfiCodec.writeValue(type), - list: _PigeonFfiCodec.writeValue(list), - stringList: _PigeonFfiCodec.writeValue(stringList), - intList: _PigeonFfiCodec.writeValue(intList), - doubleList: _PigeonFfiCodec.writeValue(doubleList), - boolList: _PigeonFfiCodec.writeValue(boolList), - enumList: _PigeonFfiCodec.writeValue(enumList), - objectList: _PigeonFfiCodec.writeValue(objectList), - listList: _PigeonFfiCodec.writeValue(listList), - mapList: _PigeonFfiCodec.writeValue(mapList), - map: _PigeonFfiCodec.writeValue(map), - stringMap: _PigeonFfiCodec.writeValue(stringMap), - intMap: _PigeonFfiCodec.writeValue(intMap), - enumMap: _PigeonFfiCodec.writeValue(enumMap), - objectMap: _PigeonFfiCodec.writeValue(objectMap), - listMap: _PigeonFfiCodec.writeValue(listMap), - mapMap: _PigeonFfiCodec.writeValue(mapMap), - ); - } - Object encode() { return _toList(); } - static NativeInteropAllNullableTypesWithoutRecursion? fromJni( - jni_bridge.NativeInteropAllNullableTypesWithoutRecursion? jniClass, - ) { - return jniClass == null - ? null - : NativeInteropAllNullableTypesWithoutRecursion( - aNullableBool: jniClass.aNullableBool?.toDartBool(releaseOriginal: true), - aNullableInt: jniClass.aNullableInt?.toDartInt(releaseOriginal: true), - aNullableInt64: jniClass.aNullableInt64?.toDartInt(releaseOriginal: true), - aNullableDouble: jniClass.aNullableDouble?.toDartDouble(releaseOriginal: true), - aNullableByteArray: - _PigeonJniCodec.readValue(jniClass.aNullableByteArray) as Uint8List?, - aNullable4ByteArray: - _PigeonJniCodec.readValue(jniClass.aNullable4ByteArray) as Int32List?, - aNullable8ByteArray: - _PigeonJniCodec.readValue(jniClass.aNullable8ByteArray) as Int64List?, - aNullableFloatArray: - _PigeonJniCodec.readValue(jniClass.aNullableFloatArray) as Float64List?, - aNullableEnum: NativeInteropAnEnum.fromJni(jniClass.aNullableEnum), - anotherNullableEnum: NativeInteropAnotherEnum.fromJni(jniClass.anotherNullableEnum), - aNullableString: jniClass.aNullableString?.toDartString(releaseOriginal: true), - aNullableObject: _PigeonJniCodec.readValue(jniClass.aNullableObject), - type: jniClass.type$1?.toDartInt(releaseOriginal: true), - list: (_PigeonJniCodec.readValue(jniClass.list) as List?)?.cast(), - stringList: (_PigeonJniCodec.readValue(jniClass.stringList) as List?) - ?.cast(), - intList: (_PigeonJniCodec.readValue(jniClass.intList) as List?)?.cast(), - doubleList: (_PigeonJniCodec.readValue(jniClass.doubleList) as List?) - ?.cast(), - boolList: (_PigeonJniCodec.readValue(jniClass.boolList) as List?) - ?.cast(), - enumList: (_PigeonJniCodec.readValue(jniClass.enumList) as List?) - ?.cast(), - objectList: (_PigeonJniCodec.readValue(jniClass.objectList) as List?) - ?.cast(), - listList: (_PigeonJniCodec.readValue(jniClass.listList) as List?) - ?.cast?>(), - mapList: (_PigeonJniCodec.readValue(jniClass.mapList) as List?) - ?.cast?>(), - map: (_PigeonJniCodec.readValue(jniClass.map) as Map?) - ?.cast(), - stringMap: (_PigeonJniCodec.readValue(jniClass.stringMap) as Map?) - ?.cast(), - intMap: (_PigeonJniCodec.readValue(jniClass.intMap) as Map?) - ?.cast(), - enumMap: (_PigeonJniCodec.readValue(jniClass.enumMap) as Map?) - ?.cast(), - objectMap: (_PigeonJniCodec.readValue(jniClass.objectMap) as Map?) - ?.cast(), - listMap: (_PigeonJniCodec.readValue(jniClass.listMap) as Map?) - ?.cast?>(), - mapMap: (_PigeonJniCodec.readValue(jniClass.mapMap) as Map?) - ?.cast?>(), - ); - } - - static NativeInteropAllNullableTypesWithoutRecursion? fromFfi( - ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge? ffiClass, - ) { - return ffiClass == null - ? null - : NativeInteropAllNullableTypesWithoutRecursion( - aNullableBool: ffiClass.aNullableBool?.boolValue, - aNullableInt: ffiClass.aNullableInt?.longValue, - aNullableInt64: ffiClass.aNullableInt64?.longValue, - aNullableDouble: ffiClass.aNullableDouble?.doubleValue, - aNullableByteArray: - _PigeonFfiCodec.readValue(ffiClass.aNullableByteArray) as Uint8List?, - aNullable4ByteArray: - _PigeonFfiCodec.readValue(ffiClass.aNullable4ByteArray) as Int32List?, - aNullable8ByteArray: - _PigeonFfiCodec.readValue(ffiClass.aNullable8ByteArray) as Int64List?, - aNullableFloatArray: - _PigeonFfiCodec.readValue(ffiClass.aNullableFloatArray) as Float64List?, - aNullableEnum: ffiClass.aNullableEnum == null - ? null - : NativeInteropAnEnum.values[ffiClass.aNullableEnum!.longValue], - anotherNullableEnum: ffiClass.anotherNullableEnum == null - ? null - : NativeInteropAnotherEnum.values[ffiClass.anotherNullableEnum!.longValue], - aNullableString: ffiClass.aNullableString?.toDartString(), - aNullableObject: _PigeonFfiCodec.readValue(ffiClass.aNullableObject), - type: ffiClass.type?.longValue, - list: (_PigeonFfiCodec.readValue(ffiClass.list) as List?)?.cast(), - stringList: (_PigeonFfiCodec.readValue(ffiClass.stringList) as List?) - ?.cast(), - intList: (_PigeonFfiCodec.readValue(ffiClass.intList, int) as List?) - ?.cast(), - doubleList: (_PigeonFfiCodec.readValue(ffiClass.doubleList, double) as List?) - ?.cast(), - boolList: (_PigeonFfiCodec.readValue(ffiClass.boolList, bool) as List?) - ?.cast(), - enumList: - (_PigeonFfiCodec.readValue(ffiClass.enumList, NativeInteropAnEnum) - as List?) - ?.cast(), - objectList: (_PigeonFfiCodec.readValue(ffiClass.objectList) as List?) - ?.cast(), - listList: (_PigeonFfiCodec.readValue(ffiClass.listList) as List?) - ?.cast?>(), - mapList: (_PigeonFfiCodec.readValue(ffiClass.mapList) as List?) - ?.cast?>(), - map: (_PigeonFfiCodec.readValue(ffiClass.map) as Map?) - ?.cast(), - stringMap: (_PigeonFfiCodec.readValue(ffiClass.stringMap) as Map?) - ?.cast(), - intMap: (_PigeonFfiCodec.readValue(ffiClass.intMap, int, int) as Map?) - ?.cast(), - enumMap: - (_PigeonFfiCodec.readValue( - ffiClass.enumMap, - NativeInteropAnEnum, - NativeInteropAnEnum, - ) - as Map?) - ?.cast(), - objectMap: (_PigeonFfiCodec.readValue(ffiClass.objectMap) as Map?) - ?.cast(), - listMap: (_PigeonFfiCodec.readValue(ffiClass.listMap, int) as Map?) - ?.cast?>(), - mapMap: (_PigeonFfiCodec.readValue(ffiClass.mapMap, int) as Map?) - ?.cast?>(), - ); - } - static NativeInteropAllNullableTypesWithoutRecursion decode(Object result) { result as List; return NativeInteropAllNullableTypesWithoutRecursion( @@ -2554,87 +857,10 @@ class NativeInteropAllClassesWrapper { ]; } - jni_bridge.NativeInteropAllClassesWrapper toJni() { - return jni_bridge.NativeInteropAllClassesWrapper( - allNullableTypes.toJni(), - allNullableTypesWithoutRecursion?.toJni(), - allTypes?.toJni(), - _PigeonJniCodec.writeValue>(classList), - _PigeonJniCodec.writeValue?>( - nullableClassList, - ), - _PigeonJniCodec.writeValue>(classMap), - _PigeonJniCodec.writeValue< - JMap? - >(nullableClassMap), - ); - } - - ffi_bridge.NativeInteropAllClassesWrapperBridge toFfi() { - return ffi_bridge.NativeInteropAllClassesWrapperBridge.alloc().initWithAllNullableTypes( - allNullableTypes.toFfi(), - allNullableTypesWithoutRecursion: allNullableTypesWithoutRecursion?.toFfi(), - allTypes: allTypes?.toFfi(), - classList: _PigeonFfiCodec.writeValue(classList), - nullableClassList: _PigeonFfiCodec.writeValue(nullableClassList), - classMap: _PigeonFfiCodec.writeValue(classMap), - nullableClassMap: _PigeonFfiCodec.writeValue(nullableClassMap), - ); - } - Object encode() { return _toList(); } - static NativeInteropAllClassesWrapper? fromJni( - jni_bridge.NativeInteropAllClassesWrapper? jniClass, - ) { - return jniClass == null - ? null - : NativeInteropAllClassesWrapper( - allNullableTypes: NativeInteropAllNullableTypes.fromJni(jniClass.allNullableTypes)!, - allNullableTypesWithoutRecursion: NativeInteropAllNullableTypesWithoutRecursion.fromJni( - jniClass.allNullableTypesWithoutRecursion, - ), - allTypes: NativeInteropAllTypes.fromJni(jniClass.allTypes), - classList: (_PigeonJniCodec.readValue(jniClass.classList)! as List) - .cast(), - nullableClassList: - (_PigeonJniCodec.readValue(jniClass.nullableClassList) as List?) - ?.cast(), - classMap: (_PigeonJniCodec.readValue(jniClass.classMap)! as Map) - .cast(), - nullableClassMap: - (_PigeonJniCodec.readValue(jniClass.nullableClassMap) as Map?) - ?.cast(), - ); - } - - static NativeInteropAllClassesWrapper? fromFfi( - ffi_bridge.NativeInteropAllClassesWrapperBridge? ffiClass, - ) { - return ffiClass == null - ? null - : NativeInteropAllClassesWrapper( - allNullableTypes: NativeInteropAllNullableTypes.fromFfi(ffiClass.allNullableTypes)!, - allNullableTypesWithoutRecursion: NativeInteropAllNullableTypesWithoutRecursion.fromFfi( - ffiClass.allNullableTypesWithoutRecursion, - ), - allTypes: NativeInteropAllTypes.fromFfi(ffiClass.allTypes), - classList: (_PigeonFfiCodec.readValue(ffiClass.classList)! as List) - .cast(), - nullableClassList: - (_PigeonFfiCodec.readValue(ffiClass.nullableClassList) as List?) - ?.cast(), - classMap: (_PigeonFfiCodec.readValue(ffiClass.classMap, int)! as Map) - .cast(), - nullableClassMap: - (_PigeonFfiCodec.readValue(ffiClass.nullableClassMap, int) - as Map?) - ?.cast(), - ); - } - static NativeInteropAllClassesWrapper decode(Object result) { result as List; return NativeInteropAllClassesWrapper( @@ -2679,49 +905,7 @@ class NativeInteropAllClassesWrapper { } /// A sealed class, to test sealed class handling. -sealed class NativeInteropSealedClass { - jni_bridge.NativeInteropSealedClass toJni(); - - static NativeInteropSealedClass? fromJni(jni_bridge.NativeInteropSealedClass? jniClass) { - if (jniClass == null) { - return null; - } - if (jniClass.isA( - jni_bridge.NativeInteropSealedClassWithFields.type, - )) { - return NativeInteropSealedClassWithFields.fromJni( - jniClass.as(jni_bridge.NativeInteropSealedClassWithFields.type), - ); - } - if (jniClass.isA( - jni_bridge.NativeInteropEmptySealedClass.type, - )) { - return NativeInteropEmptySealedClass.fromJni( - jniClass.as(jni_bridge.NativeInteropEmptySealedClass.type), - ); - } - throw ArgumentError.value(jniClass); - } - - ffi_bridge.NativeInteropSealedClassBridge toFfi(); - - static NativeInteropSealedClass? fromFfi(ffi_bridge.NativeInteropSealedClassBridge? ffiClass) { - if (ffiClass == null) { - return null; - } - if (ffi_bridge.NativeInteropSealedClassWithFieldsBridge.isA(ffiClass)) { - return NativeInteropSealedClassWithFields.fromFfi( - ffi_bridge.NativeInteropSealedClassWithFieldsBridge.as(ffiClass), - ); - } - if (ffi_bridge.NativeInteropEmptySealedClassBridge.isA(ffiClass)) { - return NativeInteropEmptySealedClass.fromFfi( - ffi_bridge.NativeInteropEmptySealedClassBridge.as(ffiClass), - ); - } - throw ArgumentError.value(ffiClass); - } -} +sealed class NativeInteropSealedClass {} /// A subclass of `NativeInteropSealedClass` with fields. class NativeInteropSealedClassWithFields extends NativeInteropSealedClass { @@ -2744,56 +928,10 @@ class NativeInteropSealedClassWithFields extends NativeInteropSealedClass { return [aString, aNullableInt, anEnum, aClass]; } - @override - jni_bridge.NativeInteropSealedClassWithFields toJni() { - return jni_bridge.NativeInteropSealedClassWithFields( - _PigeonJniCodec.writeValue(aString), - _PigeonJniCodec.writeValue(aNullableInt), - anEnum.toJni(), - aClass?.toJni(), - ); - } - - @override - ffi_bridge.NativeInteropSealedClassWithFieldsBridge toFfi() { - return ffi_bridge.NativeInteropSealedClassWithFieldsBridge.alloc().initWithAString( - _PigeonFfiCodec.writeValue(aString), - aNullableInt: _PigeonFfiCodec.writeValue(aNullableInt), - anEnum: ffi_bridge.NativeInteropAnEnum.values[anEnum.index], - aClass: aClass?.toFfi(), - ); - } - Object encode() { return _toList(); } - static NativeInteropSealedClassWithFields? fromJni( - jni_bridge.NativeInteropSealedClassWithFields? jniClass, - ) { - return jniClass == null - ? null - : NativeInteropSealedClassWithFields( - aString: jniClass.aString.toDartString(releaseOriginal: true), - aNullableInt: jniClass.aNullableInt?.toDartInt(releaseOriginal: true), - anEnum: NativeInteropAnEnum.fromJni(jniClass.anEnum)!, - aClass: NativeInteropAllNullableTypesWithoutRecursion.fromJni(jniClass.aClass), - ); - } - - static NativeInteropSealedClassWithFields? fromFfi( - ffi_bridge.NativeInteropSealedClassWithFieldsBridge? ffiClass, - ) { - return ffiClass == null - ? null - : NativeInteropSealedClassWithFields( - aString: ffiClass.aString.toDartString(), - aNullableInt: ffiClass.aNullableInt?.longValue, - anEnum: NativeInteropAnEnum.values[ffiClass.anEnum.index], - aClass: NativeInteropAllNullableTypesWithoutRecursion.fromFfi(ffiClass.aClass), - ); - } - static NativeInteropSealedClassWithFields decode(Object result) { result as List; return NativeInteropSealedClassWithFields( @@ -2837,32 +975,10 @@ class NativeInteropEmptySealedClass extends NativeInteropSealedClass { return []; } - @override - jni_bridge.NativeInteropEmptySealedClass toJni() { - return jni_bridge.NativeInteropEmptySealedClass(); - } - - @override - ffi_bridge.NativeInteropEmptySealedClassBridge toFfi() { - return ffi_bridge.NativeInteropEmptySealedClassBridge.alloc().init(); - } - Object encode() { return _toList(); } - static NativeInteropEmptySealedClass? fromJni( - jni_bridge.NativeInteropEmptySealedClass? jniClass, - ) { - return jniClass == null ? null : NativeInteropEmptySealedClass(); - } - - static NativeInteropEmptySealedClass? fromFfi( - ffi_bridge.NativeInteropEmptySealedClassBridge? ffiClass, - ) { - return ffiClass == null ? null : NativeInteropEmptySealedClass(); - } - static NativeInteropEmptySealedClass decode(Object result) { result as List; return NativeInteropEmptySealedClass(); @@ -2906,52 +1022,10 @@ class NativeInteropSealedClassWrapper { return [sealedClass, nullableSealedClass, sealedClassList]; } - jni_bridge.NativeInteropSealedClassWrapper toJni() { - return jni_bridge.NativeInteropSealedClassWrapper( - sealedClass.toJni(), - nullableSealedClass?.toJni(), - _PigeonJniCodec.writeValue>(sealedClassList), - ); - } - - ffi_bridge.NativeInteropSealedClassWrapperBridge toFfi() { - return ffi_bridge.NativeInteropSealedClassWrapperBridge.alloc().initWithSealedClass( - sealedClass.toFfi(), - nullableSealedClass: nullableSealedClass?.toFfi(), - sealedClassList: _PigeonFfiCodec.writeValue(sealedClassList), - ); - } - Object encode() { return _toList(); } - static NativeInteropSealedClassWrapper? fromJni( - jni_bridge.NativeInteropSealedClassWrapper? jniClass, - ) { - return jniClass == null - ? null - : NativeInteropSealedClassWrapper( - sealedClass: NativeInteropSealedClass.fromJni(jniClass.sealedClass)!, - nullableSealedClass: NativeInteropSealedClass.fromJni(jniClass.nullableSealedClass), - sealedClassList: (_PigeonJniCodec.readValue(jniClass.sealedClassList)! as List) - .cast(), - ); - } - - static NativeInteropSealedClassWrapper? fromFfi( - ffi_bridge.NativeInteropSealedClassWrapperBridge? ffiClass, - ) { - return ffiClass == null - ? null - : NativeInteropSealedClassWrapper( - sealedClass: NativeInteropSealedClass.fromFfi(ffiClass.sealedClass)!, - nullableSealedClass: NativeInteropSealedClass.fromFfi(ffiClass.nullableSealedClass), - sealedClassList: (_PigeonFfiCodec.readValue(ffiClass.sealedClassList)! as List) - .cast(), - ); - } - static NativeInteropSealedClassWrapper decode(Object result) { result as List; return NativeInteropSealedClassWrapper( @@ -3055,90 +1129,8 @@ class NativeInteropReservedNames { ]; } - jni_bridge.NativeInteropReservedNames toJni() { - return jni_bridge.NativeInteropReservedNames( - _PigeonJniCodec.writeValue(type), - _PigeonJniCodec.writeValue(use), - _PigeonJniCodec.writeValue(reference), - _PigeonJniCodec.writeValue(releasedBy), - _PigeonJniCodec.writeValue(fromReference), - _PigeonJniCodec.writeValue(jClass), - _PigeonJniCodec.writeValue(isInstanceOf), - _PigeonJniCodec.writeValue(isNull), - isReleased, - _PigeonJniCodec.writeValue(equals), - isEnabled, - _PigeonJniCodec.writeValue(isMaybe), - _PigeonJniCodec.writeValue(isCount), - _PigeonJniCodec.writeValue(getValue), - ); - } - - ffi_bridge.NativeInteropReservedNamesBridge toFfi() { - return ffi_bridge.NativeInteropReservedNamesBridge.alloc().initWithType( - _PigeonFfiCodec.writeValue(type), - use: _PigeonFfiCodec.writeValue(use), - reference: _PigeonFfiCodec.writeValue(reference), - releasedBy: _PigeonFfiCodec.writeValue(releasedBy), - fromReference: _PigeonFfiCodec.writeValue(fromReference), - jClass: _PigeonFfiCodec.writeValue(jClass), - isInstanceOf: _PigeonFfiCodec.writeValue(isInstanceOf), - isNull: _PigeonFfiCodec.writeValue(isNull), - isReleased: isReleased, - equals: _PigeonFfiCodec.writeValue(equals), - isEnabled: isEnabled, - isMaybe: _PigeonFfiCodec.writeValue(isMaybe), - isCount: _PigeonFfiCodec.writeValue(isCount), - getValue: _PigeonFfiCodec.writeValue(getValue), - ); - } - - Object encode() { - return _toList(); - } - - static NativeInteropReservedNames? fromJni(jni_bridge.NativeInteropReservedNames? jniClass) { - return jniClass == null - ? null - : NativeInteropReservedNames( - type: jniClass.type$1?.toDartString(releaseOriginal: true), - use: jniClass.use$1?.toDartString(releaseOriginal: true), - reference: jniClass.reference$1?.toDartString(releaseOriginal: true), - releasedBy: jniClass.releasedBy$1?.toDartString(releaseOriginal: true), - fromReference: jniClass.fromReference$1?.toDartString(releaseOriginal: true), - jClass: jniClass.jClass$1?.toDartString(releaseOriginal: true), - isInstanceOf: jniClass.isInstanceOf$1()?.toDartString(releaseOriginal: true), - isNull: jniClass.isNull$1()?.toDartString(releaseOriginal: true), - isReleased: jniClass.isReleased$1, - equals: jniClass.equals?.toDartString(releaseOriginal: true), - isEnabled: jniClass.isEnabled, - isMaybe: jniClass.isMaybe()?.toDartBool(releaseOriginal: true), - isCount: jniClass.isCount()?.toDartInt(releaseOriginal: true), - getValue: jniClass.getValue?.toDartString(releaseOriginal: true), - ); - } - - static NativeInteropReservedNames? fromFfi( - ffi_bridge.NativeInteropReservedNamesBridge? ffiClass, - ) { - return ffiClass == null - ? null - : NativeInteropReservedNames( - type: ffiClass.type?.toDartString(), - use: ffiClass.use?.toDartString(), - reference: ffiClass.reference?.toDartString(), - releasedBy: ffiClass.releasedBy?.toDartString(), - fromReference: ffiClass.fromReference?.toDartString(), - jClass: ffiClass.jClass?.toDartString(), - isInstanceOf: ffiClass.isInstanceOf?.toDartString(), - isNull: ffiClass.isNull?.toDartString(), - isReleased: ffiClass.isReleased, - equals: ffiClass.equals?.toDartString(), - isEnabled: ffiClass.isEnabled, - isMaybe: ffiClass.isMaybe?.boolValue, - isCount: ffiClass.isCount?.longValue, - getValue: ffiClass.getValue?.toDartString(), - ); + Object encode() { + return _toList(); } static NativeInteropReservedNames decode(Object result) { @@ -3276,7497 +1268,629 @@ class _PigeonCodec extends StandardMessageCodec { const String defaultInstanceName = 'PigeonDefaultClassName32uh4ui3lh445uh4h3l2l455g4y34u'; -class NativeInteropHostIntegrationCoreApiForNativeInterop { - NativeInteropHostIntegrationCoreApiForNativeInterop._withRegistrar({ - jni_bridge.NativeInteropHostIntegrationCoreApiRegistrar? jniApi, - ffi_bridge.NativeInteropHostIntegrationCoreApiSetup? ffiApi, - }) : _jniApi = jniApi, - _ffiApi = ffiApi; +@internal +NativeInteropHostIntegrationCoreApiForNativeInterop? +pigeon_getInstance_NativeInteropHostIntegrationCoreApi({String channelName = defaultInstanceName}) { + throw UnsupportedError( + 'Native Interop is not supported on this platform. Use NativeInteropHostIntegrationCoreApi instead.', + ); +} +abstract class NativeInteropHostIntegrationCoreApiForNativeInterop { /// Returns instance of NativeInteropHostIntegrationCoreApiForNativeInterop with specified [channelName] if one has been registered. static NativeInteropHostIntegrationCoreApiForNativeInterop? getInstance({ String channelName = defaultInstanceName, - }) { - final NativeInteropHostIntegrationCoreApiForNativeInterop res; - if (Platform.isAndroid) { - final jni_bridge.NativeInteropHostIntegrationCoreApiRegistrar? link = - jni_bridge.NativeInteropHostIntegrationCoreApiRegistrar().getInstance( - channelName.toJString(), - ); - if (link == null) { - _throwNoInstanceError(channelName); - } - res = NativeInteropHostIntegrationCoreApiForNativeInterop._withRegistrar(jniApi: link); - } else if (Platform.isIOS || Platform.isMacOS) { - final ffi_bridge.NativeInteropHostIntegrationCoreApiSetup? link = ffi_bridge - .NativeInteropHostIntegrationCoreApiSetup.getInstanceWithName(NSString(channelName)); - if (link == null) { - _throwNoInstanceError(channelName); - } - res = NativeInteropHostIntegrationCoreApiForNativeInterop._withRegistrar(ffiApi: link); - } else { - throw UnsupportedError( - 'Native Interop is not supported on this platform. Use NativeInteropHostIntegrationCoreApi instead.', - ); - } - return res; - } + }) => pigeon_native.pigeon_getInstance_NativeInteropHostIntegrationCoreApi( + channelName: channelName, + ); - late final jni_bridge.NativeInteropHostIntegrationCoreApiRegistrar? _jniApi; - late final ffi_bridge.NativeInteropHostIntegrationCoreApiSetup? _ffiApi; + void noop(); - void noop() { - try { - if (_jniApi != null) { - return _jniApi.noop(); - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - _ffiApi.noopWithWrappedError(pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - return; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + NativeInteropAllTypes echoAllTypes(NativeInteropAllTypes everything); - NativeInteropAllTypes echoAllTypes(NativeInteropAllTypes everything) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAllTypes pigeonVar_res = _jniApi.echoAllTypes( - everything.toJni(), - ); - final NativeInteropAllTypes pigeonVar_dartTypeRes = NativeInteropAllTypes.fromJni( - pigeonVar_res, - )!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropAllTypesBridge? pigeonVar_res = _ffiApi - .echoAllTypesWithEverything(everything.toFfi(), wrappedError: pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - final NativeInteropAllTypes pigeonVar_dartTypeRes = NativeInteropAllTypes.fromFfi( - pigeonVar_res, - )!; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } - - Object? throwError() { - try { - if (_jniApi != null) { - final JObject? pigeonVar_res = _jniApi.throwError(); - final Object? pigeonVar_dartTypeRes = _PigeonJniCodec.readValue(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSObject? pigeonVar_res = _ffiApi.throwErrorWithWrappedError(pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - final Object? pigeonVar_dartTypeRes = _PigeonFfiCodec.readValue(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Object? throwError(); - void throwErrorFromVoid() { - try { - if (_jniApi != null) { - return _jniApi.throwErrorFromVoid(); - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - _ffiApi.throwErrorFromVoidWithWrappedError(pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - return; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } - - Object? throwFlutterError() { - try { - if (_jniApi != null) { - final JObject? pigeonVar_res = _jniApi.throwFlutterError(); - final Object? pigeonVar_dartTypeRes = _PigeonJniCodec.readValue(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSObject? pigeonVar_res = _ffiApi.throwFlutterErrorWithWrappedError(pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - final Object? pigeonVar_dartTypeRes = _PigeonFfiCodec.readValue(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + void throwErrorFromVoid(); - int echoInt(int anInt) { - try { - if (_jniApi != null) { - return _jniApi.echoInt(anInt); - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.echoIntWithAnInt( - anInt, - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final int pigeonVar_dartTypeRes = pigeonVar_res!.longValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Object? throwFlutterError(); - double echoDouble(double aDouble) { - try { - if (_jniApi != null) { - return _jniApi.echoDouble(aDouble); - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.echoDoubleWithADouble( - aDouble, - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final double pigeonVar_dartTypeRes = pigeonVar_res!.doubleValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + int echoInt(int anInt); - bool echoBool(bool aBool) { - try { - if (_jniApi != null) { - return _jniApi.echoBool(aBool); - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.echoBoolWithABool( - aBool, - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final bool pigeonVar_dartTypeRes = pigeonVar_res!.boolValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + double echoDouble(double aDouble); - String echoString(String aString) { - try { - if (_jniApi != null) { - final JString pigeonVar_res = _jniApi.echoString( - _PigeonJniCodec.writeValue(aString), - ); - final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSString? pigeonVar_res = _ffiApi.echoStringWithAString( - _PigeonFfiCodec.writeValue(aString), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final String pigeonVar_dartTypeRes = pigeonVar_res!.toDartString(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + bool echoBool(bool aBool); - Uint8List echoUint8List(Uint8List aUint8List) { - try { - if (_jniApi != null) { - final JByteArray pigeonVar_res = _jniApi.echoUint8List( - _PigeonJniCodec.writeValue(aUint8List), - ); - final Uint8List pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res)! as Uint8List; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi - .echoUint8ListWithAUint8List( - _PigeonFfiCodec.writeValue(aUint8List), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Uint8List pigeonVar_dartTypeRes = - _PigeonFfiCodec.readValue(pigeonVar_res)! as Uint8List; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + String echoString(String aString); - Int32List echoInt32List(Int32List aInt32List) { - try { - if (_jniApi != null) { - final JIntArray pigeonVar_res = _jniApi.echoInt32List( - _PigeonJniCodec.writeValue(aInt32List), - ); - final Int32List pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res)! as Int32List; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi - .echoInt32ListWithAInt32List( - _PigeonFfiCodec.writeValue(aInt32List), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Int32List pigeonVar_dartTypeRes = - _PigeonFfiCodec.readValue(pigeonVar_res)! as Int32List; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Uint8List echoUint8List(Uint8List aUint8List); - Int64List echoInt64List(Int64List aInt64List) { - try { - if (_jniApi != null) { - final JLongArray pigeonVar_res = _jniApi.echoInt64List( - _PigeonJniCodec.writeValue(aInt64List), - ); - final Int64List pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res)! as Int64List; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi - .echoInt64ListWithAInt64List( - _PigeonFfiCodec.writeValue(aInt64List), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Int64List pigeonVar_dartTypeRes = - _PigeonFfiCodec.readValue(pigeonVar_res)! as Int64List; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Int32List echoInt32List(Int32List aInt32List); - Float64List echoFloat64List(Float64List aFloat64List) { - try { - if (_jniApi != null) { - final JDoubleArray pigeonVar_res = _jniApi.echoFloat64List( - _PigeonJniCodec.writeValue(aFloat64List), - ); - final Float64List pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res)! as Float64List; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi - .echoFloat64ListWithAFloat64List( - _PigeonFfiCodec.writeValue( - aFloat64List, - ), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Float64List pigeonVar_dartTypeRes = - _PigeonFfiCodec.readValue(pigeonVar_res)! as Float64List; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Int64List echoInt64List(Int64List aInt64List); - Object echoObject(Object anObject) { - try { - if (_jniApi != null) { - final JObject pigeonVar_res = _jniApi.echoObject( - _PigeonJniCodec.writeValue(anObject), - ); - final Object pigeonVar_dartTypeRes = _PigeonJniCodec.readValue(pigeonVar_res)!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSObject? pigeonVar_res = _ffiApi.echoObjectWithAnObject( - _PigeonFfiCodec.writeValue(anObject, generic: true), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Object pigeonVar_dartTypeRes = _PigeonFfiCodec.readValue(pigeonVar_res)!; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Float64List echoFloat64List(Float64List aFloat64List); - List echoList(List list) { - try { - if (_jniApi != null) { - final JList pigeonVar_res = _jniApi.echoList( - _PigeonJniCodec.writeValue>(list), - ); - final List pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as List).cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.echoListWithList( - _PigeonFfiCodec.writeValue(list), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res)! as List).cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Object echoObject(Object anObject); - List echoStringList(List stringList) { - try { - if (_jniApi != null) { - final JList pigeonVar_res = _jniApi.echoStringList( - _PigeonJniCodec.writeValue>(stringList), - ); - final List pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as List).cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.echoStringListWithStringList( - _PigeonFfiCodec.writeValue(stringList), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res)! as List).cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + List echoList(List list); - List echoIntList(List intList) { - try { - if (_jniApi != null) { - final JList pigeonVar_res = _jniApi.echoIntList( - _PigeonJniCodec.writeValue>(intList), - ); - final List pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as List).cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.echoIntListWithIntList( - _PigeonFfiCodec.writeValue(intList), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, int)! as List).cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + List echoStringList(List stringList); - List echoDoubleList(List doubleList) { - try { - if (_jniApi != null) { - final JList pigeonVar_res = _jniApi.echoDoubleList( - _PigeonJniCodec.writeValue>(doubleList), - ); - final List pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as List).cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.echoDoubleListWithDoubleList( - _PigeonFfiCodec.writeValue(doubleList), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, double)! as List).cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + List echoIntList(List intList); - List echoBoolList(List boolList) { - try { - if (_jniApi != null) { - final JList pigeonVar_res = _jniApi.echoBoolList( - _PigeonJniCodec.writeValue>(boolList), - ); - final List pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as List).cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.echoBoolListWithBoolList( - _PigeonFfiCodec.writeValue(boolList), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, bool)! as List).cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + List echoDoubleList(List doubleList); - List echoEnumList(List enumList) { - try { - if (_jniApi != null) { - final JList pigeonVar_res = _jniApi.echoEnumList( - _PigeonJniCodec.writeValue>(enumList), - ); - final List pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as List) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.echoEnumListWithEnumList( - _PigeonFfiCodec.writeValue(enumList), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum)! as List) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + List echoBoolList(List boolList); + + List echoEnumList(List enumList); List echoClassList( List classList, - ) { - try { - if (_jniApi != null) { - final JList pigeonVar_res = _jniApi - .echoClassList( - _PigeonJniCodec.writeValue>( - classList, - ), - ); - final List pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as List) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.echoClassListWithClassList( - _PigeonFfiCodec.writeValue(classList), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res)! as List) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - List echoNonNullEnumList(List enumList) { - try { - if (_jniApi != null) { - final JList pigeonVar_res = _jniApi.echoNonNullEnumList( - _PigeonJniCodec.writeValue>(enumList), - ); - final List pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as List) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.echoNonNullEnumListWithEnumList( - _PigeonFfiCodec.writeValue(enumList), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum)! as List) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + List echoNonNullEnumList(List enumList); List echoNonNullClassList( List classList, - ) { - try { - if (_jniApi != null) { - final JList pigeonVar_res = _jniApi - .echoNonNullClassList( - _PigeonJniCodec.writeValue>( - classList, - ), - ); - final List pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as List) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.echoNonNullClassListWithClassList( - _PigeonFfiCodec.writeValue(classList), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res)! as List) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - Map echoMap(Map map) { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = _jniApi.echoMap( - _PigeonJniCodec.writeValue>(map), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.echoMapWithMap( - _PigeonFfiCodec.writeValue(map), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Map echoMap(Map map); - Map echoStringMap(Map stringMap) { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = _jniApi.echoStringMap( - _PigeonJniCodec.writeValue>(stringMap), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.echoStringMapWithStringMap( - _PigeonFfiCodec.writeValue(stringMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Map echoStringMap(Map stringMap); - Map echoIntMap(Map intMap) { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = _jniApi.echoIntMap( - _PigeonJniCodec.writeValue>(intMap), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map).cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.echoIntMapWithIntMap( - _PigeonFfiCodec.writeValue(intMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, int, int)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Map echoIntMap(Map intMap); Map echoEnumMap( Map enumMap, - ) { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = - _jniApi.echoEnumMap( - _PigeonJniCodec.writeValue< - JMap - >(enumMap), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.echoEnumMapWithEnumMap( - _PigeonFfiCodec.writeValue(enumMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum, NativeInteropAnEnum)! - as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); Map echoClassMap( Map classMap, - ) { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = _jniApi - .echoClassMap( - _PigeonJniCodec.writeValue>( - classMap, - ), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.echoClassMapWithClassMap( - _PigeonFfiCodec.writeValue(classMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, int)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - Map echoNonNullStringMap(Map stringMap) { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = _jniApi.echoNonNullStringMap( - _PigeonJniCodec.writeValue>(stringMap), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.echoNonNullStringMapWithStringMap( - _PigeonFfiCodec.writeValue(stringMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Map echoNonNullStringMap(Map stringMap); - Map echoNonNullIntMap(Map intMap) { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = _jniApi.echoNonNullIntMap( - _PigeonJniCodec.writeValue>(intMap), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map).cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.echoNonNullIntMapWithIntMap( - _PigeonFfiCodec.writeValue(intMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, int, int)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Map echoNonNullIntMap(Map intMap); Map echoNonNullEnumMap( Map enumMap, - ) { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = - _jniApi.echoNonNullEnumMap( - _PigeonJniCodec.writeValue< - JMap - >(enumMap), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.echoNonNullEnumMapWithEnumMap( - _PigeonFfiCodec.writeValue(enumMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum, NativeInteropAnEnum)! - as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); Map echoNonNullClassMap( Map classMap, - ) { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = _jniApi - .echoNonNullClassMap( - _PigeonJniCodec.writeValue>( - classMap, - ), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.echoNonNullClassMapWithClassMap( - _PigeonFfiCodec.writeValue(classMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, int)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - NativeInteropAllClassesWrapper echoClassWrapper(NativeInteropAllClassesWrapper wrapper) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAllClassesWrapper pigeonVar_res = _jniApi.echoClassWrapper( - wrapper.toJni(), - ); - final NativeInteropAllClassesWrapper pigeonVar_dartTypeRes = - NativeInteropAllClassesWrapper.fromJni(pigeonVar_res)!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropAllClassesWrapperBridge? pigeonVar_res = _ffiApi - .echoClassWrapperWithWrapper(wrapper.toFfi(), wrappedError: pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - final NativeInteropAllClassesWrapper pigeonVar_dartTypeRes = - NativeInteropAllClassesWrapper.fromFfi(pigeonVar_res)!; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + NativeInteropAllClassesWrapper echoClassWrapper(NativeInteropAllClassesWrapper wrapper); - NativeInteropSealedClass echoSealedClass(NativeInteropSealedClass sealedClass) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropSealedClass pigeonVar_res = _jniApi.echoSealedClass( - sealedClass.toJni(), - ); - final NativeInteropSealedClass pigeonVar_dartTypeRes = NativeInteropSealedClass.fromJni( - pigeonVar_res, - )!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropSealedClassBridge? pigeonVar_res = _ffiApi - .echoSealedClassWithSealedClass(sealedClass.toFfi(), wrappedError: pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - final NativeInteropSealedClass pigeonVar_dartTypeRes = NativeInteropSealedClass.fromFfi( - pigeonVar_res, - )!; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + NativeInteropSealedClass echoSealedClass(NativeInteropSealedClass sealedClass); - NativeInteropSealedClass? echoNullableSealedClass(NativeInteropSealedClass? sealedClass) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropSealedClass? pigeonVar_res = _jniApi.echoNullableSealedClass( - sealedClass?.toJni(), - ); - final NativeInteropSealedClass? pigeonVar_dartTypeRes = NativeInteropSealedClass.fromJni( - pigeonVar_res, - ); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropSealedClassBridge? pigeonVar_res = _ffiApi - .echoNullableSealedClassWithSealedClass( - sealedClass?.toFfi(), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final NativeInteropSealedClass? pigeonVar_dartTypeRes = NativeInteropSealedClass.fromFfi( - pigeonVar_res, - ); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + NativeInteropSealedClass? echoNullableSealedClass(NativeInteropSealedClass? sealedClass); List echoSealedClassList( List sealedClassList, - ) { - try { - if (_jniApi != null) { - final JList pigeonVar_res = _jniApi - .echoSealedClassList( - _PigeonJniCodec.writeValue>( - sealedClassList, - ), - ); - final List pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as List) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.echoSealedClassListWithSealedClassList( - _PigeonFfiCodec.writeValue(sealedClassList), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res)! as List) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } - - NativeInteropSealedClassWrapper echoSealedClassWrapper(NativeInteropSealedClassWrapper wrapper) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropSealedClassWrapper pigeonVar_res = _jniApi - .echoSealedClassWrapper(wrapper.toJni()); - final NativeInteropSealedClassWrapper pigeonVar_dartTypeRes = - NativeInteropSealedClassWrapper.fromJni(pigeonVar_res)!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropSealedClassWrapperBridge? pigeonVar_res = _ffiApi - .echoSealedClassWrapperWithWrapper(wrapper.toFfi(), wrappedError: pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - final NativeInteropSealedClassWrapper pigeonVar_dartTypeRes = - NativeInteropSealedClassWrapper.fromFfi(pigeonVar_res)!; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } - - NativeInteropAnEnum echoEnum(NativeInteropAnEnum anEnum) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAnEnum pigeonVar_res = _jniApi.echoEnum(anEnum.toJni()); - final NativeInteropAnEnum pigeonVar_dartTypeRes = NativeInteropAnEnum.fromJni( - pigeonVar_res, - )!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.echoEnumWithAnEnum( - ffi_bridge.NativeInteropAnEnum.values[anEnum.index], - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final NativeInteropAnEnum pigeonVar_dartTypeRes = - _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum)! as NativeInteropAnEnum; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - NativeInteropAnotherEnum echoAnotherEnum(NativeInteropAnotherEnum anotherEnum) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAnotherEnum pigeonVar_res = _jniApi.echoAnotherEnum( - anotherEnum.toJni(), - ); - final NativeInteropAnotherEnum pigeonVar_dartTypeRes = NativeInteropAnotherEnum.fromJni( - pigeonVar_res, - )!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.echoAnotherEnumWithAnotherEnum( - ffi_bridge.NativeInteropAnotherEnum.values[anotherEnum.index], - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final NativeInteropAnotherEnum pigeonVar_dartTypeRes = - _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnotherEnum)! - as NativeInteropAnotherEnum; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + NativeInteropSealedClassWrapper echoSealedClassWrapper(NativeInteropSealedClassWrapper wrapper); - String echoNamedDefaultString({String aString = 'default'}) { - try { - if (_jniApi != null) { - final JString pigeonVar_res = _jniApi.echoNamedDefaultString( - _PigeonJniCodec.writeValue(aString), - ); - final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSString? pigeonVar_res = _ffiApi.echoNamedDefaultStringWithAString( - _PigeonFfiCodec.writeValue(aString), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final String pigeonVar_dartTypeRes = pigeonVar_res!.toDartString(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + NativeInteropAnEnum echoEnum(NativeInteropAnEnum anEnum); - double echoOptionalDefaultDouble([double aDouble = 3.14]) { - try { - if (_jniApi != null) { - return _jniApi.echoOptionalDefaultDouble(aDouble); - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.echoOptionalDefaultDoubleWithADouble( - aDouble, - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final double pigeonVar_dartTypeRes = pigeonVar_res!.doubleValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + NativeInteropAnotherEnum echoAnotherEnum(NativeInteropAnotherEnum anotherEnum); - int echoRequiredInt({required int anInt}) { - try { - if (_jniApi != null) { - return _jniApi.echoRequiredInt(anInt); - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.echoRequiredIntWithAnInt( - anInt, - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final int pigeonVar_dartTypeRes = pigeonVar_res!.longValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } - - NativeInteropAllNullableTypes? echoAllNullableTypes(NativeInteropAllNullableTypes? everything) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAllNullableTypes? pigeonVar_res = _jniApi - .echoAllNullableTypes(everything?.toJni()); - final NativeInteropAllNullableTypes? pigeonVar_dartTypeRes = - NativeInteropAllNullableTypes.fromJni(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropAllNullableTypesBridge? pigeonVar_res = _ffiApi - .echoAllNullableTypesWithEverything(everything?.toFfi(), wrappedError: pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - final NativeInteropAllNullableTypes? pigeonVar_dartTypeRes = - NativeInteropAllNullableTypes.fromFfi(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + String echoNamedDefaultString({String aString = 'default'}); + + double echoOptionalDefaultDouble([double aDouble = 3.14]); + + int echoRequiredInt({required int anInt}); + + NativeInteropAllNullableTypes? echoAllNullableTypes(NativeInteropAllNullableTypes? everything); NativeInteropAllNullableTypesWithoutRecursion? echoAllNullableTypesWithoutRecursion( NativeInteropAllNullableTypesWithoutRecursion? everything, - ) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAllNullableTypesWithoutRecursion? pigeonVar_res = _jniApi - .echoAllNullableTypesWithoutRecursion(everything?.toJni()); - final NativeInteropAllNullableTypesWithoutRecursion? pigeonVar_dartTypeRes = - NativeInteropAllNullableTypesWithoutRecursion.fromJni(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge? pigeonVar_res = - _ffiApi.echoAllNullableTypesWithoutRecursionWithEverything( - everything?.toFfi(), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final NativeInteropAllNullableTypesWithoutRecursion? pigeonVar_dartTypeRes = - NativeInteropAllNullableTypesWithoutRecursion.fromFfi(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } - - String? extractNestedNullableString(NativeInteropAllClassesWrapper wrapper) { - try { - if (_jniApi != null) { - final JString? pigeonVar_res = _jniApi.extractNestedNullableString(wrapper.toJni()); - final String? pigeonVar_dartTypeRes = pigeonVar_res?.toDartString(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSString? pigeonVar_res = _ffiApi.extractNestedNullableStringWithWrapper( - wrapper.toFfi(), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final String? pigeonVar_dartTypeRes = pigeonVar_res?.toDartString(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } - - NativeInteropAllClassesWrapper createNestedNullableString(String? nullableString) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAllClassesWrapper pigeonVar_res = _jniApi - .createNestedNullableString(_PigeonJniCodec.writeValue(nullableString)); - final NativeInteropAllClassesWrapper pigeonVar_dartTypeRes = - NativeInteropAllClassesWrapper.fromJni(pigeonVar_res)!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropAllClassesWrapperBridge? pigeonVar_res = _ffiApi - .createNestedNullableStringWithNullableString( - _PigeonFfiCodec.writeValue(nullableString), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final NativeInteropAllClassesWrapper pigeonVar_dartTypeRes = - NativeInteropAllClassesWrapper.fromFfi(pigeonVar_res)!; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); + + String? extractNestedNullableString(NativeInteropAllClassesWrapper wrapper); + + NativeInteropAllClassesWrapper createNestedNullableString(String? nullableString); NativeInteropAllNullableTypes sendMultipleNullableTypes( bool? aNullableBool, int? aNullableInt, String? aNullableString, - ) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAllNullableTypes pigeonVar_res = _jniApi - .sendMultipleNullableTypes( - _PigeonJniCodec.writeValue(aNullableBool), - _PigeonJniCodec.writeValue(aNullableInt), - _PigeonJniCodec.writeValue(aNullableString), - ); - final NativeInteropAllNullableTypes pigeonVar_dartTypeRes = - NativeInteropAllNullableTypes.fromJni(pigeonVar_res)!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropAllNullableTypesBridge? pigeonVar_res = _ffiApi - .sendMultipleNullableTypesWithANullableBool( - _PigeonFfiCodec.writeValue(aNullableBool), - aNullableInt: _PigeonFfiCodec.writeValue(aNullableInt), - aNullableString: _PigeonFfiCodec.writeValue(aNullableString), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final NativeInteropAllNullableTypes pigeonVar_dartTypeRes = - NativeInteropAllNullableTypes.fromFfi(pigeonVar_res)!; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); NativeInteropAllNullableTypesWithoutRecursion sendMultipleNullableTypesWithoutRecursion( bool? aNullableBool, int? aNullableInt, String? aNullableString, - ) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAllNullableTypesWithoutRecursion pigeonVar_res = _jniApi - .sendMultipleNullableTypesWithoutRecursion( - _PigeonJniCodec.writeValue(aNullableBool), - _PigeonJniCodec.writeValue(aNullableInt), - _PigeonJniCodec.writeValue(aNullableString), - ); - final NativeInteropAllNullableTypesWithoutRecursion pigeonVar_dartTypeRes = - NativeInteropAllNullableTypesWithoutRecursion.fromJni(pigeonVar_res)!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge? pigeonVar_res = - _ffiApi.sendMultipleNullableTypesWithoutRecursionWithANullableBool( - _PigeonFfiCodec.writeValue(aNullableBool), - aNullableInt: _PigeonFfiCodec.writeValue(aNullableInt), - aNullableString: _PigeonFfiCodec.writeValue(aNullableString), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final NativeInteropAllNullableTypesWithoutRecursion pigeonVar_dartTypeRes = - NativeInteropAllNullableTypesWithoutRecursion.fromFfi(pigeonVar_res)!; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - int? echoNullableInt(int? aNullableInt) { - try { - if (_jniApi != null) { - final JLong? pigeonVar_res = _jniApi.echoNullableInt( - _PigeonJniCodec.writeValue(aNullableInt), - ); - final int? pigeonVar_dartTypeRes = pigeonVar_res?.toDartInt(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.echoNullableIntWithANullableInt( - _PigeonFfiCodec.writeValue(aNullableInt), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final int? pigeonVar_dartTypeRes = pigeonVar_res?.longValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + int? echoNullableInt(int? aNullableInt); - double? echoNullableDouble(double? aNullableDouble) { - try { - if (_jniApi != null) { - final JDouble? pigeonVar_res = _jniApi.echoNullableDouble( - _PigeonJniCodec.writeValue(aNullableDouble), - ); - final double? pigeonVar_dartTypeRes = pigeonVar_res?.toDartDouble(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.echoNullableDoubleWithANullableDouble( - _PigeonFfiCodec.writeValue(aNullableDouble), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final double? pigeonVar_dartTypeRes = pigeonVar_res?.doubleValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + double? echoNullableDouble(double? aNullableDouble); - bool? echoNullableBool(bool? aNullableBool) { - try { - if (_jniApi != null) { - final JBoolean? pigeonVar_res = _jniApi.echoNullableBool( - _PigeonJniCodec.writeValue(aNullableBool), - ); - final bool? pigeonVar_dartTypeRes = pigeonVar_res?.toDartBool(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.echoNullableBoolWithANullableBool( - _PigeonFfiCodec.writeValue(aNullableBool), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final bool? pigeonVar_dartTypeRes = pigeonVar_res?.boolValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + bool? echoNullableBool(bool? aNullableBool); - String? echoNullableString(String? aNullableString) { - try { - if (_jniApi != null) { - final JString? pigeonVar_res = _jniApi.echoNullableString( - _PigeonJniCodec.writeValue(aNullableString), - ); - final String? pigeonVar_dartTypeRes = pigeonVar_res?.toDartString(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSString? pigeonVar_res = _ffiApi.echoNullableStringWithANullableString( - _PigeonFfiCodec.writeValue(aNullableString), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final String? pigeonVar_dartTypeRes = pigeonVar_res?.toDartString(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + String? echoNullableString(String? aNullableString); - Uint8List? echoNullableUint8List(Uint8List? aNullableUint8List) { - try { - if (_jniApi != null) { - final JByteArray? pigeonVar_res = _jniApi.echoNullableUint8List( - _PigeonJniCodec.writeValue(aNullableUint8List), - ); - final Uint8List? pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res) as Uint8List?; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi - .echoNullableUint8ListWithANullableUint8List( - _PigeonFfiCodec.writeValue( - aNullableUint8List, - ), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Uint8List? pigeonVar_dartTypeRes = - _PigeonFfiCodec.readValue(pigeonVar_res) as Uint8List?; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Uint8List? echoNullableUint8List(Uint8List? aNullableUint8List); - Int32List? echoNullableInt32List(Int32List? aNullableInt32List) { - try { - if (_jniApi != null) { - final JIntArray? pigeonVar_res = _jniApi.echoNullableInt32List( - _PigeonJniCodec.writeValue(aNullableInt32List), - ); - final Int32List? pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res) as Int32List?; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi - .echoNullableInt32ListWithANullableInt32List( - _PigeonFfiCodec.writeValue( - aNullableInt32List, - ), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Int32List? pigeonVar_dartTypeRes = - _PigeonFfiCodec.readValue(pigeonVar_res) as Int32List?; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Int32List? echoNullableInt32List(Int32List? aNullableInt32List); - Int64List? echoNullableInt64List(Int64List? aNullableInt64List) { - try { - if (_jniApi != null) { - final JLongArray? pigeonVar_res = _jniApi.echoNullableInt64List( - _PigeonJniCodec.writeValue(aNullableInt64List), - ); - final Int64List? pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res) as Int64List?; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi - .echoNullableInt64ListWithANullableInt64List( - _PigeonFfiCodec.writeValue( - aNullableInt64List, - ), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Int64List? pigeonVar_dartTypeRes = - _PigeonFfiCodec.readValue(pigeonVar_res) as Int64List?; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Int64List? echoNullableInt64List(Int64List? aNullableInt64List); - Float64List? echoNullableFloat64List(Float64List? aNullableFloat64List) { - try { - if (_jniApi != null) { - final JDoubleArray? pigeonVar_res = _jniApi.echoNullableFloat64List( - _PigeonJniCodec.writeValue(aNullableFloat64List), - ); - final Float64List? pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res) as Float64List?; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi - .echoNullableFloat64ListWithANullableFloat64List( - _PigeonFfiCodec.writeValue( - aNullableFloat64List, - ), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Float64List? pigeonVar_dartTypeRes = - _PigeonFfiCodec.readValue(pigeonVar_res) as Float64List?; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Float64List? echoNullableFloat64List(Float64List? aNullableFloat64List); - Object? echoNullableObject(Object? aNullableObject) { - try { - if (_jniApi != null) { - final JObject? pigeonVar_res = _jniApi.echoNullableObject( - _PigeonJniCodec.writeValue(aNullableObject), - ); - final Object? pigeonVar_dartTypeRes = _PigeonJniCodec.readValue(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSObject? pigeonVar_res = _ffiApi.echoNullableObjectWithANullableObject( - _PigeonFfiCodec.writeValue(aNullableObject, generic: true), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Object? pigeonVar_dartTypeRes = _PigeonFfiCodec.readValue(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Object? echoNullableObject(Object? aNullableObject); - List? echoNullableList(List? aNullableList) { - try { - if (_jniApi != null) { - final JList? pigeonVar_res = _jniApi.echoNullableList( - _PigeonJniCodec.writeValue?>(aNullableList), - ); - final List? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as List?)?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.echoNullableListWithANullableList( - _PigeonFfiCodec.writeValue(aNullableList), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res) as List?)?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + List? echoNullableList(List? aNullableList); - List? echoNullableEnumList(List? enumList) { - try { - if (_jniApi != null) { - final JList? pigeonVar_res = _jniApi.echoNullableEnumList( - _PigeonJniCodec.writeValue?>(enumList), - ); - final List? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as List?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.echoNullableEnumListWithEnumList( - _PigeonFfiCodec.writeValue(enumList), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum) as List?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + List? echoNullableEnumList(List? enumList); List? echoNullableClassList( List? classList, - ) { - try { - if (_jniApi != null) { - final JList? pigeonVar_res = _jniApi - .echoNullableClassList( - _PigeonJniCodec.writeValue?>( - classList, - ), - ); - final List? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as List?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.echoNullableClassListWithClassList( - _PigeonFfiCodec.writeValue(classList), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res) as List?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - List? echoNullableNonNullEnumList(List? enumList) { - try { - if (_jniApi != null) { - final JList? pigeonVar_res = _jniApi - .echoNullableNonNullEnumList( - _PigeonJniCodec.writeValue?>(enumList), - ); - final List? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as List?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.echoNullableNonNullEnumListWithEnumList( - _PigeonFfiCodec.writeValue(enumList), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum) as List?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + List? echoNullableNonNullEnumList(List? enumList); List? echoNullableNonNullClassList( List? classList, - ) { - try { - if (_jniApi != null) { - final JList? pigeonVar_res = _jniApi - .echoNullableNonNullClassList( - _PigeonJniCodec.writeValue?>( - classList, - ), - ); - final List? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as List?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.echoNullableNonNullClassListWithClassList( - _PigeonFfiCodec.writeValue(classList), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res) as List?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - Map? echoNullableMap(Map? map) { - try { - if (_jniApi != null) { - final JMap? pigeonVar_res = _jniApi.echoNullableMap( - _PigeonJniCodec.writeValue?>(map), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.echoNullableMapWithMap( - _PigeonFfiCodec.writeValue(map), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Map? echoNullableMap(Map? map); - Map? echoNullableStringMap(Map? stringMap) { - try { - if (_jniApi != null) { - final JMap? pigeonVar_res = _jniApi.echoNullableStringMap( - _PigeonJniCodec.writeValue?>(stringMap), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.echoNullableStringMapWithStringMap( - _PigeonFfiCodec.writeValue(stringMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Map? echoNullableStringMap(Map? stringMap); - Map? echoNullableIntMap(Map? intMap) { - try { - if (_jniApi != null) { - final JMap? pigeonVar_res = _jniApi.echoNullableIntMap( - _PigeonJniCodec.writeValue?>(intMap), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.echoNullableIntMapWithIntMap( - _PigeonFfiCodec.writeValue(intMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, int, int) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Map? echoNullableIntMap(Map? intMap); Map? echoNullableEnumMap( Map? enumMap, - ) { - try { - if (_jniApi != null) { - final JMap? - pigeonVar_res = _jniApi.echoNullableEnumMap( - _PigeonJniCodec.writeValue< - JMap? - >(enumMap), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.echoNullableEnumMapWithEnumMap( - _PigeonFfiCodec.writeValue(enumMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum, NativeInteropAnEnum) - as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); Map? echoNullableClassMap( Map? classMap, - ) { - try { - if (_jniApi != null) { - final JMap? pigeonVar_res = _jniApi - .echoNullableClassMap( - _PigeonJniCodec.writeValue?>( - classMap, - ), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.echoNullableClassMapWithClassMap( - _PigeonFfiCodec.writeValue(classMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, int) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - Map? echoNullableNonNullStringMap(Map? stringMap) { - try { - if (_jniApi != null) { - final JMap? pigeonVar_res = _jniApi.echoNullableNonNullStringMap( - _PigeonJniCodec.writeValue?>(stringMap), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.echoNullableNonNullStringMapWithStringMap( - _PigeonFfiCodec.writeValue(stringMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Map? echoNullableNonNullStringMap(Map? stringMap); - Map? echoNullableNonNullIntMap(Map? intMap) { - try { - if (_jniApi != null) { - final JMap? pigeonVar_res = _jniApi.echoNullableNonNullIntMap( - _PigeonJniCodec.writeValue?>(intMap), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?)?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.echoNullableNonNullIntMapWithIntMap( - _PigeonFfiCodec.writeValue(intMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, int, int) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Map? echoNullableNonNullIntMap(Map? intMap); Map? echoNullableNonNullEnumMap( Map? enumMap, - ) { - try { - if (_jniApi != null) { - final JMap? pigeonVar_res = - _jniApi.echoNullableNonNullEnumMap( - _PigeonJniCodec.writeValue< - JMap? - >(enumMap), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.echoNullableNonNullEnumMapWithEnumMap( - _PigeonFfiCodec.writeValue(enumMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum, NativeInteropAnEnum) - as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); Map? echoNullableNonNullClassMap( Map? classMap, - ) { - try { - if (_jniApi != null) { - final JMap? pigeonVar_res = _jniApi - .echoNullableNonNullClassMap( - _PigeonJniCodec.writeValue?>( - classMap, - ), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.echoNullableNonNullClassMapWithClassMap( - _PigeonFfiCodec.writeValue(classMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, int) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - NativeInteropAnEnum? echoNullableEnum(NativeInteropAnEnum? anEnum) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAnEnum? pigeonVar_res = _jniApi.echoNullableEnum( - anEnum?.toJni(), - ); - final NativeInteropAnEnum? pigeonVar_dartTypeRes = NativeInteropAnEnum.fromJni( - pigeonVar_res, - ); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.echoNullableEnumWithAnEnum( - _PigeonFfiCodec.writeValue(anEnum), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final NativeInteropAnEnum? pigeonVar_dartTypeRes = - _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum) as NativeInteropAnEnum?; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + NativeInteropAnEnum? echoNullableEnum(NativeInteropAnEnum? anEnum); - NativeInteropAnotherEnum? echoAnotherNullableEnum(NativeInteropAnotherEnum? anotherEnum) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAnotherEnum? pigeonVar_res = _jniApi.echoAnotherNullableEnum( - anotherEnum?.toJni(), - ); - final NativeInteropAnotherEnum? pigeonVar_dartTypeRes = NativeInteropAnotherEnum.fromJni( - pigeonVar_res, - ); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.echoAnotherNullableEnumWithAnotherEnum( - _PigeonFfiCodec.writeValue(anotherEnum), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final NativeInteropAnotherEnum? pigeonVar_dartTypeRes = - _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnotherEnum) - as NativeInteropAnotherEnum?; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + NativeInteropAnotherEnum? echoAnotherNullableEnum(NativeInteropAnotherEnum? anotherEnum); - int? echoOptionalNullableInt([int? aNullableInt]) { - try { - if (_jniApi != null) { - final JLong? pigeonVar_res = _jniApi.echoOptionalNullableInt( - _PigeonJniCodec.writeValue(aNullableInt), - ); - final int? pigeonVar_dartTypeRes = pigeonVar_res?.toDartInt(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.echoOptionalNullableIntWithANullableInt( - _PigeonFfiCodec.writeValue(aNullableInt), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final int? pigeonVar_dartTypeRes = pigeonVar_res?.longValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + int? echoOptionalNullableInt([int? aNullableInt]); - String? echoNamedNullableString({String? aNullableString}) { - try { - if (_jniApi != null) { - final JString? pigeonVar_res = _jniApi.echoNamedNullableString( - _PigeonJniCodec.writeValue(aNullableString), - ); - final String? pigeonVar_dartTypeRes = pigeonVar_res?.toDartString(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSString? pigeonVar_res = _ffiApi.echoNamedNullableStringWithANullableString( - _PigeonFfiCodec.writeValue(aNullableString), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final String? pigeonVar_dartTypeRes = pigeonVar_res?.toDartString(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + String? echoNamedNullableString({String? aNullableString}); - Future noopAsync() async { - try { - if (_jniApi != null) { - await _jniApi.noopAsync(); - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.noopAsyncWithWrappedError( - pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid.listener(() { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future noopAsync(); - Future echoAsyncInt(int anInt) async { - try { - if (_jniApi != null) { - final JLong pigeonVar_res = await _jniApi.echoAsyncInt(anInt); - final int pigeonVar_dartTypeRes = pigeonVar_res.toDartInt(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.echoAsyncIntWithAnInt( - anInt, - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( - NSNumber? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(pigeonVar_res!.longValue); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future echoAsyncInt(int anInt); - Future echoAsyncDouble(double aDouble) async { - try { - if (_jniApi != null) { - final JDouble pigeonVar_res = await _jniApi.echoAsyncDouble(aDouble); - final double pigeonVar_dartTypeRes = pigeonVar_res.toDartDouble(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.echoAsyncDoubleWithADouble( - aDouble, - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( - NSNumber? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(pigeonVar_res!.doubleValue); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future echoAsyncDouble(double aDouble); - Future echoAsyncBool(bool aBool) async { - try { - if (_jniApi != null) { - final JBoolean pigeonVar_res = await _jniApi.echoAsyncBool(aBool); - final bool pigeonVar_dartTypeRes = pigeonVar_res.toDartBool(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.echoAsyncBoolWithABool( - aBool, - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( - NSNumber? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(pigeonVar_res!.boolValue); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future echoAsyncBool(bool aBool); - Future echoAsyncString(String aString) async { - try { - if (_jniApi != null) { - final JString pigeonVar_res = await _jniApi.echoAsyncString( - _PigeonJniCodec.writeValue(aString), - ); - final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.echoAsyncStringWithAString( - _PigeonFfiCodec.writeValue(aString), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSString.listener(( - NSString? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(pigeonVar_res!.toDartString()); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future echoAsyncString(String aString); - Future echoAsyncUint8List(Uint8List aUint8List) async { - try { - if (_jniApi != null) { - final JByteArray pigeonVar_res = await _jniApi.echoAsyncUint8List( - _PigeonJniCodec.writeValue(aUint8List), - ); - final Uint8List pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res)! as Uint8List; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.echoAsyncUint8ListWithAUint8List( - _PigeonFfiCodec.writeValue(aUint8List), - wrappedError: pigeonVar_error, - completionHandler: - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( - ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - _PigeonFfiCodec.readValue(pigeonVar_res)! as Uint8List, - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future echoAsyncUint8List(Uint8List aUint8List); - Future echoAsyncInt32List(Int32List aInt32List) async { - try { - if (_jniApi != null) { - final JIntArray pigeonVar_res = await _jniApi.echoAsyncInt32List( - _PigeonJniCodec.writeValue(aInt32List), - ); - final Int32List pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res)! as Int32List; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.echoAsyncInt32ListWithAInt32List( - _PigeonFfiCodec.writeValue(aInt32List), - wrappedError: pigeonVar_error, - completionHandler: - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( - ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - _PigeonFfiCodec.readValue(pigeonVar_res)! as Int32List, - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future echoAsyncInt32List(Int32List aInt32List); - Future echoAsyncInt64List(Int64List aInt64List) async { - try { - if (_jniApi != null) { - final JLongArray pigeonVar_res = await _jniApi.echoAsyncInt64List( - _PigeonJniCodec.writeValue(aInt64List), - ); - final Int64List pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res)! as Int64List; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.echoAsyncInt64ListWithAInt64List( - _PigeonFfiCodec.writeValue(aInt64List), - wrappedError: pigeonVar_error, - completionHandler: - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( - ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - _PigeonFfiCodec.readValue(pigeonVar_res)! as Int64List, - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future echoAsyncInt64List(Int64List aInt64List); - Future echoAsyncFloat64List(Float64List aFloat64List) async { - try { - if (_jniApi != null) { - final JDoubleArray pigeonVar_res = await _jniApi.echoAsyncFloat64List( - _PigeonJniCodec.writeValue(aFloat64List), - ); - final Float64List pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res)! as Float64List; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.echoAsyncFloat64ListWithAFloat64List( - _PigeonFfiCodec.writeValue(aFloat64List), - wrappedError: pigeonVar_error, - completionHandler: - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( - ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - _PigeonFfiCodec.readValue(pigeonVar_res)! as Float64List, - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future echoAsyncFloat64List(Float64List aFloat64List); - Future echoAsyncObject(Object anObject) async { - try { - if (_jniApi != null) { - final JObject pigeonVar_res = await _jniApi.echoAsyncObject( - _PigeonJniCodec.writeValue(anObject), - ); - final Object pigeonVar_dartTypeRes = _PigeonJniCodec.readValue(pigeonVar_res)!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.echoAsyncObjectWithAnObject( - _PigeonFfiCodec.writeValue(anObject, generic: true), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSObject.listener(( - NSObject? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(_PigeonFfiCodec.readValue(pigeonVar_res)!); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future echoAsyncObject(Object anObject); - Future> echoAsyncList(List list) async { - try { - if (_jniApi != null) { - final JList pigeonVar_res = await _jniApi.echoAsyncList( - _PigeonJniCodec.writeValue>(list), - ); - final List pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as List).cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer> pigeonVar_completer = Completer>(); - _ffiApi.echoAsyncListWithList( - _PigeonFfiCodec.writeValue(list), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( - NSArray? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res)! as List).cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future> echoAsyncList(List list); - Future> echoAsyncEnumList(List enumList) async { - try { - if (_jniApi != null) { - final JList pigeonVar_res = await _jniApi - .echoAsyncEnumList( - _PigeonJniCodec.writeValue>(enumList), - ); - final List pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as List) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer> pigeonVar_completer = - Completer>(); - _ffiApi.echoAsyncEnumListWithEnumList( - _PigeonFfiCodec.writeValue(enumList), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( - NSArray? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum)! as List) - .cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future> echoAsyncEnumList(List enumList); Future> echoAsyncClassList( List classList, - ) async { - try { - if (_jniApi != null) { - final JList pigeonVar_res = await _jniApi - .echoAsyncClassList( - _PigeonJniCodec.writeValue>( - classList, - ), - ); - final List pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as List) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer> pigeonVar_completer = - Completer>(); - _ffiApi.echoAsyncClassListWithClassList( - _PigeonFfiCodec.writeValue(classList), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( - NSArray? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res)! as List) - .cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - Future> echoAsyncMap(Map map) async { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = await _jniApi.echoAsyncMap( - _PigeonJniCodec.writeValue>(map), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer> pigeonVar_completer = - Completer>(); - _ffiApi.echoAsyncMapWithMap( - _PigeonFfiCodec.writeValue(map), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( - NSDictionary? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res)! as Map) - .cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future> echoAsyncMap(Map map); - Future> echoAsyncStringMap(Map stringMap) async { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = await _jniApi.echoAsyncStringMap( - _PigeonJniCodec.writeValue>(stringMap), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer> pigeonVar_completer = - Completer>(); - _ffiApi.echoAsyncStringMapWithStringMap( - _PigeonFfiCodec.writeValue(stringMap), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( - NSDictionary? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res)! as Map) - .cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future> echoAsyncStringMap(Map stringMap); - Future> echoAsyncIntMap(Map intMap) async { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = await _jniApi.echoAsyncIntMap( - _PigeonJniCodec.writeValue>(intMap), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map).cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer> pigeonVar_completer = Completer>(); - _ffiApi.echoAsyncIntMapWithIntMap( - _PigeonFfiCodec.writeValue(intMap), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( - NSDictionary? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res, int, int)! as Map) - .cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future> echoAsyncIntMap(Map intMap); Future> echoAsyncEnumMap( Map enumMap, - ) async { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = - await _jniApi.echoAsyncEnumMap( - _PigeonJniCodec.writeValue< - JMap - >(enumMap), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer> pigeonVar_completer = - Completer>(); - _ffiApi.echoAsyncEnumMapWithEnumMap( - _PigeonFfiCodec.writeValue(enumMap), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( - NSDictionary? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum, NativeInteropAnEnum)! - as Map) - .cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); Future> echoAsyncClassMap( Map classMap, - ) async { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = await _jniApi - .echoAsyncClassMap( - _PigeonJniCodec.writeValue>( - classMap, - ), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer> pigeonVar_completer = - Completer>(); - _ffiApi.echoAsyncClassMapWithClassMap( - _PigeonFfiCodec.writeValue(classMap), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( - NSDictionary? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res, int)! as Map) - .cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - Future echoAsyncEnum(NativeInteropAnEnum anEnum) async { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAnEnum pigeonVar_res = await _jniApi.echoAsyncEnum( - anEnum.toJni(), - ); - final NativeInteropAnEnum pigeonVar_dartTypeRes = NativeInteropAnEnum.fromJni( - pigeonVar_res, - )!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.echoAsyncEnumWithAnEnum( - ffi_bridge.NativeInteropAnEnum.values[anEnum.index], - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( - NSNumber? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum)! - as NativeInteropAnEnum, - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future echoAsyncEnum(NativeInteropAnEnum anEnum); - Future echoAnotherAsyncEnum( - NativeInteropAnotherEnum anotherEnum, - ) async { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAnotherEnum pigeonVar_res = await _jniApi - .echoAnotherAsyncEnum(anotherEnum.toJni()); - final NativeInteropAnotherEnum pigeonVar_dartTypeRes = NativeInteropAnotherEnum.fromJni( - pigeonVar_res, - )!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = - Completer(); - _ffiApi.echoAnotherAsyncEnumWithAnotherEnum( - ffi_bridge.NativeInteropAnotherEnum.values[anotherEnum.index], - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( - NSNumber? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnotherEnum)! - as NativeInteropAnotherEnum, - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future echoAnotherAsyncEnum(NativeInteropAnotherEnum anotherEnum); - Future throwAsyncError() async { - try { - if (_jniApi != null) { - final JObject? pigeonVar_res = await _jniApi.throwAsyncError(); - final Object? pigeonVar_dartTypeRes = _PigeonJniCodec.readValue(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.throwAsyncErrorWithWrappedError( - pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSObject.listener(( - NSObject? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(_PigeonFfiCodec.readValue(pigeonVar_res)); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future throwAsyncError(); - Future throwAsyncErrorFromVoid() async { - try { - if (_jniApi != null) { - await _jniApi.throwAsyncErrorFromVoid(); - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.throwAsyncErrorFromVoidWithWrappedError( - pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid.listener(() { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future throwAsyncErrorFromVoid(); - Future throwAsyncFlutterError() async { - try { - if (_jniApi != null) { - final JObject? pigeonVar_res = await _jniApi.throwAsyncFlutterError(); - final Object? pigeonVar_dartTypeRes = _PigeonJniCodec.readValue(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.throwAsyncFlutterErrorWithWrappedError( - pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSObject.listener(( - NSObject? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(_PigeonFfiCodec.readValue(pigeonVar_res)); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future throwAsyncFlutterError(); - Future echoAsyncNativeInteropAllTypes( - NativeInteropAllTypes everything, - ) async { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAllTypes pigeonVar_res = await _jniApi - .echoAsyncNativeInteropAllTypes(everything.toJni()); - final NativeInteropAllTypes pigeonVar_dartTypeRes = NativeInteropAllTypes.fromJni( - pigeonVar_res, - )!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = - Completer(); - _ffiApi.echoAsyncNativeInteropAllTypesWithEverything( - everything.toFfi(), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllTypesBridge.listener(( - ffi_bridge.NativeInteropAllTypesBridge? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(NativeInteropAllTypes.fromFfi(pigeonVar_res)!); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future echoAsyncNativeInteropAllTypes(NativeInteropAllTypes everything); - Future echoAsyncSealedClass( - NativeInteropSealedClass sealedClass, - ) async { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropSealedClass pigeonVar_res = await _jniApi - .echoAsyncSealedClass(sealedClass.toJni()); - final NativeInteropSealedClass pigeonVar_dartTypeRes = NativeInteropSealedClass.fromJni( - pigeonVar_res, - )!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = - Completer(); - _ffiApi.echoAsyncSealedClassWithSealedClass( - sealedClass.toFfi(), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NativeInteropSealedClassBridge.listener(( - ffi_bridge.NativeInteropSealedClassBridge? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(NativeInteropSealedClass.fromFfi(pigeonVar_res)!); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future echoAsyncSealedClass(NativeInteropSealedClass sealedClass); Future echoAsyncNullableNativeInteropAllNullableTypes( NativeInteropAllNullableTypes? everything, - ) async { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAllNullableTypes? pigeonVar_res = await _jniApi - .echoAsyncNullableNativeInteropAllNullableTypes(everything?.toJni()); - final NativeInteropAllNullableTypes? pigeonVar_dartTypeRes = - NativeInteropAllNullableTypes.fromJni(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = - Completer(); - _ffiApi.echoAsyncNullableNativeInteropAllNullableTypesWithEverything( - everything?.toFfi(), - wrappedError: pigeonVar_error, - completionHandler: - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllNullableTypesBridge.listener(( - ffi_bridge.NativeInteropAllNullableTypesBridge? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - NativeInteropAllNullableTypes.fromFfi(pigeonVar_res), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); Future echoAsyncNullableNativeInteropAllNullableTypesWithoutRecursion( NativeInteropAllNullableTypesWithoutRecursion? everything, - ) async { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAllNullableTypesWithoutRecursion? pigeonVar_res = - await _jniApi.echoAsyncNullableNativeInteropAllNullableTypesWithoutRecursion( - everything?.toJni(), - ); - final NativeInteropAllNullableTypesWithoutRecursion? pigeonVar_dartTypeRes = - NativeInteropAllNullableTypesWithoutRecursion.fromJni(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = - Completer(); - _ffiApi.echoAsyncNullableNativeInteropAllNullableTypesWithoutRecursionWithEverything( - everything?.toFfi(), - wrappedError: pigeonVar_error, - completionHandler: - ffi_bridge - .ObjCBlock_ffiVoid_NativeInteropAllNullableTypesWithoutRecursionBridge.listener(( - ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - NativeInteropAllNullableTypesWithoutRecursion.fromFfi(pigeonVar_res), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - Future echoAsyncNullableInt(int? anInt) async { - try { - if (_jniApi != null) { - final JLong? pigeonVar_res = await _jniApi.echoAsyncNullableInt( - _PigeonJniCodec.writeValue(anInt), - ); - final int? pigeonVar_dartTypeRes = pigeonVar_res?.toDartInt(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.echoAsyncNullableIntWithAnInt( - _PigeonFfiCodec.writeValue(anInt), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( - NSNumber? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(pigeonVar_res?.longValue); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future echoAsyncNullableInt(int? anInt); - Future echoAsyncNullableDouble(double? aDouble) async { - try { - if (_jniApi != null) { - final JDouble? pigeonVar_res = await _jniApi.echoAsyncNullableDouble( - _PigeonJniCodec.writeValue(aDouble), - ); - final double? pigeonVar_dartTypeRes = pigeonVar_res?.toDartDouble(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.echoAsyncNullableDoubleWithADouble( - _PigeonFfiCodec.writeValue(aDouble), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( - NSNumber? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(pigeonVar_res?.doubleValue); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future echoAsyncNullableDouble(double? aDouble); - Future echoAsyncNullableBool(bool? aBool) async { - try { - if (_jniApi != null) { - final JBoolean? pigeonVar_res = await _jniApi.echoAsyncNullableBool( - _PigeonJniCodec.writeValue(aBool), - ); - final bool? pigeonVar_dartTypeRes = pigeonVar_res?.toDartBool(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.echoAsyncNullableBoolWithABool( - _PigeonFfiCodec.writeValue(aBool), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( - NSNumber? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(pigeonVar_res?.boolValue); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future echoAsyncNullableBool(bool? aBool); - Future echoAsyncNullableString(String? aString) async { - try { - if (_jniApi != null) { - final JString? pigeonVar_res = await _jniApi.echoAsyncNullableString( - _PigeonJniCodec.writeValue(aString), - ); - final String? pigeonVar_dartTypeRes = pigeonVar_res?.toDartString(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.echoAsyncNullableStringWithAString( - _PigeonFfiCodec.writeValue(aString), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSString.listener(( - NSString? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(pigeonVar_res?.toDartString()); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future echoAsyncNullableString(String? aString); - Future echoAsyncNullableUint8List(Uint8List? aUint8List) async { - try { - if (_jniApi != null) { - final JByteArray? pigeonVar_res = await _jniApi.echoAsyncNullableUint8List( - _PigeonJniCodec.writeValue(aUint8List), - ); - final Uint8List? pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res) as Uint8List?; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.echoAsyncNullableUint8ListWithAUint8List( - _PigeonFfiCodec.writeValue(aUint8List), - wrappedError: pigeonVar_error, - completionHandler: - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( - ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - _PigeonFfiCodec.readValue(pigeonVar_res) as Uint8List?, - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future echoAsyncNullableUint8List(Uint8List? aUint8List); - Future echoAsyncNullableInt32List(Int32List? aInt32List) async { - try { - if (_jniApi != null) { - final JIntArray? pigeonVar_res = await _jniApi.echoAsyncNullableInt32List( - _PigeonJniCodec.writeValue(aInt32List), - ); - final Int32List? pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res) as Int32List?; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.echoAsyncNullableInt32ListWithAInt32List( - _PigeonFfiCodec.writeValue(aInt32List), - wrappedError: pigeonVar_error, - completionHandler: - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( - ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - _PigeonFfiCodec.readValue(pigeonVar_res) as Int32List?, - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future echoAsyncNullableInt32List(Int32List? aInt32List); - Future echoAsyncNullableInt64List(Int64List? aInt64List) async { - try { - if (_jniApi != null) { - final JLongArray? pigeonVar_res = await _jniApi.echoAsyncNullableInt64List( - _PigeonJniCodec.writeValue(aInt64List), - ); - final Int64List? pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res) as Int64List?; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.echoAsyncNullableInt64ListWithAInt64List( - _PigeonFfiCodec.writeValue(aInt64List), - wrappedError: pigeonVar_error, - completionHandler: - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( - ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - _PigeonFfiCodec.readValue(pigeonVar_res) as Int64List?, - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future echoAsyncNullableInt64List(Int64List? aInt64List); - Future echoAsyncNullableFloat64List(Float64List? aFloat64List) async { - try { - if (_jniApi != null) { - final JDoubleArray? pigeonVar_res = await _jniApi.echoAsyncNullableFloat64List( - _PigeonJniCodec.writeValue(aFloat64List), - ); - final Float64List? pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res) as Float64List?; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.echoAsyncNullableFloat64ListWithAFloat64List( - _PigeonFfiCodec.writeValue(aFloat64List), - wrappedError: pigeonVar_error, - completionHandler: - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( - ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - _PigeonFfiCodec.readValue(pigeonVar_res) as Float64List?, - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future echoAsyncNullableFloat64List(Float64List? aFloat64List); - Future echoAsyncNullableObject(Object? anObject) async { - try { - if (_jniApi != null) { - final JObject? pigeonVar_res = await _jniApi.echoAsyncNullableObject( - _PigeonJniCodec.writeValue(anObject), - ); - final Object? pigeonVar_dartTypeRes = _PigeonJniCodec.readValue(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.echoAsyncNullableObjectWithAnObject( - _PigeonFfiCodec.writeValue(anObject, generic: true), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSObject.listener(( - NSObject? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(_PigeonFfiCodec.readValue(pigeonVar_res)); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future echoAsyncNullableObject(Object? anObject); - Future?> echoAsyncNullableList(List? list) async { - try { - if (_jniApi != null) { - final JList? pigeonVar_res = await _jniApi.echoAsyncNullableList( - _PigeonJniCodec.writeValue?>(list), - ); - final List? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as List?)?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer?> pigeonVar_completer = Completer?>(); - _ffiApi.echoAsyncNullableListWithList( - _PigeonFfiCodec.writeValue(list), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( - NSArray? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res) as List?)?.cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future?> echoAsyncNullableList(List? list); Future?> echoAsyncNullableEnumList( List? enumList, - ) async { - try { - if (_jniApi != null) { - final JList? pigeonVar_res = await _jniApi - .echoAsyncNullableEnumList( - _PigeonJniCodec.writeValue?>(enumList), - ); - final List? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as List?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer?> pigeonVar_completer = - Completer?>(); - _ffiApi.echoAsyncNullableEnumListWithEnumList( - _PigeonFfiCodec.writeValue(enumList), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( - NSArray? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum) as List?) - ?.cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); Future?> echoAsyncNullableClassList( List? classList, - ) async { - try { - if (_jniApi != null) { - final JList? pigeonVar_res = await _jniApi - .echoAsyncNullableClassList( - _PigeonJniCodec.writeValue?>( - classList, - ), - ); - final List? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as List?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer?> pigeonVar_completer = - Completer?>(); - _ffiApi.echoAsyncNullableClassListWithClassList( - _PigeonFfiCodec.writeValue(classList), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( - NSArray? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res) as List?) - ?.cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - Future?> echoAsyncNullableMap(Map? map) async { - try { - if (_jniApi != null) { - final JMap? pigeonVar_res = await _jniApi.echoAsyncNullableMap( - _PigeonJniCodec.writeValue?>(map), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer?> pigeonVar_completer = - Completer?>(); - _ffiApi.echoAsyncNullableMapWithMap( - _PigeonFfiCodec.writeValue(map), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( - NSDictionary? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res) as Map?) - ?.cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future?> echoAsyncNullableMap(Map? map); - Future?> echoAsyncNullableStringMap( - Map? stringMap, - ) async { - try { - if (_jniApi != null) { - final JMap? pigeonVar_res = await _jniApi.echoAsyncNullableStringMap( - _PigeonJniCodec.writeValue?>(stringMap), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer?> pigeonVar_completer = - Completer?>(); - _ffiApi.echoAsyncNullableStringMapWithStringMap( - _PigeonFfiCodec.writeValue(stringMap), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( - NSDictionary? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res) as Map?) - ?.cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future?> echoAsyncNullableStringMap(Map? stringMap); - Future?> echoAsyncNullableIntMap(Map? intMap) async { - try { - if (_jniApi != null) { - final JMap? pigeonVar_res = await _jniApi.echoAsyncNullableIntMap( - _PigeonJniCodec.writeValue?>(intMap), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer?> pigeonVar_completer = Completer?>(); - _ffiApi.echoAsyncNullableIntMapWithIntMap( - _PigeonFfiCodec.writeValue(intMap), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( - NSDictionary? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res, int, int) as Map?) - ?.cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future?> echoAsyncNullableIntMap(Map? intMap); Future?> echoAsyncNullableEnumMap( Map? enumMap, - ) async { - try { - if (_jniApi != null) { - final JMap? - pigeonVar_res = await _jniApi.echoAsyncNullableEnumMap( - _PigeonJniCodec.writeValue< - JMap? - >(enumMap), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer?> pigeonVar_completer = - Completer?>(); - _ffiApi.echoAsyncNullableEnumMapWithEnumMap( - _PigeonFfiCodec.writeValue(enumMap), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( - NSDictionary? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum, NativeInteropAnEnum) - as Map?) - ?.cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); Future?> echoAsyncNullableClassMap( Map? classMap, - ) async { - try { - if (_jniApi != null) { - final JMap? pigeonVar_res = await _jniApi - .echoAsyncNullableClassMap( - _PigeonJniCodec.writeValue?>( - classMap, - ), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer?> pigeonVar_completer = - Completer?>(); - _ffiApi.echoAsyncNullableClassMapWithClassMap( - _PigeonFfiCodec.writeValue(classMap), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( - NSDictionary? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res, int) as Map?) - ?.cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - Future echoAsyncNullableEnum(NativeInteropAnEnum? anEnum) async { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAnEnum? pigeonVar_res = await _jniApi.echoAsyncNullableEnum( - anEnum?.toJni(), - ); - final NativeInteropAnEnum? pigeonVar_dartTypeRes = NativeInteropAnEnum.fromJni( - pigeonVar_res, - ); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = - Completer(); - _ffiApi.echoAsyncNullableEnumWithAnEnum( - _PigeonFfiCodec.writeValue(anEnum), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( - NSNumber? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum) - as NativeInteropAnEnum?, - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future echoAsyncNullableEnum(NativeInteropAnEnum? anEnum); Future echoAnotherAsyncNullableEnum( NativeInteropAnotherEnum? anotherEnum, - ) async { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAnotherEnum? pigeonVar_res = await _jniApi - .echoAnotherAsyncNullableEnum(anotherEnum?.toJni()); - final NativeInteropAnotherEnum? pigeonVar_dartTypeRes = NativeInteropAnotherEnum.fromJni( - pigeonVar_res, - ); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = - Completer(); - _ffiApi.echoAnotherAsyncNullableEnumWithAnotherEnum( - _PigeonFfiCodec.writeValue(anotherEnum), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( - NSNumber? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnotherEnum) - as NativeInteropAnotherEnum?, - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - void callFlutterNoop() { - try { - if (_jniApi != null) { - return _jniApi.callFlutterNoop(); - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - _ffiApi.callFlutterNoopWithWrappedError(pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - return; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + void callFlutterNoop(); - Object? callFlutterThrowError() { - try { - if (_jniApi != null) { - final JObject? pigeonVar_res = _jniApi.callFlutterThrowError(); - final Object? pigeonVar_dartTypeRes = _PigeonJniCodec.readValue(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSObject? pigeonVar_res = _ffiApi.callFlutterThrowErrorWithWrappedError( - pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Object? pigeonVar_dartTypeRes = _PigeonFfiCodec.readValue(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Object? callFlutterThrowError(); - void callFlutterThrowErrorFromVoid() { - try { - if (_jniApi != null) { - return _jniApi.callFlutterThrowErrorFromVoid(); - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - _ffiApi.callFlutterThrowErrorFromVoidWithWrappedError(pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - return; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } - - NativeInteropAllTypes callFlutterEchoNativeInteropAllTypes(NativeInteropAllTypes everything) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAllTypes pigeonVar_res = _jniApi - .callFlutterEchoNativeInteropAllTypes(everything.toJni()); - final NativeInteropAllTypes pigeonVar_dartTypeRes = NativeInteropAllTypes.fromJni( - pigeonVar_res, - )!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropAllTypesBridge? pigeonVar_res = _ffiApi - .callFlutterEchoNativeInteropAllTypesWithEverything( - everything.toFfi(), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final NativeInteropAllTypes pigeonVar_dartTypeRes = NativeInteropAllTypes.fromFfi( - pigeonVar_res, - )!; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + void callFlutterThrowErrorFromVoid(); + + NativeInteropAllTypes callFlutterEchoNativeInteropAllTypes(NativeInteropAllTypes everything); NativeInteropAllNullableTypes? callFlutterEchoNativeInteropAllNullableTypes( NativeInteropAllNullableTypes? everything, - ) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAllNullableTypes? pigeonVar_res = _jniApi - .callFlutterEchoNativeInteropAllNullableTypes(everything?.toJni()); - final NativeInteropAllNullableTypes? pigeonVar_dartTypeRes = - NativeInteropAllNullableTypes.fromJni(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropAllNullableTypesBridge? pigeonVar_res = _ffiApi - .callFlutterEchoNativeInteropAllNullableTypesWithEverything( - everything?.toFfi(), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final NativeInteropAllNullableTypes? pigeonVar_dartTypeRes = - NativeInteropAllNullableTypes.fromFfi(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } - - NativeInteropSealedClass callFlutterEchoSealedClass(NativeInteropSealedClass sealedClass) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropSealedClass pigeonVar_res = _jniApi - .callFlutterEchoSealedClass(sealedClass.toJni()); - final NativeInteropSealedClass pigeonVar_dartTypeRes = NativeInteropSealedClass.fromJni( - pigeonVar_res, - )!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropSealedClassBridge? pigeonVar_res = _ffiApi - .callFlutterEchoSealedClassWithSealedClass( - sealedClass.toFfi(), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final NativeInteropSealedClass pigeonVar_dartTypeRes = NativeInteropSealedClass.fromFfi( - pigeonVar_res, - )!; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); + + NativeInteropSealedClass callFlutterEchoSealedClass(NativeInteropSealedClass sealedClass); NativeInteropAllNullableTypes callFlutterSendMultipleNullableTypes( bool? aNullableBool, int? aNullableInt, String? aNullableString, - ) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAllNullableTypes pigeonVar_res = _jniApi - .callFlutterSendMultipleNullableTypes( - _PigeonJniCodec.writeValue(aNullableBool), - _PigeonJniCodec.writeValue(aNullableInt), - _PigeonJniCodec.writeValue(aNullableString), - ); - final NativeInteropAllNullableTypes pigeonVar_dartTypeRes = - NativeInteropAllNullableTypes.fromJni(pigeonVar_res)!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropAllNullableTypesBridge? pigeonVar_res = _ffiApi - .callFlutterSendMultipleNullableTypesWithANullableBool( - _PigeonFfiCodec.writeValue(aNullableBool), - aNullableInt: _PigeonFfiCodec.writeValue(aNullableInt), - aNullableString: _PigeonFfiCodec.writeValue(aNullableString), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final NativeInteropAllNullableTypes pigeonVar_dartTypeRes = - NativeInteropAllNullableTypes.fromFfi(pigeonVar_res)!; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); NativeInteropAllNullableTypesWithoutRecursion? callFlutterEchoNativeInteropAllNullableTypesWithoutRecursion( NativeInteropAllNullableTypesWithoutRecursion? everything, - ) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAllNullableTypesWithoutRecursion? pigeonVar_res = _jniApi - .callFlutterEchoNativeInteropAllNullableTypesWithoutRecursion(everything?.toJni()); - final NativeInteropAllNullableTypesWithoutRecursion? pigeonVar_dartTypeRes = - NativeInteropAllNullableTypesWithoutRecursion.fromJni(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge? pigeonVar_res = - _ffiApi.callFlutterEchoNativeInteropAllNullableTypesWithoutRecursionWithEverything( - everything?.toFfi(), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final NativeInteropAllNullableTypesWithoutRecursion? pigeonVar_dartTypeRes = - NativeInteropAllNullableTypesWithoutRecursion.fromFfi(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); NativeInteropAllNullableTypesWithoutRecursion callFlutterSendMultipleNullableTypesWithoutRecursion( bool? aNullableBool, int? aNullableInt, String? aNullableString, - ) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAllNullableTypesWithoutRecursion pigeonVar_res = _jniApi - .callFlutterSendMultipleNullableTypesWithoutRecursion( - _PigeonJniCodec.writeValue(aNullableBool), - _PigeonJniCodec.writeValue(aNullableInt), - _PigeonJniCodec.writeValue(aNullableString), - ); - final NativeInteropAllNullableTypesWithoutRecursion pigeonVar_dartTypeRes = - NativeInteropAllNullableTypesWithoutRecursion.fromJni(pigeonVar_res)!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge? pigeonVar_res = - _ffiApi.callFlutterSendMultipleNullableTypesWithoutRecursionWithANullableBool( - _PigeonFfiCodec.writeValue(aNullableBool), - aNullableInt: _PigeonFfiCodec.writeValue(aNullableInt), - aNullableString: _PigeonFfiCodec.writeValue(aNullableString), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final NativeInteropAllNullableTypesWithoutRecursion pigeonVar_dartTypeRes = - NativeInteropAllNullableTypesWithoutRecursion.fromFfi(pigeonVar_res)!; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - bool callFlutterEchoBool(bool aBool) { - try { - if (_jniApi != null) { - return _jniApi.callFlutterEchoBool(aBool); - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.callFlutterEchoBoolWithABool( - aBool, - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final bool pigeonVar_dartTypeRes = pigeonVar_res!.boolValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + bool callFlutterEchoBool(bool aBool); - int callFlutterEchoInt(int anInt) { - try { - if (_jniApi != null) { - return _jniApi.callFlutterEchoInt(anInt); - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.callFlutterEchoIntWithAnInt( - anInt, - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final int pigeonVar_dartTypeRes = pigeonVar_res!.longValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + int callFlutterEchoInt(int anInt); - double callFlutterEchoDouble(double aDouble) { - try { - if (_jniApi != null) { - return _jniApi.callFlutterEchoDouble(aDouble); - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.callFlutterEchoDoubleWithADouble( - aDouble, - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final double pigeonVar_dartTypeRes = pigeonVar_res!.doubleValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + double callFlutterEchoDouble(double aDouble); - String callFlutterEchoString(String aString) { - try { - if (_jniApi != null) { - final JString pigeonVar_res = _jniApi.callFlutterEchoString( - _PigeonJniCodec.writeValue(aString), - ); - final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSString? pigeonVar_res = _ffiApi.callFlutterEchoStringWithAString( - _PigeonFfiCodec.writeValue(aString), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final String pigeonVar_dartTypeRes = pigeonVar_res!.toDartString(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + String callFlutterEchoString(String aString); - Uint8List callFlutterEchoUint8List(Uint8List list) { - try { - if (_jniApi != null) { - final JByteArray pigeonVar_res = _jniApi.callFlutterEchoUint8List( - _PigeonJniCodec.writeValue(list), - ); - final Uint8List pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res)! as Uint8List; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi - .callFlutterEchoUint8ListWithList( - _PigeonFfiCodec.writeValue(list), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Uint8List pigeonVar_dartTypeRes = - _PigeonFfiCodec.readValue(pigeonVar_res)! as Uint8List; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Uint8List callFlutterEchoUint8List(Uint8List list); - Int32List callFlutterEchoInt32List(Int32List list) { - try { - if (_jniApi != null) { - final JIntArray pigeonVar_res = _jniApi.callFlutterEchoInt32List( - _PigeonJniCodec.writeValue(list), - ); - final Int32List pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res)! as Int32List; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi - .callFlutterEchoInt32ListWithList( - _PigeonFfiCodec.writeValue(list), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Int32List pigeonVar_dartTypeRes = - _PigeonFfiCodec.readValue(pigeonVar_res)! as Int32List; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Int32List callFlutterEchoInt32List(Int32List list); - Int64List callFlutterEchoInt64List(Int64List list) { - try { - if (_jniApi != null) { - final JLongArray pigeonVar_res = _jniApi.callFlutterEchoInt64List( - _PigeonJniCodec.writeValue(list), - ); - final Int64List pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res)! as Int64List; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi - .callFlutterEchoInt64ListWithList( - _PigeonFfiCodec.writeValue(list), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Int64List pigeonVar_dartTypeRes = - _PigeonFfiCodec.readValue(pigeonVar_res)! as Int64List; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Int64List callFlutterEchoInt64List(Int64List list); - Float64List callFlutterEchoFloat64List(Float64List list) { - try { - if (_jniApi != null) { - final JDoubleArray pigeonVar_res = _jniApi.callFlutterEchoFloat64List( - _PigeonJniCodec.writeValue(list), - ); - final Float64List pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res)! as Float64List; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi - .callFlutterEchoFloat64ListWithList( - _PigeonFfiCodec.writeValue(list), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Float64List pigeonVar_dartTypeRes = - _PigeonFfiCodec.readValue(pigeonVar_res)! as Float64List; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Float64List callFlutterEchoFloat64List(Float64List list); - List callFlutterEchoList(List list) { - try { - if (_jniApi != null) { - final JList pigeonVar_res = _jniApi.callFlutterEchoList( - _PigeonJniCodec.writeValue>(list), - ); - final List pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as List).cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.callFlutterEchoListWithList( - _PigeonFfiCodec.writeValue(list), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res)! as List).cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + List callFlutterEchoList(List list); - List callFlutterEchoEnumList(List enumList) { - try { - if (_jniApi != null) { - final JList pigeonVar_res = _jniApi - .callFlutterEchoEnumList( - _PigeonJniCodec.writeValue>(enumList), - ); - final List pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as List) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.callFlutterEchoEnumListWithEnumList( - _PigeonFfiCodec.writeValue(enumList), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum)! as List) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + List callFlutterEchoEnumList(List enumList); List callFlutterEchoClassList( List classList, - ) { - try { - if (_jniApi != null) { - final JList pigeonVar_res = _jniApi - .callFlutterEchoClassList( - _PigeonJniCodec.writeValue>( - classList, - ), - ); - final List pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as List) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.callFlutterEchoClassListWithClassList( - _PigeonFfiCodec.writeValue(classList), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res)! as List) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - List callFlutterEchoNonNullEnumList(List enumList) { - try { - if (_jniApi != null) { - final JList pigeonVar_res = _jniApi - .callFlutterEchoNonNullEnumList( - _PigeonJniCodec.writeValue>(enumList), - ); - final List pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as List) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.callFlutterEchoNonNullEnumListWithEnumList( - _PigeonFfiCodec.writeValue(enumList), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum)! as List) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + List callFlutterEchoNonNullEnumList(List enumList); List callFlutterEchoNonNullClassList( List classList, - ) { - try { - if (_jniApi != null) { - final JList pigeonVar_res = _jniApi - .callFlutterEchoNonNullClassList( - _PigeonJniCodec.writeValue>( - classList, - ), - ); - final List pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as List) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.callFlutterEchoNonNullClassListWithClassList( - _PigeonFfiCodec.writeValue(classList), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res)! as List) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - Map callFlutterEchoMap(Map map) { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = _jniApi.callFlutterEchoMap( - _PigeonJniCodec.writeValue>(map), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoMapWithMap( - _PigeonFfiCodec.writeValue(map), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Map callFlutterEchoMap(Map map); - Map callFlutterEchoStringMap(Map stringMap) { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = _jniApi.callFlutterEchoStringMap( - _PigeonJniCodec.writeValue>(stringMap), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoStringMapWithStringMap( - _PigeonFfiCodec.writeValue(stringMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Map callFlutterEchoStringMap(Map stringMap); - Map callFlutterEchoIntMap(Map intMap) { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = _jniApi.callFlutterEchoIntMap( - _PigeonJniCodec.writeValue>(intMap), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map).cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoIntMapWithIntMap( - _PigeonFfiCodec.writeValue(intMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, int, int)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Map callFlutterEchoIntMap(Map intMap); Map callFlutterEchoEnumMap( Map enumMap, - ) { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = - _jniApi.callFlutterEchoEnumMap( - _PigeonJniCodec.writeValue< - JMap - >(enumMap), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoEnumMapWithEnumMap( - _PigeonFfiCodec.writeValue(enumMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum, NativeInteropAnEnum)! - as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); Map callFlutterEchoClassMap( Map classMap, - ) { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = _jniApi - .callFlutterEchoClassMap( - _PigeonJniCodec.writeValue>( - classMap, - ), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoClassMapWithClassMap( - _PigeonFfiCodec.writeValue(classMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, int)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - Map callFlutterEchoNonNullStringMap(Map stringMap) { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = _jniApi.callFlutterEchoNonNullStringMap( - _PigeonJniCodec.writeValue>(stringMap), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoNonNullStringMapWithStringMap( - _PigeonFfiCodec.writeValue(stringMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Map callFlutterEchoNonNullStringMap(Map stringMap); - Map callFlutterEchoNonNullIntMap(Map intMap) { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = _jniApi.callFlutterEchoNonNullIntMap( - _PigeonJniCodec.writeValue>(intMap), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map).cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoNonNullIntMapWithIntMap( - _PigeonFfiCodec.writeValue(intMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, int, int)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Map callFlutterEchoNonNullIntMap(Map intMap); Map callFlutterEchoNonNullEnumMap( Map enumMap, - ) { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = - _jniApi.callFlutterEchoNonNullEnumMap( - _PigeonJniCodec.writeValue< - JMap - >(enumMap), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoNonNullEnumMapWithEnumMap( - _PigeonFfiCodec.writeValue(enumMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum, NativeInteropAnEnum)! - as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); Map callFlutterEchoNonNullClassMap( Map classMap, - ) { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = _jniApi - .callFlutterEchoNonNullClassMap( - _PigeonJniCodec.writeValue>( - classMap, - ), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoNonNullClassMapWithClassMap( - _PigeonFfiCodec.writeValue(classMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, int)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - NativeInteropAnEnum callFlutterEchoEnum(NativeInteropAnEnum anEnum) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAnEnum pigeonVar_res = _jniApi.callFlutterEchoEnum( - anEnum.toJni(), - ); - final NativeInteropAnEnum pigeonVar_dartTypeRes = NativeInteropAnEnum.fromJni( - pigeonVar_res, - )!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.callFlutterEchoEnumWithAnEnum( - ffi_bridge.NativeInteropAnEnum.values[anEnum.index], - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final NativeInteropAnEnum pigeonVar_dartTypeRes = - _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum)! as NativeInteropAnEnum; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + NativeInteropAnEnum callFlutterEchoEnum(NativeInteropAnEnum anEnum); NativeInteropAnotherEnum callFlutterEchoNativeInteropAnotherEnum( NativeInteropAnotherEnum anotherEnum, - ) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAnotherEnum pigeonVar_res = _jniApi - .callFlutterEchoNativeInteropAnotherEnum(anotherEnum.toJni()); - final NativeInteropAnotherEnum pigeonVar_dartTypeRes = NativeInteropAnotherEnum.fromJni( - pigeonVar_res, - )!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi - .callFlutterEchoNativeInteropAnotherEnumWithAnotherEnum( - ffi_bridge.NativeInteropAnotherEnum.values[anotherEnum.index], - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final NativeInteropAnotherEnum pigeonVar_dartTypeRes = - _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnotherEnum)! - as NativeInteropAnotherEnum; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - bool? callFlutterEchoNullableBool(bool? aBool) { - try { - if (_jniApi != null) { - final JBoolean? pigeonVar_res = _jniApi.callFlutterEchoNullableBool( - _PigeonJniCodec.writeValue(aBool), - ); - final bool? pigeonVar_dartTypeRes = pigeonVar_res?.toDartBool(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.callFlutterEchoNullableBoolWithABool( - _PigeonFfiCodec.writeValue(aBool), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final bool? pigeonVar_dartTypeRes = pigeonVar_res?.boolValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + bool? callFlutterEchoNullableBool(bool? aBool); - int? callFlutterEchoNullableInt(int? anInt) { - try { - if (_jniApi != null) { - final JLong? pigeonVar_res = _jniApi.callFlutterEchoNullableInt( - _PigeonJniCodec.writeValue(anInt), - ); - final int? pigeonVar_dartTypeRes = pigeonVar_res?.toDartInt(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.callFlutterEchoNullableIntWithAnInt( - _PigeonFfiCodec.writeValue(anInt), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final int? pigeonVar_dartTypeRes = pigeonVar_res?.longValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + int? callFlutterEchoNullableInt(int? anInt); - double? callFlutterEchoNullableDouble(double? aDouble) { - try { - if (_jniApi != null) { - final JDouble? pigeonVar_res = _jniApi.callFlutterEchoNullableDouble( - _PigeonJniCodec.writeValue(aDouble), - ); - final double? pigeonVar_dartTypeRes = pigeonVar_res?.toDartDouble(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.callFlutterEchoNullableDoubleWithADouble( - _PigeonFfiCodec.writeValue(aDouble), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final double? pigeonVar_dartTypeRes = pigeonVar_res?.doubleValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + double? callFlutterEchoNullableDouble(double? aDouble); - String? callFlutterEchoNullableString(String? aString) { - try { - if (_jniApi != null) { - final JString? pigeonVar_res = _jniApi.callFlutterEchoNullableString( - _PigeonJniCodec.writeValue(aString), - ); - final String? pigeonVar_dartTypeRes = pigeonVar_res?.toDartString(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSString? pigeonVar_res = _ffiApi.callFlutterEchoNullableStringWithAString( - _PigeonFfiCodec.writeValue(aString), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final String? pigeonVar_dartTypeRes = pigeonVar_res?.toDartString(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + String? callFlutterEchoNullableString(String? aString); - Uint8List? callFlutterEchoNullableUint8List(Uint8List? list) { - try { - if (_jniApi != null) { - final JByteArray? pigeonVar_res = _jniApi.callFlutterEchoNullableUint8List( - _PigeonJniCodec.writeValue(list), - ); - final Uint8List? pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res) as Uint8List?; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi - .callFlutterEchoNullableUint8ListWithList( - _PigeonFfiCodec.writeValue(list), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Uint8List? pigeonVar_dartTypeRes = - _PigeonFfiCodec.readValue(pigeonVar_res) as Uint8List?; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Uint8List? callFlutterEchoNullableUint8List(Uint8List? list); - Int32List? callFlutterEchoNullableInt32List(Int32List? list) { - try { - if (_jniApi != null) { - final JIntArray? pigeonVar_res = _jniApi.callFlutterEchoNullableInt32List( - _PigeonJniCodec.writeValue(list), - ); - final Int32List? pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res) as Int32List?; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi - .callFlutterEchoNullableInt32ListWithList( - _PigeonFfiCodec.writeValue(list), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Int32List? pigeonVar_dartTypeRes = - _PigeonFfiCodec.readValue(pigeonVar_res) as Int32List?; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Int32List? callFlutterEchoNullableInt32List(Int32List? list); - Int64List? callFlutterEchoNullableInt64List(Int64List? list) { - try { - if (_jniApi != null) { - final JLongArray? pigeonVar_res = _jniApi.callFlutterEchoNullableInt64List( - _PigeonJniCodec.writeValue(list), - ); - final Int64List? pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res) as Int64List?; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi - .callFlutterEchoNullableInt64ListWithList( - _PigeonFfiCodec.writeValue(list), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Int64List? pigeonVar_dartTypeRes = - _PigeonFfiCodec.readValue(pigeonVar_res) as Int64List?; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Int64List? callFlutterEchoNullableInt64List(Int64List? list); - Float64List? callFlutterEchoNullableFloat64List(Float64List? list) { - try { - if (_jniApi != null) { - final JDoubleArray? pigeonVar_res = _jniApi.callFlutterEchoNullableFloat64List( - _PigeonJniCodec.writeValue(list), - ); - final Float64List? pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res) as Float64List?; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi - .callFlutterEchoNullableFloat64ListWithList( - _PigeonFfiCodec.writeValue(list), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Float64List? pigeonVar_dartTypeRes = - _PigeonFfiCodec.readValue(pigeonVar_res) as Float64List?; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Float64List? callFlutterEchoNullableFloat64List(Float64List? list); - List? callFlutterEchoNullableList(List? list) { - try { - if (_jniApi != null) { - final JList? pigeonVar_res = _jniApi.callFlutterEchoNullableList( - _PigeonJniCodec.writeValue?>(list), - ); - final List? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as List?)?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.callFlutterEchoNullableListWithList( - _PigeonFfiCodec.writeValue(list), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res) as List?)?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + List? callFlutterEchoNullableList(List? list); - List? callFlutterEchoNullableEnumList( - List? enumList, - ) { - try { - if (_jniApi != null) { - final JList? pigeonVar_res = _jniApi - .callFlutterEchoNullableEnumList( - _PigeonJniCodec.writeValue?>(enumList), - ); - final List? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as List?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.callFlutterEchoNullableEnumListWithEnumList( - _PigeonFfiCodec.writeValue(enumList), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum) as List?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + List? callFlutterEchoNullableEnumList(List? enumList); List? callFlutterEchoNullableClassList( List? classList, - ) { - try { - if (_jniApi != null) { - final JList? pigeonVar_res = _jniApi - .callFlutterEchoNullableClassList( - _PigeonJniCodec.writeValue?>( - classList, - ), - ); - final List? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as List?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.callFlutterEchoNullableClassListWithClassList( - _PigeonFfiCodec.writeValue(classList), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res) as List?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); List? callFlutterEchoNullableNonNullEnumList( List? enumList, - ) { - try { - if (_jniApi != null) { - final JList? pigeonVar_res = _jniApi - .callFlutterEchoNullableNonNullEnumList( - _PigeonJniCodec.writeValue?>(enumList), - ); - final List? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as List?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.callFlutterEchoNullableNonNullEnumListWithEnumList( - _PigeonFfiCodec.writeValue(enumList), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum) as List?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); List? callFlutterEchoNullableNonNullClassList( List? classList, - ) { - try { - if (_jniApi != null) { - final JList? pigeonVar_res = _jniApi - .callFlutterEchoNullableNonNullClassList( - _PigeonJniCodec.writeValue?>( - classList, - ), - ); - final List? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as List?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSArray? pigeonVar_res = _ffiApi.callFlutterEchoNullableNonNullClassListWithClassList( - _PigeonFfiCodec.writeValue(classList), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final List? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res) as List?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - Map? callFlutterEchoNullableMap(Map? map) { - try { - if (_jniApi != null) { - final JMap? pigeonVar_res = _jniApi.callFlutterEchoNullableMap( - _PigeonJniCodec.writeValue?>(map), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoNullableMapWithMap( - _PigeonFfiCodec.writeValue(map), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Map? callFlutterEchoNullableMap(Map? map); - Map? callFlutterEchoNullableStringMap(Map? stringMap) { - try { - if (_jniApi != null) { - final JMap? pigeonVar_res = _jniApi.callFlutterEchoNullableStringMap( - _PigeonJniCodec.writeValue?>(stringMap), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoNullableStringMapWithStringMap( - _PigeonFfiCodec.writeValue(stringMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Map? callFlutterEchoNullableStringMap(Map? stringMap); - Map? callFlutterEchoNullableIntMap(Map? intMap) { - try { - if (_jniApi != null) { - final JMap? pigeonVar_res = _jniApi.callFlutterEchoNullableIntMap( - _PigeonJniCodec.writeValue?>(intMap), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoNullableIntMapWithIntMap( - _PigeonFfiCodec.writeValue(intMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, int, int) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Map? callFlutterEchoNullableIntMap(Map? intMap); Map? callFlutterEchoNullableEnumMap( Map? enumMap, - ) { - try { - if (_jniApi != null) { - final JMap? - pigeonVar_res = _jniApi.callFlutterEchoNullableEnumMap( - _PigeonJniCodec.writeValue< - JMap? - >(enumMap), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoNullableEnumMapWithEnumMap( - _PigeonFfiCodec.writeValue(enumMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum, NativeInteropAnEnum) - as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); Map? callFlutterEchoNullableClassMap( Map? classMap, - ) { - try { - if (_jniApi != null) { - final JMap? pigeonVar_res = _jniApi - .callFlutterEchoNullableClassMap( - _PigeonJniCodec.writeValue?>( - classMap, - ), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoNullableClassMapWithClassMap( - _PigeonFfiCodec.writeValue(classMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, int) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - Map? callFlutterEchoNullableNonNullStringMap(Map? stringMap) { - try { - if (_jniApi != null) { - final JMap? pigeonVar_res = _jniApi - .callFlutterEchoNullableNonNullStringMap( - _PigeonJniCodec.writeValue?>(stringMap), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi - .callFlutterEchoNullableNonNullStringMapWithStringMap( - _PigeonFfiCodec.writeValue(stringMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Map? callFlutterEchoNullableNonNullStringMap(Map? stringMap); - Map? callFlutterEchoNullableNonNullIntMap(Map? intMap) { - try { - if (_jniApi != null) { - final JMap? pigeonVar_res = _jniApi.callFlutterEchoNullableNonNullIntMap( - _PigeonJniCodec.writeValue?>(intMap), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?)?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoNullableNonNullIntMapWithIntMap( - _PigeonFfiCodec.writeValue(intMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, int, int) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Map? callFlutterEchoNullableNonNullIntMap(Map? intMap); Map? callFlutterEchoNullableNonNullEnumMap( Map? enumMap, - ) { - try { - if (_jniApi != null) { - final JMap? pigeonVar_res = - _jniApi.callFlutterEchoNullableNonNullEnumMap( - _PigeonJniCodec.writeValue< - JMap? - >(enumMap), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi - .callFlutterEchoNullableNonNullEnumMapWithEnumMap( - _PigeonFfiCodec.writeValue(enumMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum, NativeInteropAnEnum) - as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); Map? callFlutterEchoNullableNonNullClassMap( Map? classMap, - ) { - try { - if (_jniApi != null) { - final JMap? pigeonVar_res = _jniApi - .callFlutterEchoNullableNonNullClassMap( - _PigeonJniCodec.writeValue?>( - classMap, - ), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSDictionary? pigeonVar_res = _ffiApi - .callFlutterEchoNullableNonNullClassMapWithClassMap( - _PigeonFfiCodec.writeValue(classMap), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final Map? pigeonVar_dartTypeRes = - (_PigeonFfiCodec.readValue(pigeonVar_res, int) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - NativeInteropAnEnum? callFlutterEchoNullableEnum(NativeInteropAnEnum? anEnum) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAnEnum? pigeonVar_res = _jniApi.callFlutterEchoNullableEnum( - anEnum?.toJni(), - ); - final NativeInteropAnEnum? pigeonVar_dartTypeRes = NativeInteropAnEnum.fromJni( - pigeonVar_res, - ); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.callFlutterEchoNullableEnumWithAnEnum( - _PigeonFfiCodec.writeValue(anEnum), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final NativeInteropAnEnum? pigeonVar_dartTypeRes = - _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum) as NativeInteropAnEnum?; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + NativeInteropAnEnum? callFlutterEchoNullableEnum(NativeInteropAnEnum? anEnum); NativeInteropAnotherEnum? callFlutterEchoAnotherNullableEnum( NativeInteropAnotherEnum? anotherEnum, - ) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAnotherEnum? pigeonVar_res = _jniApi - .callFlutterEchoAnotherNullableEnum(anotherEnum?.toJni()); - final NativeInteropAnotherEnum? pigeonVar_dartTypeRes = NativeInteropAnotherEnum.fromJni( - pigeonVar_res, - ); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.callFlutterEchoAnotherNullableEnumWithAnotherEnum( - _PigeonFfiCodec.writeValue(anotherEnum), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final NativeInteropAnotherEnum? pigeonVar_dartTypeRes = - _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnotherEnum) - as NativeInteropAnotherEnum?; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - Future callFlutterNoopAsync() async { - try { - if (_jniApi != null) { - await _jniApi.callFlutterNoopAsync(); - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.callFlutterNoopAsyncWithWrappedError( - pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid.listener(() { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future callFlutterNoopAsync(); Future callFlutterEchoAsyncNativeInteropAllTypes( NativeInteropAllTypes everything, - ) async { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAllTypes pigeonVar_res = await _jniApi - .callFlutterEchoAsyncNativeInteropAllTypes(everything.toJni()); - final NativeInteropAllTypes pigeonVar_dartTypeRes = NativeInteropAllTypes.fromJni( - pigeonVar_res, - )!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = - Completer(); - _ffiApi.callFlutterEchoAsyncNativeInteropAllTypesWithEverything( - everything.toFfi(), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllTypesBridge.listener(( - ffi_bridge.NativeInteropAllTypesBridge? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(NativeInteropAllTypes.fromFfi(pigeonVar_res)!); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); Future callFlutterEchoAsyncNullableNativeInteropAllNullableTypes( NativeInteropAllNullableTypes? everything, - ) async { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAllNullableTypes? pigeonVar_res = await _jniApi - .callFlutterEchoAsyncNullableNativeInteropAllNullableTypes(everything?.toJni()); - final NativeInteropAllNullableTypes? pigeonVar_dartTypeRes = - NativeInteropAllNullableTypes.fromJni(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = - Completer(); - _ffiApi.callFlutterEchoAsyncNullableNativeInteropAllNullableTypesWithEverything( - everything?.toFfi(), - wrappedError: pigeonVar_error, - completionHandler: - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllNullableTypesBridge.listener(( - ffi_bridge.NativeInteropAllNullableTypesBridge? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - NativeInteropAllNullableTypes.fromFfi(pigeonVar_res), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); Future callFlutterEchoAsyncNullableNativeInteropAllNullableTypesWithoutRecursion( NativeInteropAllNullableTypesWithoutRecursion? everything, - ) async { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAllNullableTypesWithoutRecursion? pigeonVar_res = - await _jniApi.callFlutterEchoAsyncNullableNativeInteropAllNullableTypesWithoutRecursion( - everything?.toJni(), - ); - final NativeInteropAllNullableTypesWithoutRecursion? pigeonVar_dartTypeRes = - NativeInteropAllNullableTypesWithoutRecursion.fromJni(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = - Completer(); - _ffiApi - .callFlutterEchoAsyncNullableNativeInteropAllNullableTypesWithoutRecursionWithEverything( - everything?.toFfi(), - wrappedError: pigeonVar_error, - completionHandler: - ffi_bridge - .ObjCBlock_ffiVoid_NativeInteropAllNullableTypesWithoutRecursionBridge.listener( - ( - ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - NativeInteropAllNullableTypesWithoutRecursion.fromFfi(pigeonVar_res), - ); - } - }, - ), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - Future callFlutterEchoAsyncBool(bool aBool) async { - try { - if (_jniApi != null) { - final JBoolean pigeonVar_res = await _jniApi.callFlutterEchoAsyncBool(aBool); - final bool pigeonVar_dartTypeRes = pigeonVar_res.toDartBool(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.callFlutterEchoAsyncBoolWithABool( - aBool, - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( - NSNumber? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(pigeonVar_res!.boolValue); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future callFlutterEchoAsyncBool(bool aBool); - Future callFlutterEchoAsyncInt(int anInt) async { - try { - if (_jniApi != null) { - final JLong pigeonVar_res = await _jniApi.callFlutterEchoAsyncInt(anInt); - final int pigeonVar_dartTypeRes = pigeonVar_res.toDartInt(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.callFlutterEchoAsyncIntWithAnInt( - anInt, - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( - NSNumber? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(pigeonVar_res!.longValue); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future callFlutterEchoAsyncInt(int anInt); - Future callFlutterEchoAsyncDouble(double aDouble) async { - try { - if (_jniApi != null) { - final JDouble pigeonVar_res = await _jniApi.callFlutterEchoAsyncDouble(aDouble); - final double pigeonVar_dartTypeRes = pigeonVar_res.toDartDouble(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.callFlutterEchoAsyncDoubleWithADouble( - aDouble, - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( - NSNumber? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(pigeonVar_res!.doubleValue); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future callFlutterEchoAsyncDouble(double aDouble); - Future callFlutterEchoAsyncString(String aString) async { - try { - if (_jniApi != null) { - final JString pigeonVar_res = await _jniApi.callFlutterEchoAsyncString( - _PigeonJniCodec.writeValue(aString), - ); - final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.callFlutterEchoAsyncStringWithAString( - _PigeonFfiCodec.writeValue(aString), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSString.listener(( - NSString? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(pigeonVar_res!.toDartString()); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future callFlutterEchoAsyncString(String aString); - Future callFlutterEchoAsyncUint8List(Uint8List list) async { - try { - if (_jniApi != null) { - final JByteArray pigeonVar_res = await _jniApi.callFlutterEchoAsyncUint8List( - _PigeonJniCodec.writeValue(list), - ); - final Uint8List pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res)! as Uint8List; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.callFlutterEchoAsyncUint8ListWithList( - _PigeonFfiCodec.writeValue(list), - wrappedError: pigeonVar_error, - completionHandler: - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( - ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - _PigeonFfiCodec.readValue(pigeonVar_res)! as Uint8List, - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future callFlutterEchoAsyncUint8List(Uint8List list); - Future callFlutterEchoAsyncInt32List(Int32List list) async { - try { - if (_jniApi != null) { - final JIntArray pigeonVar_res = await _jniApi.callFlutterEchoAsyncInt32List( - _PigeonJniCodec.writeValue(list), - ); - final Int32List pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res)! as Int32List; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.callFlutterEchoAsyncInt32ListWithList( - _PigeonFfiCodec.writeValue(list), - wrappedError: pigeonVar_error, - completionHandler: - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( - ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - _PigeonFfiCodec.readValue(pigeonVar_res)! as Int32List, - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future callFlutterEchoAsyncInt32List(Int32List list); - Future callFlutterEchoAsyncInt64List(Int64List list) async { - try { - if (_jniApi != null) { - final JLongArray pigeonVar_res = await _jniApi.callFlutterEchoAsyncInt64List( - _PigeonJniCodec.writeValue(list), - ); - final Int64List pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res)! as Int64List; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.callFlutterEchoAsyncInt64ListWithList( - _PigeonFfiCodec.writeValue(list), - wrappedError: pigeonVar_error, - completionHandler: - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( - ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - _PigeonFfiCodec.readValue(pigeonVar_res)! as Int64List, - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future callFlutterEchoAsyncInt64List(Int64List list); - Future callFlutterEchoAsyncFloat64List(Float64List list) async { - try { - if (_jniApi != null) { - final JDoubleArray pigeonVar_res = await _jniApi.callFlutterEchoAsyncFloat64List( - _PigeonJniCodec.writeValue(list), - ); - final Float64List pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res)! as Float64List; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.callFlutterEchoAsyncFloat64ListWithList( - _PigeonFfiCodec.writeValue(list), - wrappedError: pigeonVar_error, - completionHandler: - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( - ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - _PigeonFfiCodec.readValue(pigeonVar_res)! as Float64List, - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future callFlutterEchoAsyncFloat64List(Float64List list); - Future callFlutterEchoAsyncObject(Object anObject) async { - try { - if (_jniApi != null) { - final JObject pigeonVar_res = await _jniApi.callFlutterEchoAsyncObject( - _PigeonJniCodec.writeValue(anObject), - ); - final Object pigeonVar_dartTypeRes = _PigeonJniCodec.readValue(pigeonVar_res)!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.callFlutterEchoAsyncObjectWithAnObject( - _PigeonFfiCodec.writeValue(anObject, generic: true), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSObject.listener(( - NSObject? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(_PigeonFfiCodec.readValue(pigeonVar_res)!); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future callFlutterEchoAsyncObject(Object anObject); - Future> callFlutterEchoAsyncList(List list) async { - try { - if (_jniApi != null) { - final JList pigeonVar_res = await _jniApi.callFlutterEchoAsyncList( - _PigeonJniCodec.writeValue>(list), - ); - final List pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as List).cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer> pigeonVar_completer = Completer>(); - _ffiApi.callFlutterEchoAsyncListWithList( - _PigeonFfiCodec.writeValue(list), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( - NSArray? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res)! as List).cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future> callFlutterEchoAsyncList(List list); Future> callFlutterEchoAsyncEnumList( List enumList, - ) async { - try { - if (_jniApi != null) { - final JList pigeonVar_res = await _jniApi - .callFlutterEchoAsyncEnumList( - _PigeonJniCodec.writeValue>(enumList), - ); - final List pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as List) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer> pigeonVar_completer = - Completer>(); - _ffiApi.callFlutterEchoAsyncEnumListWithEnumList( - _PigeonFfiCodec.writeValue(enumList), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( - NSArray? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum)! as List) - .cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); Future> callFlutterEchoAsyncClassList( List classList, - ) async { - try { - if (_jniApi != null) { - final JList pigeonVar_res = await _jniApi - .callFlutterEchoAsyncClassList( - _PigeonJniCodec.writeValue>( - classList, - ), - ); - final List pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as List) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer> pigeonVar_completer = - Completer>(); - _ffiApi.callFlutterEchoAsyncClassListWithClassList( - _PigeonFfiCodec.writeValue(classList), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( - NSArray? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res)! as List) - .cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); Future> callFlutterEchoAsyncNonNullEnumList( List enumList, - ) async { - try { - if (_jniApi != null) { - final JList pigeonVar_res = await _jniApi - .callFlutterEchoAsyncNonNullEnumList( - _PigeonJniCodec.writeValue>(enumList), - ); - final List pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as List) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer> pigeonVar_completer = - Completer>(); - _ffiApi.callFlutterEchoAsyncNonNullEnumListWithEnumList( - _PigeonFfiCodec.writeValue(enumList), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( - NSArray? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum)! as List) - .cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); Future> callFlutterEchoAsyncNonNullClassList( List classList, - ) async { - try { - if (_jniApi != null) { - final JList pigeonVar_res = await _jniApi - .callFlutterEchoAsyncNonNullClassList( - _PigeonJniCodec.writeValue>( - classList, - ), - ); - final List pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as List) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer> pigeonVar_completer = - Completer>(); - _ffiApi.callFlutterEchoAsyncNonNullClassListWithClassList( - _PigeonFfiCodec.writeValue(classList), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( - NSArray? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res)! as List) - .cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - Future> callFlutterEchoAsyncMap(Map map) async { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = await _jniApi.callFlutterEchoAsyncMap( - _PigeonJniCodec.writeValue>(map), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer> pigeonVar_completer = - Completer>(); - _ffiApi.callFlutterEchoAsyncMapWithMap( - _PigeonFfiCodec.writeValue(map), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( - NSDictionary? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res)! as Map) - .cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future> callFlutterEchoAsyncMap(Map map); - Future> callFlutterEchoAsyncStringMap( - Map stringMap, - ) async { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = await _jniApi.callFlutterEchoAsyncStringMap( - _PigeonJniCodec.writeValue>(stringMap), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer> pigeonVar_completer = - Completer>(); - _ffiApi.callFlutterEchoAsyncStringMapWithStringMap( - _PigeonFfiCodec.writeValue(stringMap), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( - NSDictionary? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res)! as Map) - .cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future> callFlutterEchoAsyncStringMap(Map stringMap); - Future> callFlutterEchoAsyncIntMap(Map intMap) async { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = await _jniApi.callFlutterEchoAsyncIntMap( - _PigeonJniCodec.writeValue>(intMap), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map).cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer> pigeonVar_completer = Completer>(); - _ffiApi.callFlutterEchoAsyncIntMapWithIntMap( - _PigeonFfiCodec.writeValue(intMap), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( - NSDictionary? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res, int, int)! as Map) - .cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future> callFlutterEchoAsyncIntMap(Map intMap); Future> callFlutterEchoAsyncEnumMap( Map enumMap, - ) async { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = - await _jniApi.callFlutterEchoAsyncEnumMap( - _PigeonJniCodec.writeValue< - JMap - >(enumMap), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer> pigeonVar_completer = - Completer>(); - _ffiApi.callFlutterEchoAsyncEnumMapWithEnumMap( - _PigeonFfiCodec.writeValue(enumMap), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( - NSDictionary? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum, NativeInteropAnEnum)! - as Map) - .cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); Future> callFlutterEchoAsyncClassMap( Map classMap, - ) async { - try { - if (_jniApi != null) { - final JMap pigeonVar_res = await _jniApi - .callFlutterEchoAsyncClassMap( - _PigeonJniCodec.writeValue>( - classMap, - ), - ); - final Map pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) - .cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer> pigeonVar_completer = - Completer>(); - _ffiApi.callFlutterEchoAsyncClassMapWithClassMap( - _PigeonFfiCodec.writeValue(classMap), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( - NSDictionary? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res, int)! as Map) - .cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - Future callFlutterEchoAsyncEnum(NativeInteropAnEnum anEnum) async { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAnEnum pigeonVar_res = await _jniApi.callFlutterEchoAsyncEnum( - anEnum.toJni(), - ); - final NativeInteropAnEnum pigeonVar_dartTypeRes = NativeInteropAnEnum.fromJni( - pigeonVar_res, - )!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.callFlutterEchoAsyncEnumWithAnEnum( - ffi_bridge.NativeInteropAnEnum.values[anEnum.index], - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( - NSNumber? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum)! - as NativeInteropAnEnum, - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future callFlutterEchoAsyncEnum(NativeInteropAnEnum anEnum); Future callFlutterEchoAnotherAsyncEnum( NativeInteropAnotherEnum anotherEnum, - ) async { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAnotherEnum pigeonVar_res = await _jniApi - .callFlutterEchoAnotherAsyncEnum(anotherEnum.toJni()); - final NativeInteropAnotherEnum pigeonVar_dartTypeRes = NativeInteropAnotherEnum.fromJni( - pigeonVar_res, - )!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = - Completer(); - _ffiApi.callFlutterEchoAnotherAsyncEnumWithAnotherEnum( - ffi_bridge.NativeInteropAnotherEnum.values[anotherEnum.index], - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( - NSNumber? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnotherEnum)! - as NativeInteropAnotherEnum, - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - Future callFlutterEchoAsyncNullableBool(bool? aBool) async { - try { - if (_jniApi != null) { - final JBoolean? pigeonVar_res = await _jniApi.callFlutterEchoAsyncNullableBool( - _PigeonJniCodec.writeValue(aBool), - ); - final bool? pigeonVar_dartTypeRes = pigeonVar_res?.toDartBool(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.callFlutterEchoAsyncNullableBoolWithABool( - _PigeonFfiCodec.writeValue(aBool), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( - NSNumber? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(pigeonVar_res?.boolValue); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future callFlutterEchoAsyncNullableBool(bool? aBool); - Future callFlutterEchoAsyncNullableInt(int? anInt) async { - try { - if (_jniApi != null) { - final JLong? pigeonVar_res = await _jniApi.callFlutterEchoAsyncNullableInt( - _PigeonJniCodec.writeValue(anInt), - ); - final int? pigeonVar_dartTypeRes = pigeonVar_res?.toDartInt(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.callFlutterEchoAsyncNullableIntWithAnInt( - _PigeonFfiCodec.writeValue(anInt), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( - NSNumber? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(pigeonVar_res?.longValue); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future callFlutterEchoAsyncNullableInt(int? anInt); - Future callFlutterEchoAsyncNullableDouble(double? aDouble) async { - try { - if (_jniApi != null) { - final JDouble? pigeonVar_res = await _jniApi.callFlutterEchoAsyncNullableDouble( - _PigeonJniCodec.writeValue(aDouble), - ); - final double? pigeonVar_dartTypeRes = pigeonVar_res?.toDartDouble(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.callFlutterEchoAsyncNullableDoubleWithADouble( - _PigeonFfiCodec.writeValue(aDouble), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( - NSNumber? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(pigeonVar_res?.doubleValue); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future callFlutterEchoAsyncNullableDouble(double? aDouble); - Future callFlutterEchoAsyncNullableString(String? aString) async { - try { - if (_jniApi != null) { - final JString? pigeonVar_res = await _jniApi.callFlutterEchoAsyncNullableString( - _PigeonJniCodec.writeValue(aString), - ); - final String? pigeonVar_dartTypeRes = pigeonVar_res?.toDartString(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.callFlutterEchoAsyncNullableStringWithAString( - _PigeonFfiCodec.writeValue(aString), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSString.listener(( - NSString? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(pigeonVar_res?.toDartString()); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future callFlutterEchoAsyncNullableString(String? aString); - Future callFlutterEchoAsyncNullableUint8List(Uint8List? list) async { - try { - if (_jniApi != null) { - final JByteArray? pigeonVar_res = await _jniApi.callFlutterEchoAsyncNullableUint8List( - _PigeonJniCodec.writeValue(list), - ); - final Uint8List? pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res) as Uint8List?; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.callFlutterEchoAsyncNullableUint8ListWithList( - _PigeonFfiCodec.writeValue(list), - wrappedError: pigeonVar_error, - completionHandler: - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( - ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - _PigeonFfiCodec.readValue(pigeonVar_res) as Uint8List?, - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future callFlutterEchoAsyncNullableUint8List(Uint8List? list); - Future callFlutterEchoAsyncNullableInt32List(Int32List? list) async { - try { - if (_jniApi != null) { - final JIntArray? pigeonVar_res = await _jniApi.callFlutterEchoAsyncNullableInt32List( - _PigeonJniCodec.writeValue(list), - ); - final Int32List? pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res) as Int32List?; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.callFlutterEchoAsyncNullableInt32ListWithList( - _PigeonFfiCodec.writeValue(list), - wrappedError: pigeonVar_error, - completionHandler: - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( - ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - _PigeonFfiCodec.readValue(pigeonVar_res) as Int32List?, - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future callFlutterEchoAsyncNullableInt32List(Int32List? list); - Future callFlutterEchoAsyncNullableInt64List(Int64List? list) async { - try { - if (_jniApi != null) { - final JLongArray? pigeonVar_res = await _jniApi.callFlutterEchoAsyncNullableInt64List( - _PigeonJniCodec.writeValue(list), - ); - final Int64List? pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res) as Int64List?; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.callFlutterEchoAsyncNullableInt64ListWithList( - _PigeonFfiCodec.writeValue(list), - wrappedError: pigeonVar_error, - completionHandler: - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( - ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - _PigeonFfiCodec.readValue(pigeonVar_res) as Int64List?, - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future callFlutterEchoAsyncNullableInt64List(Int64List? list); - Future callFlutterEchoAsyncNullableFloat64List(Float64List? list) async { - try { - if (_jniApi != null) { - final JDoubleArray? pigeonVar_res = await _jniApi.callFlutterEchoAsyncNullableFloat64List( - _PigeonJniCodec.writeValue(list), - ); - final Float64List? pigeonVar_dartTypeRes = - _PigeonJniCodec.readValue(pigeonVar_res) as Float64List?; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.callFlutterEchoAsyncNullableFloat64ListWithList( - _PigeonFfiCodec.writeValue(list), - wrappedError: pigeonVar_error, - completionHandler: - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( - ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - _PigeonFfiCodec.readValue(pigeonVar_res) as Float64List?, - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future callFlutterEchoAsyncNullableFloat64List(Float64List? list); - Future callFlutterThrowFlutterErrorAsync() async { - try { - if (_jniApi != null) { - final JObject? pigeonVar_res = await _jniApi.callFlutterThrowFlutterErrorAsync(); - final Object? pigeonVar_dartTypeRes = _PigeonJniCodec.readValue(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.callFlutterThrowFlutterErrorAsyncWithWrappedError( - pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSObject.listener(( - NSObject? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(_PigeonFfiCodec.readValue(pigeonVar_res)); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future callFlutterThrowFlutterErrorAsync(); - Future callFlutterEchoAsyncNullableObject(Object? anObject) async { - try { - if (_jniApi != null) { - final JObject? pigeonVar_res = await _jniApi.callFlutterEchoAsyncNullableObject( - _PigeonJniCodec.writeValue(anObject), - ); - final Object? pigeonVar_dartTypeRes = _PigeonJniCodec.readValue(pigeonVar_res); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.callFlutterEchoAsyncNullableObjectWithAnObject( - _PigeonFfiCodec.writeValue(anObject, generic: true), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSObject.listener(( - NSObject? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(_PigeonFfiCodec.readValue(pigeonVar_res)); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future callFlutterEchoAsyncNullableObject(Object? anObject); - Future?> callFlutterEchoAsyncNullableList(List? list) async { - try { - if (_jniApi != null) { - final JList? pigeonVar_res = await _jniApi.callFlutterEchoAsyncNullableList( - _PigeonJniCodec.writeValue?>(list), - ); - final List? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as List?)?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer?> pigeonVar_completer = Completer?>(); - _ffiApi.callFlutterEchoAsyncNullableListWithList( - _PigeonFfiCodec.writeValue(list), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( - NSArray? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res) as List?)?.cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future?> callFlutterEchoAsyncNullableList(List? list); Future?> callFlutterEchoAsyncNullableEnumList( List? enumList, - ) async { - try { - if (_jniApi != null) { - final JList? pigeonVar_res = await _jniApi - .callFlutterEchoAsyncNullableEnumList( - _PigeonJniCodec.writeValue?>(enumList), - ); - final List? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as List?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer?> pigeonVar_completer = - Completer?>(); - _ffiApi.callFlutterEchoAsyncNullableEnumListWithEnumList( - _PigeonFfiCodec.writeValue(enumList), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( - NSArray? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum) as List?) - ?.cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); Future?> callFlutterEchoAsyncNullableClassList( List? classList, - ) async { - try { - if (_jniApi != null) { - final JList? pigeonVar_res = await _jniApi - .callFlutterEchoAsyncNullableClassList( - _PigeonJniCodec.writeValue?>( - classList, - ), - ); - final List? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as List?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer?> pigeonVar_completer = - Completer?>(); - _ffiApi.callFlutterEchoAsyncNullableClassListWithClassList( - _PigeonFfiCodec.writeValue(classList), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( - NSArray? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res) as List?) - ?.cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); Future?> callFlutterEchoAsyncNullableNonNullEnumList( List? enumList, - ) async { - try { - if (_jniApi != null) { - final JList? pigeonVar_res = await _jniApi - .callFlutterEchoAsyncNullableNonNullEnumList( - _PigeonJniCodec.writeValue?>(enumList), - ); - final List? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as List?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer?> pigeonVar_completer = - Completer?>(); - _ffiApi.callFlutterEchoAsyncNullableNonNullEnumListWithEnumList( - _PigeonFfiCodec.writeValue(enumList), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( - NSArray? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum) as List?) - ?.cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); Future?> callFlutterEchoAsyncNullableNonNullClassList( List? classList, - ) async { - try { - if (_jniApi != null) { - final JList? pigeonVar_res = await _jniApi - .callFlutterEchoAsyncNullableNonNullClassList( - _PigeonJniCodec.writeValue?>( - classList, - ), - ); - final List? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as List?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer?> pigeonVar_completer = - Completer?>(); - _ffiApi.callFlutterEchoAsyncNullableNonNullClassListWithClassList( - _PigeonFfiCodec.writeValue(classList), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( - NSArray? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res) as List?) - ?.cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - Future?> callFlutterEchoAsyncNullableMap(Map? map) async { - try { - if (_jniApi != null) { - final JMap? pigeonVar_res = await _jniApi - .callFlutterEchoAsyncNullableMap( - _PigeonJniCodec.writeValue?>(map), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer?> pigeonVar_completer = - Completer?>(); - _ffiApi.callFlutterEchoAsyncNullableMapWithMap( - _PigeonFfiCodec.writeValue(map), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( - NSDictionary? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res) as Map?) - ?.cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future?> callFlutterEchoAsyncNullableMap(Map? map); Future?> callFlutterEchoAsyncNullableStringMap( Map? stringMap, - ) async { - try { - if (_jniApi != null) { - final JMap? pigeonVar_res = await _jniApi - .callFlutterEchoAsyncNullableStringMap( - _PigeonJniCodec.writeValue?>(stringMap), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer?> pigeonVar_completer = - Completer?>(); - _ffiApi.callFlutterEchoAsyncNullableStringMapWithStringMap( - _PigeonFfiCodec.writeValue(stringMap), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( - NSDictionary? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res) as Map?) - ?.cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - Future?> callFlutterEchoAsyncNullableIntMap(Map? intMap) async { - try { - if (_jniApi != null) { - final JMap? pigeonVar_res = await _jniApi - .callFlutterEchoAsyncNullableIntMap( - _PigeonJniCodec.writeValue?>(intMap), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer?> pigeonVar_completer = Completer?>(); - _ffiApi.callFlutterEchoAsyncNullableIntMapWithIntMap( - _PigeonFfiCodec.writeValue(intMap), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( - NSDictionary? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res, int, int) as Map?) - ?.cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future?> callFlutterEchoAsyncNullableIntMap(Map? intMap); Future?> callFlutterEchoAsyncNullableEnumMap( Map? enumMap, - ) async { - try { - if (_jniApi != null) { - final JMap? - pigeonVar_res = await _jniApi.callFlutterEchoAsyncNullableEnumMap( - _PigeonJniCodec.writeValue< - JMap? - >(enumMap), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer?> pigeonVar_completer = - Completer?>(); - _ffiApi.callFlutterEchoAsyncNullableEnumMapWithEnumMap( - _PigeonFfiCodec.writeValue(enumMap), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( - NSDictionary? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum, NativeInteropAnEnum) - as Map?) - ?.cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); Future?> callFlutterEchoAsyncNullableClassMap( Map? classMap, - ) async { - try { - if (_jniApi != null) { - final JMap? pigeonVar_res = await _jniApi - .callFlutterEchoAsyncNullableClassMap( - _PigeonJniCodec.writeValue?>( - classMap, - ), - ); - final Map? pigeonVar_dartTypeRes = - (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) - ?.cast(); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer?> pigeonVar_completer = - Completer?>(); - _ffiApi.callFlutterEchoAsyncNullableClassMapWithClassMap( - _PigeonFfiCodec.writeValue(classMap), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( - NSDictionary? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - (_PigeonFfiCodec.readValue(pigeonVar_res, int) as Map?) - ?.cast(), - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - Future callFlutterEchoAsyncNullableEnum(NativeInteropAnEnum? anEnum) async { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAnEnum? pigeonVar_res = await _jniApi - .callFlutterEchoAsyncNullableEnum(anEnum?.toJni()); - final NativeInteropAnEnum? pigeonVar_dartTypeRes = NativeInteropAnEnum.fromJni( - pigeonVar_res, - ); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = - Completer(); - _ffiApi.callFlutterEchoAsyncNullableEnumWithAnEnum( - _PigeonFfiCodec.writeValue(anEnum), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( - NSNumber? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum) - as NativeInteropAnEnum?, - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future callFlutterEchoAsyncNullableEnum(NativeInteropAnEnum? anEnum); Future callFlutterEchoAnotherAsyncNullableEnum( NativeInteropAnotherEnum? anotherEnum, - ) async { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropAnotherEnum? pigeonVar_res = await _jniApi - .callFlutterEchoAnotherAsyncNullableEnum(anotherEnum?.toJni()); - final NativeInteropAnotherEnum? pigeonVar_dartTypeRes = NativeInteropAnotherEnum.fromJni( - pigeonVar_res, - ); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = - Completer(); - _ffiApi.callFlutterEchoAnotherAsyncNullableEnumWithAnotherEnum( - _PigeonFfiCodec.writeValue(anotherEnum), - wrappedError: pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( - NSNumber? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete( - _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnotherEnum) - as NativeInteropAnotherEnum?, - ); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + ); - bool isMainThread() { - try { - if (_jniApi != null) { - return _jniApi.isMainThread; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.isMainThreadWithWrappedError(pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - final bool pigeonVar_dartTypeRes = pigeonVar_res!.boolValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + bool isMainThread(); - Future asyncIsBackgroundThread() async { - try { - if (_jniApi != null) { - final JBoolean pigeonVar_res = await _jniApi.asyncIsBackgroundThread(); - final bool pigeonVar_dartTypeRes = pigeonVar_res.toDartBool(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.asyncIsBackgroundThreadWithWrappedError( - pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( - NSNumber? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(pigeonVar_res!.boolValue); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future asyncIsBackgroundThread(); - bool isGetter() { - try { - if (_jniApi != null) { - return _jniApi.isGetter; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.isGetterWithWrappedError(pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - final bool pigeonVar_dartTypeRes = pigeonVar_res!.boolValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + bool isGetter(); - int getGetter() { - try { - if (_jniApi != null) { - return _jniApi.getter; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.getGetterWithWrappedError(pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - final int pigeonVar_dartTypeRes = pigeonVar_res!.longValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + int getGetter(); - void setSetter(int value) { - try { - if (_jniApi != null) { - _jniApi.setter = value; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - _ffiApi.setSetterWithValue(value, wrappedError: pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - return; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + void setSetter(int value); - Future callFlutterNoopOnBackgroundThread() async { - try { - if (_jniApi != null) { - final JBoolean pigeonVar_res = await _jniApi.callFlutterNoopOnBackgroundThread(); - final bool pigeonVar_dartTypeRes = pigeonVar_res.toDartBool(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.callFlutterNoopOnBackgroundThreadWithWrappedError( - pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( - NSNumber? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(pigeonVar_res!.boolValue); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future callFlutterNoopOnBackgroundThread(); - bool testDeregisterHostApi() { - try { - if (_jniApi != null) { - return _jniApi.testDeregisterHostApi(); - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.testDeregisterHostApiWithWrappedError( - pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final bool pigeonVar_dartTypeRes = pigeonVar_res!.boolValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + bool testDeregisterHostApi(); - bool testDeregisterFlutterApi() { - try { - if (_jniApi != null) { - return _jniApi.testDeregisterFlutterApi(); - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.testDeregisterFlutterApiWithWrappedError( - pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final bool pigeonVar_dartTypeRes = pigeonVar_res!.boolValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + bool testDeregisterFlutterApi(); - void registerAndImmediatelyDeregisterHostApi(String name) { - try { - if (_jniApi != null) { - return _jniApi.registerAndImmediatelyDeregisterHostApi( - _PigeonJniCodec.writeValue(name), - ); - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - _ffiApi.registerAndImmediatelyDeregisterHostApiWithName( - _PigeonFfiCodec.writeValue(name), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - return; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + void registerAndImmediatelyDeregisterHostApi(String name); - bool testCallDeregisteredFlutterApi(String name) { - try { - if (_jniApi != null) { - return _jniApi.testCallDeregisteredFlutterApi(_PigeonJniCodec.writeValue(name)); - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.testCallDeregisteredFlutterApiWithName( - _PigeonFfiCodec.writeValue(name), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final bool pigeonVar_dartTypeRes = pigeonVar_res!.boolValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + bool testCallDeregisteredFlutterApi(String name); } /// The core interface that each host language plugin must implement in @@ -10796,7 +1920,7 @@ class NativeInteropHostIntegrationCoreApi { }) { NativeInteropHostIntegrationCoreApiForNativeInterop? nativeInteropApi; String nativeInteropApiInstanceName = ''; - if (Platform.isAndroid || Platform.isIOS || Platform.isMacOS) { + if (!kIsWeb) { if (messageChannelSuffix.isEmpty) { nativeInteropApi = NativeInteropHostIntegrationCoreApiForNativeInterop.getInstance(); } else { @@ -16248,5098 +7372,116 @@ class NativeInteropHostIntegrationCoreApi { pigeonVar_channelName, isNullValid: false, ); - return pigeonVar_replyValue! as bool; - } - - /// Tests deregistering a Host API natively. - Future testDeregisterHostApi() async { - if (_nativeInteropApi != null) { - return _nativeInteropApi.testDeregisterHostApi(); - } - final pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.NativeInteropHostIntegrationCoreApi.testDeregisterHostApi$pigeonVar_messageChannelSuffix'; - final pigeonVar_channel = BasicMessageChannel( - pigeonVar_channelName, - pigeonChannelCodec, - binaryMessenger: pigeonVar_binaryMessenger, - ); - final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); - final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - - final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( - pigeonVar_replyList, - pigeonVar_channelName, - isNullValid: false, - ); - return pigeonVar_replyValue! as bool; - } - - /// Tests deregistering a Flutter API natively. - Future testDeregisterFlutterApi() async { - if (_nativeInteropApi != null) { - return _nativeInteropApi.testDeregisterFlutterApi(); - } - final pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.NativeInteropHostIntegrationCoreApi.testDeregisterFlutterApi$pigeonVar_messageChannelSuffix'; - final pigeonVar_channel = BasicMessageChannel( - pigeonVar_channelName, - pigeonChannelCodec, - binaryMessenger: pigeonVar_binaryMessenger, - ); - final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); - final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - - final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( - pigeonVar_replyList, - pigeonVar_channelName, - isNullValid: false, - ); - return pigeonVar_replyValue! as bool; - } - - /// Registers and immediately deregisters a Host API under [name]. - Future registerAndImmediatelyDeregisterHostApi(String name) async { - if (_nativeInteropApi != null) { - return _nativeInteropApi.registerAndImmediatelyDeregisterHostApi(name); - } - final pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.NativeInteropHostIntegrationCoreApi.registerAndImmediatelyDeregisterHostApi$pigeonVar_messageChannelSuffix'; - final pigeonVar_channel = BasicMessageChannel( - pigeonVar_channelName, - pigeonChannelCodec, - binaryMessenger: pigeonVar_binaryMessenger, - ); - final Future pigeonVar_sendFuture = pigeonVar_channel.send([name]); - final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - - _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); - } - - /// Tests that calling a deregistered Flutter API under [name] fails / returns null. - Future testCallDeregisteredFlutterApi(String name) async { - if (_nativeInteropApi != null) { - return _nativeInteropApi.testCallDeregisteredFlutterApi(name); - } - final pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.NativeInteropHostIntegrationCoreApi.testCallDeregisteredFlutterApi$pigeonVar_messageChannelSuffix'; - final pigeonVar_channel = BasicMessageChannel( - pigeonVar_channelName, - pigeonChannelCodec, - binaryMessenger: pigeonVar_binaryMessenger, - ); - final Future pigeonVar_sendFuture = pigeonVar_channel.send([name]); - final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - - final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( - pigeonVar_replyList, - pigeonVar_channelName, - isNullValid: false, - ); - return pigeonVar_replyValue! as bool; - } -} - -/// The core interface that the Dart platform_test code implements for host -/// integration tests to call into. -final class NativeInteropFlutterIntegrationCoreApiRegistrar - with jni_bridge.$NativeInteropFlutterIntegrationCoreApi { - NativeInteropFlutterIntegrationCoreApi? dartApi; - - NativeInteropFlutterIntegrationCoreApi register( - NativeInteropFlutterIntegrationCoreApi api, { - String name = defaultInstanceName, - }) { - dartApi = api; - - if (Platform.isAndroid) { - final jni_bridge.NativeInteropFlutterIntegrationCoreApi impl = - jni_bridge.NativeInteropFlutterIntegrationCoreApi.implement(this); - jni_bridge.NativeInteropFlutterIntegrationCoreApiRegistrar().registerInstance( - impl, - name.toJString(), - ); - } - if (Platform.isIOS || Platform.isMacOS) { - final ObjCProtocolBuilder builder = ObjCProtocolBuilder( - debugName: 'NativeInteropFlutterIntegrationCoreApiBridge', - ); - ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.noopWithError_.implement( - builder, - (ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - dartApi!.noop(); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - return; - } - }, - ); - ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.throwFlutterErrorWithError_ - .implement(builder, (ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final Object? response = dartApi!.throwFlutterError(); - return _PigeonFfiCodec.writeValue(response, generic: true); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.throwErrorWithError_ - .implement(builder, (ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final Object? response = dartApi!.throwError(); - return _PigeonFfiCodec.writeValue(response, generic: true); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.throwErrorFromVoidWithError_ - .implement(builder, (ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - dartApi!.throwErrorFromVoid(); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNativeInteropAllTypesWithEverything_error_ - .implement(builder, ( - ffi_bridge.NativeInteropAllTypesBridge? arg_everything, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final NativeInteropAllTypes response = dartApi!.echoNativeInteropAllTypes( - NativeInteropAllTypes.fromFfi(arg_everything)!, - ); - return response.toFfi(); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNativeInteropAllNullableTypesWithEverything_error_ - .implement(builder, ( - ffi_bridge.NativeInteropAllNullableTypesBridge? arg_everything, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final NativeInteropAllNullableTypes? response = dartApi! - .echoNativeInteropAllNullableTypes( - NativeInteropAllNullableTypes.fromFfi(arg_everything), - ); - return response?.toFfi(); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNativeInteropSealedClassWithSealedClass_error_ - .implement(builder, ( - ffi_bridge.NativeInteropSealedClassBridge? arg_sealedClass, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final NativeInteropSealedClass response = dartApi!.echoNativeInteropSealedClass( - NativeInteropSealedClass.fromFfi(arg_sealedClass)!, - ); - return response.toFfi(); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .sendMultipleNullableTypesWithANullableBool_aNullableInt_aNullableString_error_ - .implement(builder, ( - NSNumber? arg_aNullableBool, - NSNumber? arg_aNullableInt, - NSString? arg_aNullableString, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final NativeInteropAllNullableTypes response = dartApi!.sendMultipleNullableTypes( - arg_aNullableBool?.boolValue, - arg_aNullableInt?.longValue, - arg_aNullableString?.toDartString(), - ); - return response.toFfi(); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNativeInteropAllNullableTypesWithoutRecursionWithEverything_error_ - .implement(builder, ( - ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge? arg_everything, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final NativeInteropAllNullableTypesWithoutRecursion? response = dartApi! - .echoNativeInteropAllNullableTypesWithoutRecursion( - NativeInteropAllNullableTypesWithoutRecursion.fromFfi(arg_everything), - ); - return response?.toFfi(); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .sendMultipleNullableTypesWithoutRecursionWithANullableBool_aNullableInt_aNullableString_error_ - .implement(builder, ( - NSNumber? arg_aNullableBool, - NSNumber? arg_aNullableInt, - NSString? arg_aNullableString, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final NativeInteropAllNullableTypesWithoutRecursion response = dartApi! - .sendMultipleNullableTypesWithoutRecursion( - arg_aNullableBool?.boolValue, - arg_aNullableInt?.longValue, - arg_aNullableString?.toDartString(), - ); - return response.toFfi(); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoBoolWithABool_error_ - .implement(builder, (NSNumber? arg_aBool, ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final bool response = dartApi!.echoBool(arg_aBool!.boolValue); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoIntWithAnInt_error_ - .implement(builder, (NSNumber? arg_anInt, ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final int response = dartApi!.echoInt(arg_anInt!.longValue); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoDoubleWithADouble_error_ - .implement(builder, (NSNumber? arg_aDouble, ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final double response = dartApi!.echoDouble(arg_aDouble!.doubleValue); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoStringWithAString_error_ - .implement(builder, (NSString? arg_aString, ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final String response = dartApi!.echoString(arg_aString!.toDartString()); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoUint8ListWithList_error_ - .implement(builder, ( - ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final Uint8List response = dartApi!.echoUint8List( - _PigeonFfiCodec.readValue(arg_list)! as Uint8List, - ); - return _PigeonFfiCodec.writeValue( - response, - ); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoInt32ListWithList_error_ - .implement(builder, ( - ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final Int32List response = dartApi!.echoInt32List( - _PigeonFfiCodec.readValue(arg_list)! as Int32List, - ); - return _PigeonFfiCodec.writeValue( - response, - ); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoInt64ListWithList_error_ - .implement(builder, ( - ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final Int64List response = dartApi!.echoInt64List( - _PigeonFfiCodec.readValue(arg_list)! as Int64List, - ); - return _PigeonFfiCodec.writeValue( - response, - ); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoFloat64ListWithList_error_ - .implement(builder, ( - ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final Float64List response = dartApi!.echoFloat64List( - _PigeonFfiCodec.readValue(arg_list)! as Float64List, - ); - return _PigeonFfiCodec.writeValue( - response, - ); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoListWithList_error_ - .implement(builder, (NSArray? arg_list, ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final List response = dartApi!.echoList( - (_PigeonFfiCodec.readValue(arg_list)! as List).cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoEnumListWithEnumList_error_ - .implement(builder, (NSArray? arg_enumList, ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final List response = dartApi!.echoEnumList( - (_PigeonFfiCodec.readValue(arg_enumList, NativeInteropAnEnum)! as List) - .cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoClassListWithClassList_error_ - .implement(builder, ( - NSArray? arg_classList, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final List response = dartApi!.echoClassList( - (_PigeonFfiCodec.readValue(arg_classList)! as List) - .cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNonNullEnumListWithEnumList_error_ - .implement(builder, (NSArray? arg_enumList, ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final List response = dartApi!.echoNonNullEnumList( - (_PigeonFfiCodec.readValue(arg_enumList, NativeInteropAnEnum)! as List) - .cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNonNullClassListWithClassList_error_ - .implement(builder, ( - NSArray? arg_classList, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final List response = dartApi!.echoNonNullClassList( - (_PigeonFfiCodec.readValue(arg_classList)! as List) - .cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoMapWithMap_error_ - .implement(builder, (NSDictionary? arg_map, ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final Map response = dartApi!.echoMap( - (_PigeonFfiCodec.readValue(arg_map)! as Map) - .cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoStringMapWithStringMap_error_ - .implement(builder, ( - NSDictionary? arg_stringMap, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final Map response = dartApi!.echoStringMap( - (_PigeonFfiCodec.readValue(arg_stringMap)! as Map) - .cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoIntMapWithIntMap_error_ - .implement(builder, ( - NSDictionary? arg_intMap, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final Map response = dartApi!.echoIntMap( - (_PigeonFfiCodec.readValue(arg_intMap, int, int)! as Map) - .cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoEnumMapWithEnumMap_error_ - .implement(builder, ( - NSDictionary? arg_enumMap, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final Map response = dartApi! - .echoEnumMap( - (_PigeonFfiCodec.readValue( - arg_enumMap, - NativeInteropAnEnum, - NativeInteropAnEnum, - )! - as Map) - .cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoClassMapWithClassMap_error_ - .implement(builder, ( - NSDictionary? arg_classMap, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final Map response = dartApi!.echoClassMap( - (_PigeonFfiCodec.readValue(arg_classMap, int)! as Map) - .cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNonNullStringMapWithStringMap_error_ - .implement(builder, ( - NSDictionary? arg_stringMap, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final Map response = dartApi!.echoNonNullStringMap( - (_PigeonFfiCodec.readValue(arg_stringMap)! as Map) - .cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNonNullIntMapWithIntMap_error_ - .implement(builder, ( - NSDictionary? arg_intMap, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final Map response = dartApi!.echoNonNullIntMap( - (_PigeonFfiCodec.readValue(arg_intMap, int, int)! as Map) - .cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNonNullEnumMapWithEnumMap_error_ - .implement(builder, ( - NSDictionary? arg_enumMap, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final Map response = dartApi! - .echoNonNullEnumMap( - (_PigeonFfiCodec.readValue( - arg_enumMap, - NativeInteropAnEnum, - NativeInteropAnEnum, - )! - as Map) - .cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNonNullClassMapWithClassMap_error_ - .implement(builder, ( - NSDictionary? arg_classMap, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final Map response = dartApi! - .echoNonNullClassMap( - (_PigeonFfiCodec.readValue(arg_classMap, int)! as Map) - .cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoEnumWithAnEnum_error_ - .implement(builder, (NSNumber? arg_anEnum, ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final NativeInteropAnEnum response = dartApi!.echoEnum( - _PigeonFfiCodec.readValue(arg_anEnum, NativeInteropAnEnum)! - as NativeInteropAnEnum, - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNativeInteropAnotherEnumWithAnotherEnum_error_ - .implement(builder, ( - NSNumber? arg_anotherEnum, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final NativeInteropAnotherEnum response = dartApi!.echoNativeInteropAnotherEnum( - _PigeonFfiCodec.readValue(arg_anotherEnum, NativeInteropAnotherEnum)! - as NativeInteropAnotherEnum, - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNullableBoolWithABool_error_ - .implement(builder, (NSNumber? arg_aBool, ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final bool? response = dartApi!.echoNullableBool(arg_aBool?.boolValue); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNullableIntWithAnInt_error_ - .implement(builder, (NSNumber? arg_anInt, ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final int? response = dartApi!.echoNullableInt(arg_anInt?.longValue); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNullableDoubleWithADouble_error_ - .implement(builder, (NSNumber? arg_aDouble, ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final double? response = dartApi!.echoNullableDouble(arg_aDouble?.doubleValue); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNullableStringWithAString_error_ - .implement(builder, (NSString? arg_aString, ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final String? response = dartApi!.echoNullableString(arg_aString?.toDartString()); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNullableUint8ListWithList_error_ - .implement(builder, ( - ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final Uint8List? response = dartApi!.echoNullableUint8List( - _PigeonFfiCodec.readValue(arg_list) as Uint8List?, - ); - return _PigeonFfiCodec.writeValue( - response, - ); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNullableInt32ListWithList_error_ - .implement(builder, ( - ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final Int32List? response = dartApi!.echoNullableInt32List( - _PigeonFfiCodec.readValue(arg_list) as Int32List?, - ); - return _PigeonFfiCodec.writeValue( - response, - ); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNullableInt64ListWithList_error_ - .implement(builder, ( - ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final Int64List? response = dartApi!.echoNullableInt64List( - _PigeonFfiCodec.readValue(arg_list) as Int64List?, - ); - return _PigeonFfiCodec.writeValue( - response, - ); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNullableFloat64ListWithList_error_ - .implement(builder, ( - ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final Float64List? response = dartApi!.echoNullableFloat64List( - _PigeonFfiCodec.readValue(arg_list) as Float64List?, - ); - return _PigeonFfiCodec.writeValue( - response, - ); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNullableListWithList_error_ - .implement(builder, (NSArray? arg_list, ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final List? response = dartApi!.echoNullableList( - (_PigeonFfiCodec.readValue(arg_list) as List?)?.cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNullableEnumListWithEnumList_error_ - .implement(builder, (NSArray? arg_enumList, ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final List? response = dartApi!.echoNullableEnumList( - (_PigeonFfiCodec.readValue(arg_enumList, NativeInteropAnEnum) as List?) - ?.cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNullableClassListWithClassList_error_ - .implement(builder, ( - NSArray? arg_classList, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final List? response = dartApi! - .echoNullableClassList( - (_PigeonFfiCodec.readValue(arg_classList) as List?) - ?.cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNullableNonNullEnumListWithEnumList_error_ - .implement(builder, (NSArray? arg_enumList, ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final List? response = dartApi!.echoNullableNonNullEnumList( - (_PigeonFfiCodec.readValue(arg_enumList, NativeInteropAnEnum) as List?) - ?.cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNullableNonNullClassListWithClassList_error_ - .implement(builder, ( - NSArray? arg_classList, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final List? response = dartApi! - .echoNullableNonNullClassList( - (_PigeonFfiCodec.readValue(arg_classList) as List?) - ?.cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoNullableMapWithMap_error_ - .implement(builder, (NSDictionary? arg_map, ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final Map? response = dartApi!.echoNullableMap( - (_PigeonFfiCodec.readValue(arg_map) as Map?) - ?.cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNullableStringMapWithStringMap_error_ - .implement(builder, ( - NSDictionary? arg_stringMap, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final Map? response = dartApi!.echoNullableStringMap( - (_PigeonFfiCodec.readValue(arg_stringMap) as Map?) - ?.cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNullableIntMapWithIntMap_error_ - .implement(builder, ( - NSDictionary? arg_intMap, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final Map? response = dartApi!.echoNullableIntMap( - (_PigeonFfiCodec.readValue(arg_intMap, int, int) as Map?) - ?.cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNullableEnumMapWithEnumMap_error_ - .implement(builder, ( - NSDictionary? arg_enumMap, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final Map? response = dartApi! - .echoNullableEnumMap( - (_PigeonFfiCodec.readValue( - arg_enumMap, - NativeInteropAnEnum, - NativeInteropAnEnum, - ) - as Map?) - ?.cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNullableClassMapWithClassMap_error_ - .implement(builder, ( - NSDictionary? arg_classMap, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final Map? response = dartApi! - .echoNullableClassMap( - (_PigeonFfiCodec.readValue(arg_classMap, int) as Map?) - ?.cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNullableNonNullStringMapWithStringMap_error_ - .implement(builder, ( - NSDictionary? arg_stringMap, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final Map? response = dartApi!.echoNullableNonNullStringMap( - (_PigeonFfiCodec.readValue(arg_stringMap) as Map?) - ?.cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNullableNonNullIntMapWithIntMap_error_ - .implement(builder, ( - NSDictionary? arg_intMap, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final Map? response = dartApi!.echoNullableNonNullIntMap( - (_PigeonFfiCodec.readValue(arg_intMap, int, int) as Map?) - ?.cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNullableNonNullEnumMapWithEnumMap_error_ - .implement(builder, ( - NSDictionary? arg_enumMap, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final Map? response = dartApi! - .echoNullableNonNullEnumMap( - (_PigeonFfiCodec.readValue( - arg_enumMap, - NativeInteropAnEnum, - NativeInteropAnEnum, - ) - as Map?) - ?.cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNullableNonNullClassMapWithClassMap_error_ - .implement(builder, ( - NSDictionary? arg_classMap, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final Map? response = dartApi! - .echoNullableNonNullClassMap( - (_PigeonFfiCodec.readValue(arg_classMap, int) as Map?) - ?.cast(), - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoNullableEnumWithAnEnum_error_ - .implement(builder, (NSNumber? arg_anEnum, ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final NativeInteropAnEnum? response = dartApi!.echoNullableEnum( - _PigeonFfiCodec.readValue(arg_anEnum, NativeInteropAnEnum) - as NativeInteropAnEnum?, - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAnotherNullableEnumWithAnotherEnum_error_ - .implement(builder, ( - NSNumber? arg_anotherEnum, - ffi_bridge.NativeInteropTestsError errorOut, - ) { - try { - if (dartApi != null) { - final NativeInteropAnotherEnum? response = dartApi!.echoAnotherNullableEnum( - _PigeonFfiCodec.readValue(arg_anotherEnum, NativeInteropAnotherEnum) - as NativeInteropAnotherEnum?, - ); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .noopAsyncWithError_completionHandler_ - .implementAsListener(builder, ( - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi!.noopAsync().then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid$CallExtension(completionHandler).call(); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid$CallExtension(completionHandler).call(); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid$CallExtension(completionHandler).call(); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid$CallExtension(completionHandler).call(); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .throwFlutterErrorAsyncWithError_completionHandler_ - .implementAsListener(builder, ( - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi!.throwFlutterErrorAsync().then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSObject$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response, generic: true)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSObject$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSObject$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSObject$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNativeInteropAllTypesWithEverything_error_completionHandler_ - .implementAsListener(builder, ( - ffi_bridge.NativeInteropAllTypesBridge? arg_everything, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNativeInteropAllTypes(NativeInteropAllTypes.fromFfi(arg_everything)!) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllTypesBridge$CallExtension( - completionHandler, - ).call(response.toFfi()); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllTypesBridge$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllTypesBridge$CallExtension( - completionHandler, - ).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllTypesBridge$CallExtension( - completionHandler, - ).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNullableNativeInteropAllNullableTypesWithEverything_error_completionHandler_ - .implementAsListener(builder, ( - ffi_bridge.NativeInteropAllNullableTypesBridge? arg_everything, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock - completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNullableNativeInteropAllNullableTypes( - NativeInteropAllNullableTypes.fromFfi(arg_everything), - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllNullableTypesBridge$CallExtension( - completionHandler, - ).call(response?.toFfi()); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllNullableTypesBridge$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllNullableTypesBridge$CallExtension( - completionHandler, - ).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllNullableTypesBridge$CallExtension( - completionHandler, - ).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNullableNativeInteropAllNullableTypesWithoutRecursionWithEverything_error_completionHandler_ - .implementAsListener(builder, ( - ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge? arg_everything, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock< - Void Function(ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge?) - > - completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNullableNativeInteropAllNullableTypesWithoutRecursion( - NativeInteropAllNullableTypesWithoutRecursion.fromFfi(arg_everything), - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllNullableTypesWithoutRecursionBridge$CallExtension( - completionHandler, - ).call(response?.toFfi()); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllNullableTypesWithoutRecursionBridge$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllNullableTypesWithoutRecursionBridge$CallExtension( - completionHandler, - ).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllNullableTypesWithoutRecursionBridge$CallExtension( - completionHandler, - ).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncBoolWithABool_error_completionHandler_ - .implementAsListener(builder, ( - NSNumber? arg_aBool, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncBool(arg_aBool!.boolValue) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncIntWithAnInt_error_completionHandler_ - .implementAsListener(builder, ( - NSNumber? arg_anInt, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncInt(arg_anInt!.longValue) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncDoubleWithADouble_error_completionHandler_ - .implementAsListener(builder, ( - NSNumber? arg_aDouble, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncDouble(arg_aDouble!.doubleValue) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncStringWithAString_error_completionHandler_ - .implementAsListener(builder, ( - NSString? arg_aString, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncString(arg_aString!.toDartString()) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSString$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSString$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSString$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSString$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncUint8ListWithList_error_completionHandler_ - .implementAsListener(builder, ( - ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock - completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncUint8List(_PigeonFfiCodec.readValue(arg_list)! as Uint8List) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call( - _PigeonFfiCodec.writeValue( - response, - ), - ); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncInt32ListWithList_error_completionHandler_ - .implementAsListener(builder, ( - ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock - completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncInt32List(_PigeonFfiCodec.readValue(arg_list)! as Int32List) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call( - _PigeonFfiCodec.writeValue( - response, - ), - ); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncInt64ListWithList_error_completionHandler_ - .implementAsListener(builder, ( - ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock - completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncInt64List(_PigeonFfiCodec.readValue(arg_list)! as Int64List) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call( - _PigeonFfiCodec.writeValue( - response, - ), - ); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncFloat64ListWithList_error_completionHandler_ - .implementAsListener(builder, ( - ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock - completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncFloat64List(_PigeonFfiCodec.readValue(arg_list)! as Float64List) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call( - _PigeonFfiCodec.writeValue( - response, - ), - ); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncObjectWithAnObject_error_completionHandler_ - .implementAsListener(builder, ( - NSObject? arg_anObject, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncObject(_PigeonFfiCodec.readValue(arg_anObject)!) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSObject$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response, generic: true)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSObject$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSObject$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSObject$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncListWithList_error_completionHandler_ - .implementAsListener(builder, ( - NSArray? arg_list, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncList( - (_PigeonFfiCodec.readValue(arg_list)! as List).cast(), - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncEnumListWithEnumList_error_completionHandler_ - .implementAsListener(builder, ( - NSArray? arg_enumList, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncEnumList( - (_PigeonFfiCodec.readValue(arg_enumList, NativeInteropAnEnum)! - as List) - .cast(), - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncClassListWithClassList_error_completionHandler_ - .implementAsListener(builder, ( - NSArray? arg_classList, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncClassList( - (_PigeonFfiCodec.readValue(arg_classList)! as List) - .cast(), - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNonNullEnumListWithEnumList_error_completionHandler_ - .implementAsListener(builder, ( - NSArray? arg_enumList, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNonNullEnumList( - (_PigeonFfiCodec.readValue(arg_enumList, NativeInteropAnEnum)! - as List) - .cast(), - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNonNullClassListWithClassList_error_completionHandler_ - .implementAsListener(builder, ( - NSArray? arg_classList, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNonNullClassList( - (_PigeonFfiCodec.readValue(arg_classList)! as List) - .cast(), - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncMapWithMap_error_completionHandler_ - .implementAsListener(builder, ( - NSDictionary? arg_map, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncMap( - (_PigeonFfiCodec.readValue(arg_map)! as Map) - .cast(), - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncStringMapWithStringMap_error_completionHandler_ - .implementAsListener(builder, ( - NSDictionary? arg_stringMap, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncStringMap( - (_PigeonFfiCodec.readValue(arg_stringMap)! as Map) - .cast(), - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncIntMapWithIntMap_error_completionHandler_ - .implementAsListener(builder, ( - NSDictionary? arg_intMap, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncIntMap( - (_PigeonFfiCodec.readValue(arg_intMap, int, int)! as Map) - .cast(), - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncEnumMapWithEnumMap_error_completionHandler_ - .implementAsListener(builder, ( - NSDictionary? arg_enumMap, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncEnumMap( - (_PigeonFfiCodec.readValue( - arg_enumMap, - NativeInteropAnEnum, - NativeInteropAnEnum, - )! - as Map) - .cast(), - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncClassMapWithClassMap_error_completionHandler_ - .implementAsListener(builder, ( - NSDictionary? arg_classMap, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncClassMap( - (_PigeonFfiCodec.readValue(arg_classMap, int)! as Map) - .cast(), - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncEnumWithAnEnum_error_completionHandler_ - .implementAsListener(builder, ( - NSNumber? arg_anEnum, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncEnum( - _PigeonFfiCodec.readValue(arg_anEnum, NativeInteropAnEnum)! - as NativeInteropAnEnum, - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAnotherAsyncEnumWithAnotherEnum_error_completionHandler_ - .implementAsListener(builder, ( - NSNumber? arg_anotherEnum, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAnotherAsyncEnum( - _PigeonFfiCodec.readValue(arg_anotherEnum, NativeInteropAnotherEnum)! - as NativeInteropAnotherEnum, - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNullableBoolWithABool_error_completionHandler_ - .implementAsListener(builder, ( - NSNumber? arg_aBool, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNullableBool(arg_aBool?.boolValue) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNullableIntWithAnInt_error_completionHandler_ - .implementAsListener(builder, ( - NSNumber? arg_anInt, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNullableInt(arg_anInt?.longValue) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNullableDoubleWithADouble_error_completionHandler_ - .implementAsListener(builder, ( - NSNumber? arg_aDouble, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNullableDouble(arg_aDouble?.doubleValue) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNullableStringWithAString_error_completionHandler_ - .implementAsListener(builder, ( - NSString? arg_aString, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNullableString(arg_aString?.toDartString()) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSString$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSString$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSString$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSString$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNullableUint8ListWithList_error_completionHandler_ - .implementAsListener(builder, ( - ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock - completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNullableUint8List(_PigeonFfiCodec.readValue(arg_list) as Uint8List?) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call( - _PigeonFfiCodec.writeValue( - response, - ), - ); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNullableInt32ListWithList_error_completionHandler_ - .implementAsListener(builder, ( - ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock - completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNullableInt32List(_PigeonFfiCodec.readValue(arg_list) as Int32List?) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call( - _PigeonFfiCodec.writeValue( - response, - ), - ); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNullableInt64ListWithList_error_completionHandler_ - .implementAsListener(builder, ( - ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock - completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNullableInt64List(_PigeonFfiCodec.readValue(arg_list) as Int64List?) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call( - _PigeonFfiCodec.writeValue( - response, - ), - ); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNullableFloat64ListWithList_error_completionHandler_ - .implementAsListener(builder, ( - ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock - completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNullableFloat64List( - _PigeonFfiCodec.readValue(arg_list) as Float64List?, - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call( - _PigeonFfiCodec.writeValue( - response, - ), - ); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( - completionHandler, - ).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNullableObjectWithAnObject_error_completionHandler_ - .implementAsListener(builder, ( - NSObject? arg_anObject, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNullableObject(_PigeonFfiCodec.readValue(arg_anObject)) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSObject$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response, generic: true)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSObject$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSObject$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSObject$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNullableListWithList_error_completionHandler_ - .implementAsListener(builder, ( - NSArray? arg_list, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNullableList( - (_PigeonFfiCodec.readValue(arg_list) as List?)?.cast(), - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNullableEnumListWithEnumList_error_completionHandler_ - .implementAsListener(builder, ( - NSArray? arg_enumList, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNullableEnumList( - (_PigeonFfiCodec.readValue(arg_enumList, NativeInteropAnEnum) - as List?) - ?.cast(), - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNullableClassListWithClassList_error_completionHandler_ - .implementAsListener(builder, ( - NSArray? arg_classList, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNullableClassList( - (_PigeonFfiCodec.readValue(arg_classList) as List?) - ?.cast(), - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNullableNonNullEnumListWithEnumList_error_completionHandler_ - .implementAsListener(builder, ( - NSArray? arg_enumList, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNullableNonNullEnumList( - (_PigeonFfiCodec.readValue(arg_enumList, NativeInteropAnEnum) - as List?) - ?.cast(), - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNullableNonNullClassListWithClassList_error_completionHandler_ - .implementAsListener(builder, ( - NSArray? arg_classList, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNullableNonNullClassList( - (_PigeonFfiCodec.readValue(arg_classList) as List?) - ?.cast(), - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNullableMapWithMap_error_completionHandler_ - .implementAsListener(builder, ( - NSDictionary? arg_map, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNullableMap( - (_PigeonFfiCodec.readValue(arg_map) as Map?) - ?.cast(), - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNullableStringMapWithStringMap_error_completionHandler_ - .implementAsListener(builder, ( - NSDictionary? arg_stringMap, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNullableStringMap( - (_PigeonFfiCodec.readValue(arg_stringMap) as Map?) - ?.cast(), - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNullableIntMapWithIntMap_error_completionHandler_ - .implementAsListener(builder, ( - NSDictionary? arg_intMap, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNullableIntMap( - (_PigeonFfiCodec.readValue(arg_intMap, int, int) as Map?) - ?.cast(), - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNullableEnumMapWithEnumMap_error_completionHandler_ - .implementAsListener(builder, ( - NSDictionary? arg_enumMap, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNullableEnumMap( - (_PigeonFfiCodec.readValue( - arg_enumMap, - NativeInteropAnEnum, - NativeInteropAnEnum, - ) - as Map?) - ?.cast(), - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNullableClassMapWithClassMap_error_completionHandler_ - .implementAsListener(builder, ( - NSDictionary? arg_classMap, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNullableClassMap( - (_PigeonFfiCodec.readValue(arg_classMap, int) as Map?) - ?.cast(), - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( - completionHandler, - ).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAsyncNullableEnumWithAnEnum_error_completionHandler_ - .implementAsListener(builder, ( - NSNumber? arg_anEnum, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAsyncNullableEnum( - _PigeonFfiCodec.readValue(arg_anEnum, NativeInteropAnEnum) - as NativeInteropAnEnum?, - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); - return; - } - }); - ffi_bridge - .NativeInteropFlutterIntegrationCoreApiBridge$Builder - .echoAnotherAsyncNullableEnumWithAnotherEnum_error_completionHandler_ - .implementAsListener(builder, ( - NSNumber? arg_anotherEnum, - ffi_bridge.NativeInteropTestsError errorOut, - ObjCBlock completionHandler, - ) { - try { - if (dartApi != null) { - dartApi! - .echoAnotherAsyncNullableEnum( - _PigeonFfiCodec.readValue(arg_anotherEnum, NativeInteropAnotherEnum) - as NativeInteropAnotherEnum?, - ) - .then( - (response) { - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( - completionHandler, - ).call(_PigeonFfiCodec.writeValue(response)); - }, - onError: (Object e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( - completionHandler, - ).call(null); - }, - ); - return; - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropFlutterIntegrationCoreApi was not registered.', - ); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); - return; - } - } catch (e) { - _reportFfiError(errorOut, e); - ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); - return; - } - }); - builder.addProtocol( - ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.$protocol, - ); - final ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge impl = - ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge.as(builder.build()); - ffi_bridge.NativeInteropFlutterIntegrationCoreApiRegistrar.registerInstanceWithApi( - impl, - name: NSString(name), - ); - } - return api; - } - - @override - void noop() { - if (dartApi != null) { - dartApi!.noop(); - return; - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JObject? throwFlutterError() { - if (dartApi != null) { - final Object? response = dartApi!.throwFlutterError(); - return _PigeonJniCodec.writeValue(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JObject? throwError() { - if (dartApi != null) { - final Object? response = dartApi!.throwError(); - return _PigeonJniCodec.writeValue(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - void throwErrorFromVoid() { - if (dartApi != null) { - dartApi!.throwErrorFromVoid(); - return; - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - jni_bridge.NativeInteropAllTypes echoNativeInteropAllTypes( - jni_bridge.NativeInteropAllTypes arg_everything, - ) { - if (dartApi != null) { - final NativeInteropAllTypes response = dartApi!.echoNativeInteropAllTypes( - NativeInteropAllTypes.fromJni(arg_everything)!, - ); - return response.toJni(); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - jni_bridge.NativeInteropAllNullableTypes? echoNativeInteropAllNullableTypes( - jni_bridge.NativeInteropAllNullableTypes? arg_everything, - ) { - if (dartApi != null) { - final NativeInteropAllNullableTypes? response = dartApi!.echoNativeInteropAllNullableTypes( - NativeInteropAllNullableTypes.fromJni(arg_everything), - ); - return response?.toJni(); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - jni_bridge.NativeInteropSealedClass echoNativeInteropSealedClass( - jni_bridge.NativeInteropSealedClass arg_sealedClass, - ) { - if (dartApi != null) { - final NativeInteropSealedClass response = dartApi!.echoNativeInteropSealedClass( - NativeInteropSealedClass.fromJni(arg_sealedClass)!, - ); - return response.toJni(); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - jni_bridge.NativeInteropAllNullableTypes sendMultipleNullableTypes( - JBoolean? arg_aNullableBool, - JLong? arg_aNullableInt, - JString? arg_aNullableString, - ) { - if (dartApi != null) { - final NativeInteropAllNullableTypes response = dartApi!.sendMultipleNullableTypes( - arg_aNullableBool?.toDartBool(releaseOriginal: true), - arg_aNullableInt?.toDartInt(releaseOriginal: true), - arg_aNullableString?.toDartString(releaseOriginal: true), - ); - return response.toJni(); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - jni_bridge.NativeInteropAllNullableTypesWithoutRecursion? - echoNativeInteropAllNullableTypesWithoutRecursion( - jni_bridge.NativeInteropAllNullableTypesWithoutRecursion? arg_everything, - ) { - if (dartApi != null) { - final NativeInteropAllNullableTypesWithoutRecursion? response = dartApi! - .echoNativeInteropAllNullableTypesWithoutRecursion( - NativeInteropAllNullableTypesWithoutRecursion.fromJni(arg_everything), - ); - return response?.toJni(); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - jni_bridge.NativeInteropAllNullableTypesWithoutRecursion - sendMultipleNullableTypesWithoutRecursion( - JBoolean? arg_aNullableBool, - JLong? arg_aNullableInt, - JString? arg_aNullableString, - ) { - if (dartApi != null) { - final NativeInteropAllNullableTypesWithoutRecursion response = dartApi! - .sendMultipleNullableTypesWithoutRecursion( - arg_aNullableBool?.toDartBool(releaseOriginal: true), - arg_aNullableInt?.toDartInt(releaseOriginal: true), - arg_aNullableString?.toDartString(releaseOriginal: true), - ); - return response.toJni(); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - bool echoBool(bool arg_aBool) { - if (dartApi != null) { - final bool response = dartApi!.echoBool(arg_aBool); - return response; - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - int echoInt(int arg_anInt) { - if (dartApi != null) { - final int response = dartApi!.echoInt(arg_anInt); - return response; - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - double echoDouble(double arg_aDouble) { - if (dartApi != null) { - final double response = dartApi!.echoDouble(arg_aDouble); - return response; - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JString echoString(JString arg_aString) { - if (dartApi != null) { - final String response = dartApi!.echoString(arg_aString.toDartString(releaseOriginal: true)); - return _PigeonJniCodec.writeValue(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JByteArray echoUint8List(JByteArray arg_list) { - if (dartApi != null) { - final Uint8List response = dartApi!.echoUint8List( - _PigeonJniCodec.readValue(arg_list)! as Uint8List, - ); - return _PigeonJniCodec.writeValue(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JIntArray echoInt32List(JIntArray arg_list) { - if (dartApi != null) { - final Int32List response = dartApi!.echoInt32List( - _PigeonJniCodec.readValue(arg_list)! as Int32List, - ); - return _PigeonJniCodec.writeValue(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JLongArray echoInt64List(JLongArray arg_list) { - if (dartApi != null) { - final Int64List response = dartApi!.echoInt64List( - _PigeonJniCodec.readValue(arg_list)! as Int64List, - ); - return _PigeonJniCodec.writeValue(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JDoubleArray echoFloat64List(JDoubleArray arg_list) { - if (dartApi != null) { - final Float64List response = dartApi!.echoFloat64List( - _PigeonJniCodec.readValue(arg_list)! as Float64List, - ); - return _PigeonJniCodec.writeValue(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JList echoList(JList arg_list) { - if (dartApi != null) { - final List response = dartApi!.echoList( - (_PigeonJniCodec.readValue(arg_list)! as List).cast(), - ); - return _PigeonJniCodec.writeValue>(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JList echoEnumList( - JList arg_enumList, - ) { - if (dartApi != null) { - final List response = dartApi!.echoEnumList( - (_PigeonJniCodec.readValue(arg_enumList)! as List).cast(), - ); - return _PigeonJniCodec.writeValue>(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JList echoClassList( - JList arg_classList, - ) { - if (dartApi != null) { - final List response = dartApi!.echoClassList( - (_PigeonJniCodec.readValue(arg_classList)! as List) - .cast(), - ); - return _PigeonJniCodec.writeValue>(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JList echoNonNullEnumList( - JList arg_enumList, - ) { - if (dartApi != null) { - final List response = dartApi!.echoNonNullEnumList( - (_PigeonJniCodec.readValue(arg_enumList)! as List).cast(), - ); - return _PigeonJniCodec.writeValue>(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JList echoNonNullClassList( - JList arg_classList, - ) { - if (dartApi != null) { - final List response = dartApi!.echoNonNullClassList( - (_PigeonJniCodec.readValue(arg_classList)! as List) - .cast(), - ); - return _PigeonJniCodec.writeValue>(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JMap echoMap(JMap arg_map) { - if (dartApi != null) { - final Map response = dartApi!.echoMap( - (_PigeonJniCodec.readValue(arg_map)! as Map).cast(), - ); - return _PigeonJniCodec.writeValue>(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JMap echoStringMap(JMap arg_stringMap) { - if (dartApi != null) { - final Map response = dartApi!.echoStringMap( - (_PigeonJniCodec.readValue(arg_stringMap)! as Map) - .cast(), - ); - return _PigeonJniCodec.writeValue>(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JMap echoIntMap(JMap arg_intMap) { - if (dartApi != null) { - final Map response = dartApi!.echoIntMap( - (_PigeonJniCodec.readValue(arg_intMap)! as Map).cast(), - ); - return _PigeonJniCodec.writeValue>(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JMap echoEnumMap( - JMap arg_enumMap, - ) { - if (dartApi != null) { - final Map response = dartApi!.echoEnumMap( - (_PigeonJniCodec.readValue(arg_enumMap)! as Map) - .cast(), - ); - return _PigeonJniCodec.writeValue< - JMap - >(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JMap echoClassMap( - JMap arg_classMap, - ) { - if (dartApi != null) { - final Map response = dartApi!.echoClassMap( - (_PigeonJniCodec.readValue(arg_classMap)! as Map) - .cast(), - ); - return _PigeonJniCodec.writeValue>( - response, - ); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JMap echoNonNullStringMap(JMap arg_stringMap) { - if (dartApi != null) { - final Map response = dartApi!.echoNonNullStringMap( - (_PigeonJniCodec.readValue(arg_stringMap)! as Map).cast(), - ); - return _PigeonJniCodec.writeValue>(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JMap echoNonNullIntMap(JMap arg_intMap) { - if (dartApi != null) { - final Map response = dartApi!.echoNonNullIntMap( - (_PigeonJniCodec.readValue(arg_intMap)! as Map).cast(), - ); - return _PigeonJniCodec.writeValue>(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JMap echoNonNullEnumMap( - JMap arg_enumMap, - ) { - if (dartApi != null) { - final Map response = dartApi!.echoNonNullEnumMap( - (_PigeonJniCodec.readValue(arg_enumMap)! as Map) - .cast(), - ); - return _PigeonJniCodec.writeValue< - JMap - >(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JMap echoNonNullClassMap( - JMap arg_classMap, - ) { - if (dartApi != null) { - final Map response = dartApi!.echoNonNullClassMap( - (_PigeonJniCodec.readValue(arg_classMap)! as Map) - .cast(), - ); - return _PigeonJniCodec.writeValue>( - response, - ); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - jni_bridge.NativeInteropAnEnum echoEnum(jni_bridge.NativeInteropAnEnum arg_anEnum) { - if (dartApi != null) { - final NativeInteropAnEnum response = dartApi!.echoEnum( - NativeInteropAnEnum.fromJni(arg_anEnum)!, - ); - return response.toJni(); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - jni_bridge.NativeInteropAnotherEnum echoNativeInteropAnotherEnum( - jni_bridge.NativeInteropAnotherEnum arg_anotherEnum, - ) { - if (dartApi != null) { - final NativeInteropAnotherEnum response = dartApi!.echoNativeInteropAnotherEnum( - NativeInteropAnotherEnum.fromJni(arg_anotherEnum)!, - ); - return response.toJni(); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JBoolean? echoNullableBool(JBoolean? arg_aBool) { - if (dartApi != null) { - final bool? response = dartApi!.echoNullableBool( - arg_aBool?.toDartBool(releaseOriginal: true), - ); - return _PigeonJniCodec.writeValue(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JLong? echoNullableInt(JLong? arg_anInt) { - if (dartApi != null) { - final int? response = dartApi!.echoNullableInt(arg_anInt?.toDartInt(releaseOriginal: true)); - return _PigeonJniCodec.writeValue(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JDouble? echoNullableDouble(JDouble? arg_aDouble) { - if (dartApi != null) { - final double? response = dartApi!.echoNullableDouble( - arg_aDouble?.toDartDouble(releaseOriginal: true), - ); - return _PigeonJniCodec.writeValue(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JString? echoNullableString(JString? arg_aString) { - if (dartApi != null) { - final String? response = dartApi!.echoNullableString( - arg_aString?.toDartString(releaseOriginal: true), - ); - return _PigeonJniCodec.writeValue(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JByteArray? echoNullableUint8List(JByteArray? arg_list) { - if (dartApi != null) { - final Uint8List? response = dartApi!.echoNullableUint8List( - _PigeonJniCodec.readValue(arg_list) as Uint8List?, - ); - return _PigeonJniCodec.writeValue(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JIntArray? echoNullableInt32List(JIntArray? arg_list) { - if (dartApi != null) { - final Int32List? response = dartApi!.echoNullableInt32List( - _PigeonJniCodec.readValue(arg_list) as Int32List?, - ); - return _PigeonJniCodec.writeValue(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JLongArray? echoNullableInt64List(JLongArray? arg_list) { - if (dartApi != null) { - final Int64List? response = dartApi!.echoNullableInt64List( - _PigeonJniCodec.readValue(arg_list) as Int64List?, - ); - return _PigeonJniCodec.writeValue(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JDoubleArray? echoNullableFloat64List(JDoubleArray? arg_list) { - if (dartApi != null) { - final Float64List? response = dartApi!.echoNullableFloat64List( - _PigeonJniCodec.readValue(arg_list) as Float64List?, - ); - return _PigeonJniCodec.writeValue(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JList? echoNullableList(JList? arg_list) { - if (dartApi != null) { - final List? response = dartApi!.echoNullableList( - (_PigeonJniCodec.readValue(arg_list) as List?)?.cast(), - ); - return _PigeonJniCodec.writeValue?>(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JList? echoNullableEnumList( - JList? arg_enumList, - ) { - if (dartApi != null) { - final List? response = dartApi!.echoNullableEnumList( - (_PigeonJniCodec.readValue(arg_enumList) as List?)?.cast(), - ); - return _PigeonJniCodec.writeValue?>(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JList? echoNullableClassList( - JList? arg_classList, - ) { - if (dartApi != null) { - final List? response = dartApi!.echoNullableClassList( - (_PigeonJniCodec.readValue(arg_classList) as List?) - ?.cast(), - ); - return _PigeonJniCodec.writeValue?>( - response, - ); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JList? echoNullableNonNullEnumList( - JList? arg_enumList, - ) { - if (dartApi != null) { - final List? response = dartApi!.echoNullableNonNullEnumList( - (_PigeonJniCodec.readValue(arg_enumList) as List?)?.cast(), - ); - return _PigeonJniCodec.writeValue?>(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JList? echoNullableNonNullClassList( - JList? arg_classList, - ) { - if (dartApi != null) { - final List? response = dartApi!.echoNullableNonNullClassList( - (_PigeonJniCodec.readValue(arg_classList) as List?) - ?.cast(), - ); - return _PigeonJniCodec.writeValue?>(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JMap? echoNullableMap(JMap? arg_map) { - if (dartApi != null) { - final Map? response = dartApi!.echoNullableMap( - (_PigeonJniCodec.readValue(arg_map) as Map?)?.cast(), - ); - return _PigeonJniCodec.writeValue?>(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JMap? echoNullableStringMap(JMap? arg_stringMap) { - if (dartApi != null) { - final Map? response = dartApi!.echoNullableStringMap( - (_PigeonJniCodec.readValue(arg_stringMap) as Map?) - ?.cast(), - ); - return _PigeonJniCodec.writeValue?>(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JMap? echoNullableIntMap(JMap? arg_intMap) { - if (dartApi != null) { - final Map? response = dartApi!.echoNullableIntMap( - (_PigeonJniCodec.readValue(arg_intMap) as Map?)?.cast(), - ); - return _PigeonJniCodec.writeValue?>(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JMap? echoNullableEnumMap( - JMap? arg_enumMap, - ) { - if (dartApi != null) { - final Map? response = dartApi! - .echoNullableEnumMap( - (_PigeonJniCodec.readValue(arg_enumMap) as Map?) - ?.cast(), - ); - return _PigeonJniCodec.writeValue< - JMap? - >(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JMap? echoNullableClassMap( - JMap? arg_classMap, - ) { - if (dartApi != null) { - final Map? response = dartApi!.echoNullableClassMap( - (_PigeonJniCodec.readValue(arg_classMap) as Map?) - ?.cast(), - ); - return _PigeonJniCodec.writeValue?>( - response, - ); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JMap? echoNullableNonNullStringMap(JMap? arg_stringMap) { - if (dartApi != null) { - final Map? response = dartApi!.echoNullableNonNullStringMap( - (_PigeonJniCodec.readValue(arg_stringMap) as Map?) - ?.cast(), - ); - return _PigeonJniCodec.writeValue?>(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JMap? echoNullableNonNullIntMap(JMap? arg_intMap) { - if (dartApi != null) { - final Map? response = dartApi!.echoNullableNonNullIntMap( - (_PigeonJniCodec.readValue(arg_intMap) as Map?)?.cast(), - ); - return _PigeonJniCodec.writeValue?>(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JMap? echoNullableNonNullEnumMap( - JMap? arg_enumMap, - ) { - if (dartApi != null) { - final Map? response = dartApi! - .echoNullableNonNullEnumMap( - (_PigeonJniCodec.readValue(arg_enumMap) as Map?) - ?.cast(), - ); - return _PigeonJniCodec.writeValue< - JMap? - >(response); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - JMap? echoNullableNonNullClassMap( - JMap? arg_classMap, - ) { - if (dartApi != null) { - final Map? response = dartApi! - .echoNullableNonNullClassMap( - (_PigeonJniCodec.readValue(arg_classMap) as Map?) - ?.cast(), - ); - return _PigeonJniCodec.writeValue?>( - response, - ); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - jni_bridge.NativeInteropAnEnum? echoNullableEnum(jni_bridge.NativeInteropAnEnum? arg_anEnum) { - if (dartApi != null) { - final NativeInteropAnEnum? response = dartApi!.echoNullableEnum( - NativeInteropAnEnum.fromJni(arg_anEnum), - ); - return response?.toJni(); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - jni_bridge.NativeInteropAnotherEnum? echoAnotherNullableEnum( - jni_bridge.NativeInteropAnotherEnum? arg_anotherEnum, - ) { - if (dartApi != null) { - final NativeInteropAnotherEnum? response = dartApi!.echoAnotherNullableEnum( - NativeInteropAnotherEnum.fromJni(arg_anotherEnum), - ); - return response?.toJni(); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future noopAsync() { - if (dartApi != null) { - return dartApi!.noopAsync().then((response) { - return _PigeonJniCodec._kotlinUnit; - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future throwFlutterErrorAsync() { - if (dartApi != null) { - return dartApi!.throwFlutterErrorAsync().then((response) { - return _PigeonJniCodec.writeValue(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future echoAsyncNativeInteropAllTypes( - jni_bridge.NativeInteropAllTypes arg_everything, - ) { - if (dartApi != null) { - return dartApi! - .echoAsyncNativeInteropAllTypes(NativeInteropAllTypes.fromJni(arg_everything)!) - .then((response) { - return response.toJni(); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future echoAsyncNullableNativeInteropAllNullableTypes( - jni_bridge.NativeInteropAllNullableTypes? arg_everything, - ) { - if (dartApi != null) { - return dartApi! - .echoAsyncNullableNativeInteropAllNullableTypes( - NativeInteropAllNullableTypes.fromJni(arg_everything), - ) - .then((response) { - return response?.toJni(); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future - echoAsyncNullableNativeInteropAllNullableTypesWithoutRecursion( - jni_bridge.NativeInteropAllNullableTypesWithoutRecursion? arg_everything, - ) { - if (dartApi != null) { - return dartApi! - .echoAsyncNullableNativeInteropAllNullableTypesWithoutRecursion( - NativeInteropAllNullableTypesWithoutRecursion.fromJni(arg_everything), - ) - .then((response) { - return response?.toJni(); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future echoAsyncBool(bool arg_aBool) { - if (dartApi != null) { - return dartApi!.echoAsyncBool(arg_aBool).then((response) { - return _PigeonJniCodec.writeValue(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future echoAsyncInt(int arg_anInt) { - if (dartApi != null) { - return dartApi!.echoAsyncInt(arg_anInt).then((response) { - return _PigeonJniCodec.writeValue(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future echoAsyncDouble(double arg_aDouble) { - if (dartApi != null) { - return dartApi!.echoAsyncDouble(arg_aDouble).then((response) { - return _PigeonJniCodec.writeValue(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future echoAsyncString(JString arg_aString) { - if (dartApi != null) { - return dartApi!.echoAsyncString(arg_aString.toDartString(releaseOriginal: true)).then(( - response, - ) { - return _PigeonJniCodec.writeValue(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future echoAsyncUint8List(JByteArray arg_list) { - if (dartApi != null) { - return dartApi!.echoAsyncUint8List(_PigeonJniCodec.readValue(arg_list)! as Uint8List).then(( - response, - ) { - return _PigeonJniCodec.writeValue(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future echoAsyncInt32List(JIntArray arg_list) { - if (dartApi != null) { - return dartApi!.echoAsyncInt32List(_PigeonJniCodec.readValue(arg_list)! as Int32List).then(( - response, - ) { - return _PigeonJniCodec.writeValue(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future echoAsyncInt64List(JLongArray arg_list) { - if (dartApi != null) { - return dartApi!.echoAsyncInt64List(_PigeonJniCodec.readValue(arg_list)! as Int64List).then(( - response, - ) { - return _PigeonJniCodec.writeValue(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future echoAsyncFloat64List(JDoubleArray arg_list) { - if (dartApi != null) { - return dartApi! - .echoAsyncFloat64List(_PigeonJniCodec.readValue(arg_list)! as Float64List) - .then((response) { - return _PigeonJniCodec.writeValue(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future echoAsyncObject(JObject arg_anObject) { - if (dartApi != null) { - return dartApi!.echoAsyncObject(_PigeonJniCodec.readValue(arg_anObject)!).then((response) { - return _PigeonJniCodec.writeValue(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future> echoAsyncList(JList arg_list) { - if (dartApi != null) { - return dartApi! - .echoAsyncList((_PigeonJniCodec.readValue(arg_list)! as List).cast()) - .then((response) { - return _PigeonJniCodec.writeValue>(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future> echoAsyncEnumList( - JList arg_enumList, - ) { - if (dartApi != null) { - return dartApi! - .echoAsyncEnumList( - (_PigeonJniCodec.readValue(arg_enumList)! as List) - .cast(), - ) - .then((response) { - return _PigeonJniCodec.writeValue>(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future> echoAsyncClassList( - JList arg_classList, - ) { - if (dartApi != null) { - return dartApi! - .echoAsyncClassList( - (_PigeonJniCodec.readValue(arg_classList)! as List) - .cast(), - ) - .then((response) { - return _PigeonJniCodec.writeValue>( - response, - ); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future> echoAsyncNonNullEnumList( - JList arg_enumList, - ) { - if (dartApi != null) { - return dartApi! - .echoAsyncNonNullEnumList( - (_PigeonJniCodec.readValue(arg_enumList)! as List).cast(), - ) - .then((response) { - return _PigeonJniCodec.writeValue>(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future> echoAsyncNonNullClassList( - JList arg_classList, - ) { - if (dartApi != null) { - return dartApi! - .echoAsyncNonNullClassList( - (_PigeonJniCodec.readValue(arg_classList)! as List) - .cast(), - ) - .then((response) { - return _PigeonJniCodec.writeValue>( - response, - ); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future> echoAsyncMap(JMap arg_map) { - if (dartApi != null) { - return dartApi! - .echoAsyncMap( - (_PigeonJniCodec.readValue(arg_map)! as Map).cast(), - ) - .then((response) { - return _PigeonJniCodec.writeValue>(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future> echoAsyncStringMap(JMap arg_stringMap) { - if (dartApi != null) { - return dartApi! - .echoAsyncStringMap( - (_PigeonJniCodec.readValue(arg_stringMap)! as Map) - .cast(), - ) - .then((response) { - return _PigeonJniCodec.writeValue>(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future> echoAsyncIntMap(JMap arg_intMap) { - if (dartApi != null) { - return dartApi! - .echoAsyncIntMap( - (_PigeonJniCodec.readValue(arg_intMap)! as Map).cast(), - ) - .then((response) { - return _PigeonJniCodec.writeValue>(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future> echoAsyncEnumMap( - JMap arg_enumMap, - ) { - if (dartApi != null) { - return dartApi! - .echoAsyncEnumMap( - (_PigeonJniCodec.readValue(arg_enumMap)! as Map) - .cast(), - ) - .then((response) { - return _PigeonJniCodec.writeValue< - JMap - >(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future> echoAsyncClassMap( - JMap arg_classMap, - ) { - if (dartApi != null) { - return dartApi! - .echoAsyncClassMap( - (_PigeonJniCodec.readValue(arg_classMap)! as Map) - .cast(), - ) - .then((response) { - return _PigeonJniCodec.writeValue< - JMap - >(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future echoAsyncEnum(jni_bridge.NativeInteropAnEnum arg_anEnum) { - if (dartApi != null) { - return dartApi!.echoAsyncEnum(NativeInteropAnEnum.fromJni(arg_anEnum)!).then((response) { - return response.toJni(); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future echoAnotherAsyncEnum( - jni_bridge.NativeInteropAnotherEnum arg_anotherEnum, - ) { - if (dartApi != null) { - return dartApi!.echoAnotherAsyncEnum(NativeInteropAnotherEnum.fromJni(arg_anotherEnum)!).then( - (response) { - return response.toJni(); - }, - ); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future echoAsyncNullableBool(JBoolean? arg_aBool) { - if (dartApi != null) { - return dartApi!.echoAsyncNullableBool(arg_aBool?.toDartBool(releaseOriginal: true)).then(( - response, - ) { - return _PigeonJniCodec.writeValue(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future echoAsyncNullableInt(JLong? arg_anInt) { - if (dartApi != null) { - return dartApi!.echoAsyncNullableInt(arg_anInt?.toDartInt(releaseOriginal: true)).then(( - response, - ) { - return _PigeonJniCodec.writeValue(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future echoAsyncNullableDouble(JDouble? arg_aDouble) { - if (dartApi != null) { - return dartApi! - .echoAsyncNullableDouble(arg_aDouble?.toDartDouble(releaseOriginal: true)) - .then((response) { - return _PigeonJniCodec.writeValue(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future echoAsyncNullableString(JString? arg_aString) { - if (dartApi != null) { - return dartApi! - .echoAsyncNullableString(arg_aString?.toDartString(releaseOriginal: true)) - .then((response) { - return _PigeonJniCodec.writeValue(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future echoAsyncNullableUint8List(JByteArray? arg_list) { - if (dartApi != null) { - return dartApi! - .echoAsyncNullableUint8List(_PigeonJniCodec.readValue(arg_list) as Uint8List?) - .then((response) { - return _PigeonJniCodec.writeValue(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future echoAsyncNullableInt32List(JIntArray? arg_list) { - if (dartApi != null) { - return dartApi! - .echoAsyncNullableInt32List(_PigeonJniCodec.readValue(arg_list) as Int32List?) - .then((response) { - return _PigeonJniCodec.writeValue(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future echoAsyncNullableInt64List(JLongArray? arg_list) { - if (dartApi != null) { - return dartApi! - .echoAsyncNullableInt64List(_PigeonJniCodec.readValue(arg_list) as Int64List?) - .then((response) { - return _PigeonJniCodec.writeValue(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future echoAsyncNullableFloat64List(JDoubleArray? arg_list) { - if (dartApi != null) { - return dartApi! - .echoAsyncNullableFloat64List(_PigeonJniCodec.readValue(arg_list) as Float64List?) - .then((response) { - return _PigeonJniCodec.writeValue(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future echoAsyncNullableObject(JObject? arg_anObject) { - if (dartApi != null) { - return dartApi!.echoAsyncNullableObject(_PigeonJniCodec.readValue(arg_anObject)).then(( - response, - ) { - return _PigeonJniCodec.writeValue(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future?> echoAsyncNullableList(JList? arg_list) { - if (dartApi != null) { - return dartApi! - .echoAsyncNullableList( - (_PigeonJniCodec.readValue(arg_list) as List?)?.cast(), - ) - .then((response) { - return _PigeonJniCodec.writeValue?>(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future?> echoAsyncNullableEnumList( - JList? arg_enumList, - ) { - if (dartApi != null) { - return dartApi! - .echoAsyncNullableEnumList( - (_PigeonJniCodec.readValue(arg_enumList) as List?) - ?.cast(), - ) - .then((response) { - return _PigeonJniCodec.writeValue?>(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future?> echoAsyncNullableClassList( - JList? arg_classList, - ) { - if (dartApi != null) { - return dartApi! - .echoAsyncNullableClassList( - (_PigeonJniCodec.readValue(arg_classList) as List?) - ?.cast(), - ) - .then((response) { - return _PigeonJniCodec.writeValue?>( - response, - ); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } - } - - @override - Future?> echoAsyncNullableNonNullEnumList( - JList? arg_enumList, - ) { - if (dartApi != null) { - return dartApi! - .echoAsyncNullableNonNullEnumList( - (_PigeonJniCodec.readValue(arg_enumList) as List?) - ?.cast(), - ) - .then((response) { - return _PigeonJniCodec.writeValue?>(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } + return pigeonVar_replyValue! as bool; } - @override - Future?> echoAsyncNullableNonNullClassList( - JList? arg_classList, - ) { - if (dartApi != null) { - return dartApi! - .echoAsyncNullableNonNullClassList( - (_PigeonJniCodec.readValue(arg_classList) as List?) - ?.cast(), - ) - .then((response) { - return _PigeonJniCodec.writeValue?>( - response, - ); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); + /// Tests deregistering a Host API natively. + Future testDeregisterHostApi() async { + if (_nativeInteropApi != null) { + return _nativeInteropApi.testDeregisterHostApi(); } - } + final pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.NativeInteropHostIntegrationCoreApi.testDeregisterHostApi$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - @override - Future?> echoAsyncNullableMap(JMap? arg_map) { - if (dartApi != null) { - return dartApi! - .echoAsyncNullableMap( - (_PigeonJniCodec.readValue(arg_map) as Map?) - ?.cast(), - ) - .then((response) { - return _PigeonJniCodec.writeValue?>(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as bool; } - @override - Future?> echoAsyncNullableStringMap( - JMap? arg_stringMap, - ) { - if (dartApi != null) { - return dartApi! - .echoAsyncNullableStringMap( - (_PigeonJniCodec.readValue(arg_stringMap) as Map?) - ?.cast(), - ) - .then((response) { - return _PigeonJniCodec.writeValue?>(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); + /// Tests deregistering a Flutter API natively. + Future testDeregisterFlutterApi() async { + if (_nativeInteropApi != null) { + return _nativeInteropApi.testDeregisterFlutterApi(); } - } + final pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.NativeInteropHostIntegrationCoreApi.testDeregisterFlutterApi$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - @override - Future?> echoAsyncNullableIntMap(JMap? arg_intMap) { - if (dartApi != null) { - return dartApi! - .echoAsyncNullableIntMap( - (_PigeonJniCodec.readValue(arg_intMap) as Map?)?.cast(), - ) - .then((response) { - return _PigeonJniCodec.writeValue?>(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as bool; } - @override - Future?> - echoAsyncNullableEnumMap( - JMap? arg_enumMap, - ) { - if (dartApi != null) { - return dartApi! - .echoAsyncNullableEnumMap( - (_PigeonJniCodec.readValue(arg_enumMap) as Map?) - ?.cast(), - ) - .then((response) { - return _PigeonJniCodec.writeValue< - JMap? - >(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); + /// Registers and immediately deregisters a Host API under [name]. + Future registerAndImmediatelyDeregisterHostApi(String name) async { + if (_nativeInteropApi != null) { + return _nativeInteropApi.registerAndImmediatelyDeregisterHostApi(name); } - } + final pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.NativeInteropHostIntegrationCoreApi.registerAndImmediatelyDeregisterHostApi$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = pigeonVar_channel.send([name]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - @override - Future?> echoAsyncNullableClassMap( - JMap? arg_classMap, - ) { - if (dartApi != null) { - return dartApi! - .echoAsyncNullableClassMap( - (_PigeonJniCodec.readValue(arg_classMap) as Map?) - ?.cast(), - ) - .then((response) { - return _PigeonJniCodec.writeValue< - JMap? - >(response); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } - @override - Future echoAsyncNullableEnum( - jni_bridge.NativeInteropAnEnum? arg_anEnum, - ) { - if (dartApi != null) { - return dartApi!.echoAsyncNullableEnum(NativeInteropAnEnum.fromJni(arg_anEnum)).then(( - response, - ) { - return response?.toJni(); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); + /// Tests that calling a deregistered Flutter API under [name] fails / returns null. + Future testCallDeregisteredFlutterApi(String name) async { + if (_nativeInteropApi != null) { + return _nativeInteropApi.testCallDeregisteredFlutterApi(name); } - } + final pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.NativeInteropHostIntegrationCoreApi.testCallDeregisteredFlutterApi$pigeonVar_messageChannelSuffix'; + final pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = pigeonVar_channel.send([name]); + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - @override - Future echoAnotherAsyncNullableEnum( - jni_bridge.NativeInteropAnotherEnum? arg_anotherEnum, - ) { - if (dartApi != null) { - return dartApi! - .echoAnotherAsyncNullableEnum(NativeInteropAnotherEnum.fromJni(arg_anotherEnum)) - .then((response) { - return response?.toJni(); - }); - } else { - throw ArgumentError('NativeInteropFlutterIntegrationCoreApi was not registered.'); - } + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as bool; } } +@internal +NativeInteropFlutterIntegrationCoreApi pigeon_register_NativeInteropFlutterIntegrationCoreApi( + NativeInteropFlutterIntegrationCoreApi api, { + String name = defaultInstanceName, +}) { + throw UnsupportedError( + 'Native Interop is not supported on this platform. Use NativeInteropFlutterIntegrationCoreApi.setUp instead.', + ); +} + +final class NativeInteropFlutterIntegrationCoreApiRegistrar { + NativeInteropFlutterIntegrationCoreApi register( + NativeInteropFlutterIntegrationCoreApi api, { + String name = defaultInstanceName, + }) => pigeon_native.pigeon_register_NativeInteropFlutterIntegrationCoreApi(api, name: name); +} + +/// The core interface that the Dart platform_test code implements for host +/// integration tests to call into. abstract class NativeInteropFlutterIntegrationCoreApi { static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -21686,14 +7828,7 @@ abstract class NativeInteropFlutterIntegrationCoreApi { BinaryMessenger? binaryMessenger, String messageChannelSuffix = '', }) { - if (Platform.isAndroid && api != null) { - NativeInteropFlutterIntegrationCoreApiRegistrar().register( - api, - name: messageChannelSuffix.isEmpty ? defaultInstanceName : messageChannelSuffix, - ); - } - - if ((Platform.isIOS || Platform.isMacOS) && api != null) { + if (!kIsWeb && api != null) { NativeInteropFlutterIntegrationCoreApiRegistrar().register( api, name: messageChannelSuffix.isEmpty ? defaultInstanceName : messageChannelSuffix, @@ -24432,388 +10567,52 @@ abstract class NativeInteropFlutterIntegrationCoreApi { } } -class NativeInteropReservedNamesHostApiForNativeInterop { - NativeInteropReservedNamesHostApiForNativeInterop._withRegistrar({ - jni_bridge.NativeInteropReservedNamesHostApiRegistrar? jniApi, - ffi_bridge.NativeInteropReservedNamesHostApiSetup? ffiApi, - }) : _jniApi = jniApi, - _ffiApi = ffiApi; +@internal +NativeInteropReservedNamesHostApiForNativeInterop? +pigeon_getInstance_NativeInteropReservedNamesHostApi({String channelName = defaultInstanceName}) { + throw UnsupportedError( + 'Native Interop is not supported on this platform. Use NativeInteropReservedNamesHostApi instead.', + ); +} +abstract class NativeInteropReservedNamesHostApiForNativeInterop { /// Returns instance of NativeInteropReservedNamesHostApiForNativeInterop with specified [channelName] if one has been registered. static NativeInteropReservedNamesHostApiForNativeInterop? getInstance({ String channelName = defaultInstanceName, - }) { - final NativeInteropReservedNamesHostApiForNativeInterop res; - if (Platform.isAndroid) { - final jni_bridge.NativeInteropReservedNamesHostApiRegistrar? link = - jni_bridge.NativeInteropReservedNamesHostApiRegistrar().getInstance( - channelName.toJString(), - ); - if (link == null) { - _throwNoInstanceError(channelName); - } - res = NativeInteropReservedNamesHostApiForNativeInterop._withRegistrar(jniApi: link); - } else if (Platform.isIOS || Platform.isMacOS) { - final ffi_bridge.NativeInteropReservedNamesHostApiSetup? link = ffi_bridge - .NativeInteropReservedNamesHostApiSetup.getInstanceWithName(NSString(channelName)); - if (link == null) { - _throwNoInstanceError(channelName); - } - res = NativeInteropReservedNamesHostApiForNativeInterop._withRegistrar(ffiApi: link); - } else { - throw UnsupportedError( - 'Native Interop is not supported on this platform. Use NativeInteropReservedNamesHostApi instead.', - ); - } - return res; - } + }) => + pigeon_native.pigeon_getInstance_NativeInteropReservedNamesHostApi(channelName: channelName); - late final jni_bridge.NativeInteropReservedNamesHostApiRegistrar? _jniApi; - late final ffi_bridge.NativeInteropReservedNamesHostApiSetup? _ffiApi; + String release(String value); - String release(String value) { - try { - if (_jniApi != null) { - final JString pigeonVar_res = _jniApi.release$1(_PigeonJniCodec.writeValue(value)); - final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSString? pigeonVar_res = _ffiApi.releaseWithValue( - _PigeonFfiCodec.writeValue(value), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final String pigeonVar_dartTypeRes = pigeonVar_res!.toDartString(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + int use(int value); - int use(int value) { - try { - if (_jniApi != null) { - return _jniApi.use$1(value); - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.useWithValue(value, wrappedError: pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - final int pigeonVar_dartTypeRes = pigeonVar_res!.longValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } - - String type() { - try { - if (_jniApi != null) { - final JString pigeonVar_res = _jniApi.type$1(); - final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSString? pigeonVar_res = _ffiApi.typeWithWrappedError(pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - final String pigeonVar_dartTypeRes = pigeonVar_res!.toDartString(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + String type(); - bool isNull() { - try { - if (_jniApi != null) { - return _jniApi.isNull$1; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.isNullWithWrappedError(pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - final bool pigeonVar_dartTypeRes = pigeonVar_res!.boolValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } - - bool? isNullable() { - try { - if (_jniApi != null) { - final JBoolean? pigeonVar_res = _jniApi.isNullable(); - final bool? pigeonVar_dartTypeRes = pigeonVar_res?.toDartBool(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.isNullableWithWrappedError(pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - final bool? pigeonVar_dartTypeRes = pigeonVar_res?.boolValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + bool isNull(); - bool isOpen() { - try { - if (_jniApi != null) { - return _jniApi.isOpen; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.isOpenWithWrappedError(pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - final bool pigeonVar_dartTypeRes = pigeonVar_res!.boolValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } - - String getReference() { - try { - if (_jniApi != null) { - final JString pigeonVar_res = _jniApi.reference$1; - final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSString? pigeonVar_res = _ffiApi.getReferenceWithWrappedError(pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - final String pigeonVar_dartTypeRes = pigeonVar_res!.toDartString(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + bool? isNullable(); - void setReference(String value) { - try { - if (_jniApi != null) { - _jniApi.reference$1 = _PigeonJniCodec.writeValue(value); - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - _ffiApi.setReferenceWithValue( - _PigeonFfiCodec.writeValue(value), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - return; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } - - String getDefault() { - try { - if (_jniApi != null) { - final JString pigeonVar_res = _jniApi.default$; - final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSString? pigeonVar_res = _ffiApi.getDefaultWithWrappedError(pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - final String pigeonVar_dartTypeRes = pigeonVar_res!.toDartString(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + bool isOpen(); - Future getValueAsync() async { - try { - if (_jniApi != null) { - final JString pigeonVar_res = await _jniApi.getValueAsync(); - final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final Completer pigeonVar_completer = Completer(); - _ffiApi.getValueAsyncWithWrappedError( - pigeonVar_error, - completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSString.listener(( - NSString? pigeonVar_res, - ) { - if (pigeonVar_error.code != null) { - pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); - } else { - pigeonVar_completer.complete(pigeonVar_res!.toDartString()); - } - }), - ); - return await pigeonVar_completer.future; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + String getReference(); - NativeInteropReservedNames echoReservedNames(NativeInteropReservedNames names) { - try { - if (_jniApi != null) { - final jni_bridge.NativeInteropReservedNames pigeonVar_res = _jniApi.echoReservedNames( - names.toJni(), - ); - final NativeInteropReservedNames pigeonVar_dartTypeRes = NativeInteropReservedNames.fromJni( - pigeonVar_res, - )!; - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final ffi_bridge.NativeInteropReservedNamesBridge? pigeonVar_res = _ffiApi - .echoReservedNamesWithNames(names.toFfi(), wrappedError: pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - final NativeInteropReservedNames pigeonVar_dartTypeRes = NativeInteropReservedNames.fromFfi( - pigeonVar_res, - )!; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + void setReference(String value); - String callFlutterRelease(String value) { - try { - if (_jniApi != null) { - final JString pigeonVar_res = _jniApi.callFlutterRelease( - _PigeonJniCodec.writeValue(value), - ); - final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSString? pigeonVar_res = _ffiApi.callFlutterReleaseWithValue( - _PigeonFfiCodec.writeValue(value), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final String pigeonVar_dartTypeRes = pigeonVar_res!.toDartString(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } - - String callFlutterType() { - try { - if (_jniApi != null) { - final JString pigeonVar_res = _jniApi.callFlutterType(); - final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSString? pigeonVar_res = _ffiApi.callFlutterTypeWithWrappedError(pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - final String pigeonVar_dartTypeRes = pigeonVar_res!.toDartString(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + String getDefault(); - String callFlutterImplementIn(String value) { - try { - if (_jniApi != null) { - final JString pigeonVar_res = _jniApi.callFlutterImplementIn( - _PigeonJniCodec.writeValue(value), - ); - final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSString? pigeonVar_res = _ffiApi.callFlutterImplementInValue( - _PigeonFfiCodec.writeValue(value), - wrappedError: pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final String pigeonVar_dartTypeRes = pigeonVar_res!.toDartString(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + Future getValueAsync(); - bool callFlutterIsNull() { - try { - if (_jniApi != null) { - return _jniApi.callFlutterIsNull(); - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSNumber? pigeonVar_res = _ffiApi.callFlutterIsNullWithWrappedError(pigeonVar_error); - _throwIfFfiError(pigeonVar_error); - final bool pigeonVar_dartTypeRes = pigeonVar_res!.boolValue; - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + NativeInteropReservedNames echoReservedNames(NativeInteropReservedNames names); - String callFlutterGetReference() { - try { - if (_jniApi != null) { - final JString pigeonVar_res = _jniApi.callFlutterGetReference(); - final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); - return pigeonVar_dartTypeRes; - } else if (_ffiApi != null) { - final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); - final NSString? pigeonVar_res = _ffiApi.callFlutterGetReferenceWithWrappedError( - pigeonVar_error, - ); - _throwIfFfiError(pigeonVar_error); - final String pigeonVar_dartTypeRes = pigeonVar_res!.toDartString(); - return pigeonVar_dartTypeRes; - } else { - throw Exception('No JNI or FFI api available'); - } - } on JThrowable catch (e) { - throw _wrapJniException(e); - } - } + String callFlutterRelease(String value); + + String callFlutterType(); + + String callFlutterImplementIn(String value); + + bool callFlutterIsNull(); + + String callFlutterGetReference(); } /// Methods whose names collide with members of the bindings that JNIgen @@ -24843,7 +10642,7 @@ class NativeInteropReservedNamesHostApi { }) { NativeInteropReservedNamesHostApiForNativeInterop? nativeInteropApi; String nativeInteropApiInstanceName = ''; - if (Platform.isAndroid || Platform.isIOS || Platform.isMacOS) { + if (!kIsWeb) { if (messageChannelSuffix.isEmpty) { nativeInteropApi = NativeInteropReservedNamesHostApiForNativeInterop.getInstance(); } else { @@ -25241,188 +11040,27 @@ class NativeInteropReservedNamesHostApi { } } -/// The Flutter API counterpart of [NativeInteropReservedNamesHostApi]. -/// -/// JNIgen generates interfaces for Flutter APIs, which it renames differently -/// than classes. -final class NativeInteropReservedNamesFlutterApiRegistrar - with jni_bridge.$NativeInteropReservedNamesFlutterApi { - NativeInteropReservedNamesFlutterApi? dartApi; +@internal +NativeInteropReservedNamesFlutterApi pigeon_register_NativeInteropReservedNamesFlutterApi( + NativeInteropReservedNamesFlutterApi api, { + String name = defaultInstanceName, +}) { + throw UnsupportedError( + 'Native Interop is not supported on this platform. Use NativeInteropReservedNamesFlutterApi.setUp instead.', + ); +} +final class NativeInteropReservedNamesFlutterApiRegistrar { NativeInteropReservedNamesFlutterApi register( NativeInteropReservedNamesFlutterApi api, { String name = defaultInstanceName, - }) { - dartApi = api; - - if (Platform.isAndroid) { - final jni_bridge.NativeInteropReservedNamesFlutterApi impl = - jni_bridge.NativeInteropReservedNamesFlutterApi.implement(this); - jni_bridge.NativeInteropReservedNamesFlutterApiRegistrar().registerInstance( - impl, - name.toJString(), - ); - } - if (Platform.isIOS || Platform.isMacOS) { - final ObjCProtocolBuilder builder = ObjCProtocolBuilder( - debugName: 'NativeInteropReservedNamesFlutterApiBridge', - ); - ffi_bridge.NativeInteropReservedNamesFlutterApiBridge$Builder.releaseWithValue_error_ - .implement(builder, (NSString? arg_value, ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final String response = dartApi!.release(arg_value!.toDartString()); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropReservedNamesFlutterApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge.NativeInteropReservedNamesFlutterApiBridge$Builder.typeWithError_.implement( - builder, - (ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final String response = dartApi!.type(); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropReservedNamesFlutterApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }, - ); - ffi_bridge.NativeInteropReservedNamesFlutterApiBridge$Builder.implementInValue_error_ - .implement(builder, (NSString? arg_value, ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final String response = dartApi!.implementIn(arg_value!.toDartString()); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropReservedNamesFlutterApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - ffi_bridge.NativeInteropReservedNamesFlutterApiBridge$Builder.isNullWithError_.implement( - builder, - (ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final bool response = dartApi!.isNull(); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropReservedNamesFlutterApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }, - ); - ffi_bridge.NativeInteropReservedNamesFlutterApiBridge$Builder.getReferenceWithError_ - .implement(builder, (ffi_bridge.NativeInteropTestsError errorOut) { - try { - if (dartApi != null) { - final String response = dartApi!.getReference(); - return _PigeonFfiCodec.writeValue(response); - } else { - _reportFfiError( - errorOut, - 'ArgumentError: NativeInteropReservedNamesFlutterApi was not registered.', - ); - return null; - } - } catch (e) { - _reportFfiError(errorOut, e); - return null; - } - }); - builder.addProtocol(ffi_bridge.NativeInteropReservedNamesFlutterApiBridge$Builder.$protocol); - final ffi_bridge.NativeInteropReservedNamesFlutterApiBridge impl = - ffi_bridge.NativeInteropReservedNamesFlutterApiBridge.as(builder.build()); - ffi_bridge.NativeInteropReservedNamesFlutterApiRegistrar.registerInstanceWithApi( - impl, - name: NSString(name), - ); - } - return api; - } - - @override - JString release$1(JString arg_value) { - if (dartApi != null) { - final String response = dartApi!.release(arg_value.toDartString(releaseOriginal: true)); - return _PigeonJniCodec.writeValue(response); - } else { - throw ArgumentError('NativeInteropReservedNamesFlutterApi was not registered.'); - } - } - - @override - JString type$1() { - if (dartApi != null) { - final String response = dartApi!.type(); - return _PigeonJniCodec.writeValue(response); - } else { - throw ArgumentError('NativeInteropReservedNamesFlutterApi was not registered.'); - } - } - - @override - JString implementIn$1(JString arg_value) { - if (dartApi != null) { - final String response = dartApi!.implementIn(arg_value.toDartString(releaseOriginal: true)); - return _PigeonJniCodec.writeValue(response); - } else { - throw ArgumentError('NativeInteropReservedNamesFlutterApi was not registered.'); - } - } - - @override - bool isNull$1() { - if (dartApi != null) { - final bool response = dartApi!.isNull(); - return response; - } else { - throw ArgumentError('NativeInteropReservedNamesFlutterApi was not registered.'); - } - } - - @override - JString getReference() { - if (dartApi != null) { - final String response = dartApi!.getReference(); - return _PigeonJniCodec.writeValue(response); - } else { - throw ArgumentError('NativeInteropReservedNamesFlutterApi was not registered.'); - } - } + }) => pigeon_native.pigeon_register_NativeInteropReservedNamesFlutterApi(api, name: name); } +/// The Flutter API counterpart of [NativeInteropReservedNamesHostApi]. +/// +/// JNIgen generates interfaces for Flutter APIs, which it renames differently +/// than classes. abstract class NativeInteropReservedNamesFlutterApi { static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -25446,14 +11084,7 @@ abstract class NativeInteropReservedNamesFlutterApi { BinaryMessenger? binaryMessenger, String messageChannelSuffix = '', }) { - if (Platform.isAndroid && api != null) { - NativeInteropReservedNamesFlutterApiRegistrar().register( - api, - name: messageChannelSuffix.isEmpty ? defaultInstanceName : messageChannelSuffix, - ); - } - - if ((Platform.isIOS || Platform.isMacOS) && api != null) { + if (!kIsWeb && api != null) { NativeInteropReservedNamesFlutterApiRegistrar().register( api, name: messageChannelSuffix.isEmpty ? defaultInstanceName : messageChannelSuffix, diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/native_interop_tests.native_interop.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/native_interop_tests.native_interop.gen.dart new file mode 100644 index 000000000000..ffb4a1fb1413 --- /dev/null +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/native_interop_tests.native_interop.gen.dart @@ -0,0 +1,13996 @@ +// Copyright 2013 The Flutter Authors +// 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 +// ignore_for_file: unused_import, unused_shown_name +// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, omit_local_variable_types, omit_obvious_local_variable_types + +import 'dart:async'; +import 'dart:ffi'; +import 'dart:io' show Platform; +import 'dart:typed_data' show Float32List, Float64List, Int32List, Int64List, Int8List, TypedData; + +import 'package:ffi/ffi.dart'; +import 'package:flutter/services.dart'; +import 'package:jni/jni.dart'; +import 'package:objective_c/objective_c.dart'; +import './native_interop_tests.gen.dart'; +import './native_interop_tests.gen.ffi.dart' as ffi_bridge; +import './native_interop_tests.gen.jni.dart' as jni_bridge; + +class _PigeonJniCodec { + static JObject get _kotlinUnit { + final JClass unitClass = JClass.forName('kotlin/Unit'); + try { + return unitClass.staticFieldId('INSTANCE', 'Lkotlin/Unit;').get(unitClass, JObject.type); + } finally { + unitClass.release(); + } + } + + static Object? readValue(JObject? value) { + if (value == null) { + return null; + } + if (value.isA(JLong.type)) { + return value.as(JLong.type).longValue(); + } else if (value.isA(JDouble.type)) { + return value.as(JDouble.type).doubleValue(); + } else if (value.isA(JString.type)) { + return value.as(JString.type).toDartString(); + } else if (value.isA(JBoolean.type)) { + return value.as(JBoolean.type).booleanValue(); + } else if (value.isA(JByteArray.type)) { + final JByteArray array = value.as(JByteArray.type); + return Uint8List.fromList(array.getRange(0, array.length).buffer.asUint8List()); + } else if (value.isA(JIntArray.type)) { + final JIntArray array = value.as(JIntArray.type); + return Int32List.fromList(array.getRange(0, array.length)); + } else if (value.isA(JLongArray.type)) { + final JLongArray array = value.as(JLongArray.type); + return Int64List.fromList(array.getRange(0, array.length)); + } else if (value.isA(JDoubleArray.type)) { + final JDoubleArray array = value.as(JDoubleArray.type); + return Float64List.fromList(array.getRange(0, array.length)); + } else if (value.isA>(JList.type as JType>)) { + final List list = value.as(JList.type).asDart(); + final res = []; + // Cache the length before iterating to avoid a JNI hop per iteration. + final int len = list.length; + for (int i = 0; i < len; i++) { + res.add(readValue(list[i])); + } + return res; + } else if (value.isA>(JMap.type as JType>)) { + final Map map = value.as(JMap.type).asDart(); + final res = {}; + for (final MapEntry entry in map.entries) { + res[readValue(entry.key)] = readValue(entry.value); + } + return res; + } else if (value.isA( + jni_bridge.NativeInteropUnusedClass.type, + )) { + return _PigeonInternalNativeInteropUnusedClassNativeInterop.fromJni( + value.as(jni_bridge.NativeInteropUnusedClass.type), + ); + } else if (value.isA(jni_bridge.NativeInteropAllTypes.type)) { + return _PigeonInternalNativeInteropAllTypesNativeInterop.fromJni( + value.as(jni_bridge.NativeInteropAllTypes.type), + ); + } else if (value.isA( + jni_bridge.NativeInteropAllNullableTypes.type, + )) { + return _PigeonInternalNativeInteropAllNullableTypesNativeInterop.fromJni( + value.as(jni_bridge.NativeInteropAllNullableTypes.type), + ); + } else if (value.isA( + jni_bridge.NativeInteropAllNullableTypesWithoutRecursion.type, + )) { + return _PigeonInternalNativeInteropAllNullableTypesWithoutRecursionNativeInterop.fromJni( + value.as(jni_bridge.NativeInteropAllNullableTypesWithoutRecursion.type), + ); + } else if (value.isA( + jni_bridge.NativeInteropAllClassesWrapper.type, + )) { + return _PigeonInternalNativeInteropAllClassesWrapperNativeInterop.fromJni( + value.as(jni_bridge.NativeInteropAllClassesWrapper.type), + ); + } else if (value.isA( + jni_bridge.NativeInteropSealedClassWithFields.type, + )) { + return _PigeonInternalNativeInteropSealedClassWithFieldsNativeInterop.fromJni( + value.as(jni_bridge.NativeInteropSealedClassWithFields.type), + ); + } else if (value.isA( + jni_bridge.NativeInteropEmptySealedClass.type, + )) { + return _PigeonInternalNativeInteropEmptySealedClassNativeInterop.fromJni( + value.as(jni_bridge.NativeInteropEmptySealedClass.type), + ); + } else if (value.isA( + jni_bridge.NativeInteropSealedClassWrapper.type, + )) { + return _PigeonInternalNativeInteropSealedClassWrapperNativeInterop.fromJni( + value.as(jni_bridge.NativeInteropSealedClassWrapper.type), + ); + } else if (value.isA( + jni_bridge.NativeInteropReservedNames.type, + )) { + return _PigeonInternalNativeInteropReservedNamesNativeInterop.fromJni( + value.as(jni_bridge.NativeInteropReservedNames.type), + ); + } else if (value.isA(jni_bridge.NativeInteropAnEnum.type)) { + return _PigeonInternalNativeInteropAnEnumNativeInterop.fromJni( + value.as(jni_bridge.NativeInteropAnEnum.type), + ); + } else if (value.isA( + jni_bridge.NativeInteropAnotherEnum.type, + )) { + return _PigeonInternalNativeInteropAnotherEnumNativeInterop.fromJni( + value.as(jni_bridge.NativeInteropAnotherEnum.type), + ); + } else { + throw ArgumentError.value(value); + } + } + + static T writeValue(Object? value) { + if (value == null) { + return null as T; + } + if (value is bool) { + return JBoolean(value) as T; + } else if (value is double) { + return JDouble(value) as T; + // ignore: avoid_double_and_int_checks + } else if (value is int) { + return JLong(value) as T; + } else if (value is String) { + return value.toJString() as T; + } else if (value is Uint8List) { + final JByteArray array = JByteArray(value.length); + array.setRange( + 0, + value.length, + Int8List.view(value.buffer, value.offsetInBytes, value.length), + ); + return array as T; + } else if (value is Int32List) { + final JIntArray array = JIntArray(value.length); + array.setRange(0, value.length, value); + return array as T; + } else if (value is Int64List) { + final JLongArray array = JLongArray(value.length); + array.setRange(0, value.length, value); + return array as T; + } else if (value is Float64List) { + final JDoubleArray array = JDoubleArray(value.length); + array.setRange(0, value.length, value); + return array as T; + } else if (value is List) { + return value + .map( + (e) => writeValue(e), + ) + .toJList() + as T; + } else if (value is List) { + return value.map((e) => writeValue(e)).toJList() as T; + } else if (value is List) { + return value.map((e) => writeValue(e)).toJList() as T; + } else if (value is List) { + return value.map((e) => writeValue(e)).toJList() as T; + } else if (value is List) { + return value.map((e) => writeValue(e)).toJList() as T; + } else if (value is List) { + return value + .map( + (e) => writeValue(e), + ) + .toJList() + as T; + } else if (value is List) { + return value + .map( + (e) => writeValue(e), + ) + .toJList() + as T; + } else if (value is List) { + return value + .map( + (e) => writeValue(e), + ) + .toJList() + as T; + } else if (value is List) { + return value.map((e) => writeValue(e)).toJList() as T; + } else if (value is List) { + return value.map((e) => writeValue(e)).toJList() as T; + } else if (value is List) { + return value.map((e) => writeValue(e)).toJList() as T; + } else if (value is List) { + return value.map((e) => writeValue(e)).toJList() as T; + } else if (value is List) { + return value + .map( + (e) => writeValue(e), + ) + .toJList() + as T; + } else if (value is List) { + return value + .map( + (e) => writeValue(e), + ) + .toJList() + as T; + } else if (value is List) { + return value + .map( + (e) => writeValue(e), + ) + .toJList() + as T; + } else if (value is List>) { + return value.map>((e) => writeValue>(e)).toJList() as T; + } else if (value is List?>) { + return value.map?>((e) => writeValue?>(e)).toJList() as T; + } else if (value is List>) { + return value + .map>((e) => writeValue>(e)) + .toJList() + as T; + } else if (value is List?>) { + return value + .map?>((e) => writeValue?>(e)) + .toJList() + as T; + } else if (value is List) { + return value.map((e) => writeValue(e)).toJList() as T; + } else if (value is List) { + return value.map((e) => writeValue(e)).toJList() as T; + } else if (value is Map) { + return value + .map( + (k, v) => MapEntry(writeValue(k), writeValue(v)), + ) + .toJMap() + as T; + } else if (value is Map) { + return value + .map((k, v) => MapEntry(writeValue(k), writeValue(v))) + .toJMap() + as T; + } else if (value is Map) { + return value + .map( + (k, v) => MapEntry( + writeValue(k), + writeValue(v), + ), + ) + .toJMap() + as T; + } else if (value is Map) { + return value + .map( + (k, v) => MapEntry( + writeValue(k), + writeValue(v), + ), + ) + .toJMap() + as T; + } else if (value is Map) { + return value + .map( + (k, v) => MapEntry( + writeValue(k), + writeValue(v), + ), + ) + .toJMap() + as T; + } else if (value is Map) { + return value + .map( + (k, v) => MapEntry(writeValue(k), writeValue(v)), + ) + .toJMap() + as T; + } else if (value is Map) { + return value + .map((k, v) => MapEntry(writeValue(k), writeValue(v))) + .toJMap() + as T; + } else if (value is Map) { + return value + .map( + (k, v) => MapEntry( + writeValue(k), + writeValue(v), + ), + ) + .toJMap() + as T; + } else if (value is Map) { + return value + .map( + (k, v) => MapEntry( + writeValue(k), + writeValue(v), + ), + ) + .toJMap() + as T; + } else if (value is Map) { + return value + .map( + (k, v) => MapEntry( + writeValue(k), + writeValue(v), + ), + ) + .toJMap() + as T; + } else if (value is Map>) { + return value + .map>( + (k, v) => MapEntry(writeValue(k), writeValue>(v)), + ) + .toJMap() + as T; + } else if (value is Map?>) { + return value + .map?>( + (k, v) => MapEntry(writeValue(k), writeValue?>(v)), + ) + .toJMap() + as T; + } else if (value is Map>) { + return value + .map>( + (k, v) => MapEntry(writeValue(k), writeValue>(v)), + ) + .toJMap() + as T; + } else if (value is Map?>) { + return value + .map?>( + (k, v) => MapEntry(writeValue(k), writeValue?>(v)), + ) + .toJMap() + as T; + } else if (value is Map) { + return value + .map( + (k, v) => MapEntry(writeValue(k), writeValue(v)), + ) + .toJMap() + as T; + } else if (value is Map) { + return value + .map( + (k, v) => MapEntry(writeValue(k), writeValue(v)), + ) + .toJMap() + as T; + } else if (value is Map) { + return value + .map( + (k, v) => MapEntry(writeValue(k), writeValue(v)), + ) + .toJMap() + as T; + } else if (value is NativeInteropUnusedClass) { + return value.toJni() as T; + } else if (value is NativeInteropAllTypes) { + return value.toJni() as T; + } else if (value is NativeInteropAllNullableTypes) { + return value.toJni() as T; + } else if (value is NativeInteropAllNullableTypesWithoutRecursion) { + return value.toJni() as T; + } else if (value is NativeInteropAllClassesWrapper) { + return value.toJni() as T; + } else if (value is NativeInteropSealedClassWithFields) { + return value.toJni() as T; + } else if (value is NativeInteropEmptySealedClass) { + return value.toJni() as T; + } else if (value is NativeInteropSealedClassWrapper) { + return value.toJni() as T; + } else if (value is NativeInteropReservedNames) { + return value.toJni() as T; + } else if (value is NativeInteropAnEnum) { + return value.toJni() as T; + } else if (value is NativeInteropAnotherEnum) { + return value.toJni() as T; + } else { + throw ArgumentError.value(value); + } + } +} + +class _PigeonFfiCodec { + static Object? readValue(ObjCObject? value, [Type? type, Type? type2]) { + if (value == null || ffi_bridge.NativeInteropTestsPigeonInternalNull.isA(value)) { + return null; + } else if (NSNumber.isA(value)) { + final NSNumber numValue = NSNumber.as(value); + if (type == double) { + return numValue.doubleValue; + } else if (type == bool) { + return numValue.boolValue; + } else if (type == NativeInteropAnEnum) { + return _PigeonInternalNativeInteropAnEnumNativeInterop.fromNSNumber(numValue); + } else if (type == NativeInteropAnotherEnum) { + return _PigeonInternalNativeInteropAnotherEnumNativeInterop.fromNSNumber(numValue); + } + + return numValue.longValue; + } else if (NSString.isA(value)) { + return NSString.as(value).toDartString(); + } else if (ffi_bridge.NativeInteropTestsPigeonTypedData.isA(value)) { + return _getValueFromPigeonTypedData(value as ffi_bridge.NativeInteropTestsPigeonTypedData); + } else if (NSArray.isA(value)) { + final NSArray array = NSArray.as(value); + final List res = []; + for (int i = 0; i < array.count; i++) { + res.add(readValue(array.objectAtIndex(i), type)); + } + return res; + } else if (NSDictionary.isA(value)) { + final NSDictionary dict = NSDictionary.as(value); + final NSArray keys = dict.allKeys; + final Map res = {}; + for (int i = 0; i < keys.count; i++) { + final ObjCObject key = keys.objectAtIndex(i); + res[readValue(key, type, type2)] = readValue(dict.objectForKey(key), type, type2); + } + return res; + } else if (ffi_bridge.NativeInteropTestsNumberWrapper.isA(value)) { + return _convertNumberWrapperToDart(ffi_bridge.NativeInteropTestsNumberWrapper.as(value)); + } else if (ffi_bridge.NativeInteropUnusedClassBridge.isA(value)) { + return _PigeonInternalNativeInteropUnusedClassNativeInterop.fromFfi( + ffi_bridge.NativeInteropUnusedClassBridge.as(value), + ); + } else if (ffi_bridge.NativeInteropAllTypesBridge.isA(value)) { + return _PigeonInternalNativeInteropAllTypesNativeInterop.fromFfi( + ffi_bridge.NativeInteropAllTypesBridge.as(value), + ); + } else if (ffi_bridge.NativeInteropAllNullableTypesBridge.isA(value)) { + return _PigeonInternalNativeInteropAllNullableTypesNativeInterop.fromFfi( + ffi_bridge.NativeInteropAllNullableTypesBridge.as(value), + ); + } else if (ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge.isA(value)) { + return _PigeonInternalNativeInteropAllNullableTypesWithoutRecursionNativeInterop.fromFfi( + ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge.as(value), + ); + } else if (ffi_bridge.NativeInteropAllClassesWrapperBridge.isA(value)) { + return _PigeonInternalNativeInteropAllClassesWrapperNativeInterop.fromFfi( + ffi_bridge.NativeInteropAllClassesWrapperBridge.as(value), + ); + } else if (ffi_bridge.NativeInteropSealedClassWithFieldsBridge.isA(value)) { + return _PigeonInternalNativeInteropSealedClassWithFieldsNativeInterop.fromFfi( + ffi_bridge.NativeInteropSealedClassWithFieldsBridge.as(value), + ); + } else if (ffi_bridge.NativeInteropEmptySealedClassBridge.isA(value)) { + return _PigeonInternalNativeInteropEmptySealedClassNativeInterop.fromFfi( + ffi_bridge.NativeInteropEmptySealedClassBridge.as(value), + ); + } else if (ffi_bridge.NativeInteropSealedClassWrapperBridge.isA(value)) { + return _PigeonInternalNativeInteropSealedClassWrapperNativeInterop.fromFfi( + ffi_bridge.NativeInteropSealedClassWrapperBridge.as(value), + ); + } else if (ffi_bridge.NativeInteropReservedNamesBridge.isA(value)) { + return _PigeonInternalNativeInteropReservedNamesNativeInterop.fromFfi( + ffi_bridge.NativeInteropReservedNamesBridge.as(value), + ); + } else { + throw ArgumentError.value(value); + } + } + + static T writeValue(Object? value, {bool generic = false}) { + if (value == null) { + if (_isTypeOrNullableType(ObjCObject) || _isTypeOrNullableType(NSObject)) { + return ffi_bridge.NativeInteropTestsPigeonInternalNull() as T; + } + return null as T; + } + if (value is bool) { + return (generic + ? _convertToFfiNumberWrapper(value) + : NSNumber.alloc().initWithLong(value ? 1 : 0)) + as T; + } else if (value is double) { + return (generic ? _convertToFfiNumberWrapper(value) : NSNumber.alloc().initWithDouble(value)) + as T; + // ignore: avoid_double_and_int_checks + } else if (value is int) { + return (generic ? _convertToFfiNumberWrapper(value) : NSNumber.alloc().initWithLong(value)) + as T; + } else if (value is Enum) { + return (generic + ? _convertToFfiNumberWrapper(value) + : NSNumber.alloc().initWithLong(value.index)) + as T; + } else if (value is String) { + return NSString(value) as T; + } else if (value is TypedData) { + return _toPigeonTypedData(value) as T; + } else if (value is List && + _isTypeOrNullableType(T)) { + final NSMutableArray res = NSMutableArray(); + for (final NativeInteropSealedClass entry in value) { + res.addObject(writeValue(entry, generic: true)); + } + return res as T; + } else if (value is List && _isTypeOrNullableType(T)) { + final NSMutableArray res = NSMutableArray(); + for (final String entry in value) { + res.addObject(writeValue(entry, generic: true)); + } + return res as T; + } else if (value is List && _isTypeOrNullableType(T)) { + final NSMutableArray res = NSMutableArray(); + for (final int entry in value) { + res.addObject(writeValue(entry, generic: true)); + } + return res as T; + } else if (value is List && _isTypeOrNullableType(T)) { + final NSMutableArray res = NSMutableArray(); + for (final double entry in value) { + res.addObject(writeValue(entry, generic: true)); + } + return res as T; + } else if (value is List && _isTypeOrNullableType(T)) { + final NSMutableArray res = NSMutableArray(); + for (final bool entry in value) { + res.addObject(writeValue(entry, generic: true)); + } + return res as T; + } else if (value is List && _isTypeOrNullableType(T)) { + final NSMutableArray res = NSMutableArray(); + for (final NativeInteropAllTypes? entry in value) { + res.addObject( + entry == null + ? ffi_bridge.NativeInteropTestsPigeonInternalNull() + : writeValue(entry, generic: true), + ); + } + return res as T; + } else if (value is List && _isTypeOrNullableType(T)) { + final NSMutableArray res = NSMutableArray(); + for (final NativeInteropAnEnum entry in value) { + res.addObject(writeValue(entry, generic: true)); + } + return res as T; + } else if (value is List && + _isTypeOrNullableType(T)) { + final NSMutableArray res = NSMutableArray(); + for (final NativeInteropAllNullableTypes entry in value) { + res.addObject( + writeValue(entry, generic: true), + ); + } + return res as T; + } else if (value is List && _isTypeOrNullableType(T)) { + final NSMutableArray res = NSMutableArray(); + for (final String? entry in value) { + res.addObject( + entry == null + ? ffi_bridge.NativeInteropTestsPigeonInternalNull() + : writeValue(entry, generic: true), + ); + } + return res as T; + } else if (value is List && _isTypeOrNullableType(T)) { + final NSMutableArray res = NSMutableArray(); + for (final int? entry in value) { + res.addObject( + entry == null + ? ffi_bridge.NativeInteropTestsPigeonInternalNull() + : writeValue(entry, generic: true), + ); + } + return res as T; + } else if (value is List && _isTypeOrNullableType(T)) { + final NSMutableArray res = NSMutableArray(); + for (final double? entry in value) { + res.addObject( + entry == null + ? ffi_bridge.NativeInteropTestsPigeonInternalNull() + : writeValue(entry, generic: true), + ); + } + return res as T; + } else if (value is List && _isTypeOrNullableType(T)) { + final NSMutableArray res = NSMutableArray(); + for (final bool? entry in value) { + res.addObject( + entry == null + ? ffi_bridge.NativeInteropTestsPigeonInternalNull() + : writeValue(entry, generic: true), + ); + } + return res as T; + } else if (value is List && _isTypeOrNullableType(T)) { + final NSMutableArray res = NSMutableArray(); + for (final NativeInteropAnEnum? entry in value) { + res.addObject( + entry == null + ? ffi_bridge.NativeInteropTestsPigeonInternalNull() + : writeValue(entry, generic: true), + ); + } + return res as T; + } else if (value is List && + _isTypeOrNullableType(T)) { + final NSMutableArray res = NSMutableArray(); + for (final NativeInteropAllNullableTypes? entry in value) { + res.addObject( + entry == null + ? ffi_bridge.NativeInteropTestsPigeonInternalNull() + : writeValue(entry, generic: true), + ); + } + return res as T; + } else if (value is List && + _isTypeOrNullableType(T)) { + final NSMutableArray res = NSMutableArray(); + for (final NativeInteropAllNullableTypesWithoutRecursion? entry in value) { + res.addObject( + entry == null + ? ffi_bridge.NativeInteropTestsPigeonInternalNull() + : writeValue( + entry, + generic: true, + ), + ); + } + return res as T; + } else if (value is List> && _isTypeOrNullableType(T)) { + final NSMutableArray res = NSMutableArray(); + for (final List entry in value) { + res.addObject(writeValue(entry, generic: true)); + } + return res as T; + } else if (value is List?> && _isTypeOrNullableType(T)) { + final NSMutableArray res = NSMutableArray(); + for (final List? entry in value) { + res.addObject( + entry == null + ? ffi_bridge.NativeInteropTestsPigeonInternalNull() + : writeValue(entry, generic: true), + ); + } + return res as T; + } else if (value is List> && _isTypeOrNullableType(T)) { + final NSMutableArray res = NSMutableArray(); + for (final Map entry in value) { + res.addObject(writeValue(entry, generic: true)); + } + return res as T; + } else if (value is List?> && _isTypeOrNullableType(T)) { + final NSMutableArray res = NSMutableArray(); + for (final Map? entry in value) { + res.addObject( + entry == null + ? ffi_bridge.NativeInteropTestsPigeonInternalNull() + : writeValue(entry, generic: true), + ); + } + return res as T; + } else if (value is List) { + final NSMutableArray res = NSMutableArray(); + for (final Object? entry in value) { + res.addObject( + entry == null + ? ffi_bridge.NativeInteropTestsPigeonInternalNull() + : writeValue(entry, generic: true), + ); + } + return res as T; + } else if (value is Map && _isTypeOrNullableType(T)) { + final NSMutableDictionary res = NSMutableDictionary(); + for (final MapEntry entry in value.entries) { + res.setObject( + writeValue(entry.value, generic: true), + forKey: NSCopying.as(writeValue(entry.key, generic: true)), + ); + } + return res as T; + } else if (value is Map && _isTypeOrNullableType(T)) { + final NSMutableDictionary res = NSMutableDictionary(); + for (final MapEntry entry in value.entries) { + res.setObject( + writeValue(entry.value, generic: true), + forKey: NSCopying.as(writeValue(entry.key, generic: true)), + ); + } + return res as T; + } else if (value is Map && + _isTypeOrNullableType(T)) { + final NSMutableDictionary res = NSMutableDictionary(); + for (final MapEntry entry in value.entries) { + res.setObject( + writeValue(entry.value, generic: true), + forKey: NSCopying.as(writeValue(entry.key, generic: true)), + ); + } + return res as T; + } else if (value is Map && + _isTypeOrNullableType(T)) { + final NSMutableDictionary res = NSMutableDictionary(); + for (final MapEntry entry in value.entries) { + res.setObject( + writeValue(entry.value, generic: true), + forKey: NSCopying.as(writeValue(entry.key, generic: true)), + ); + } + return res as T; + } else if (value is Map && + _isTypeOrNullableType(T)) { + final NSMutableDictionary res = NSMutableDictionary(); + for (final MapEntry entry in value.entries) { + res.setObject( + writeValue(entry.value, generic: true), + forKey: NSCopying.as(writeValue(entry.key, generic: true)), + ); + } + return res as T; + } else if (value is Map && _isTypeOrNullableType(T)) { + final NSMutableDictionary res = NSMutableDictionary(); + for (final MapEntry entry in value.entries) { + res.setObject( + writeValue(entry.value, generic: true), + forKey: NSCopying.as(writeValue(entry.key, generic: true)), + ); + } + return res as T; + } else if (value is Map && _isTypeOrNullableType(T)) { + final NSMutableDictionary res = NSMutableDictionary(); + for (final MapEntry entry in value.entries) { + res.setObject( + writeValue(entry.value, generic: true), + forKey: NSCopying.as(writeValue(entry.key, generic: true)), + ); + } + return res as T; + } else if (value is Map && + _isTypeOrNullableType(T)) { + final NSMutableDictionary res = NSMutableDictionary(); + for (final MapEntry entry in value.entries) { + res.setObject( + writeValue(entry.value, generic: true), + forKey: NSCopying.as(writeValue(entry.key, generic: true)), + ); + } + return res as T; + } else if (value is Map && + _isTypeOrNullableType(T)) { + final NSMutableDictionary res = NSMutableDictionary(); + for (final MapEntry entry in value.entries) { + res.setObject( + writeValue(entry.value, generic: true), + forKey: NSCopying.as(writeValue(entry.key, generic: true)), + ); + } + return res as T; + } else if (value is Map && + _isTypeOrNullableType(T)) { + final NSMutableDictionary res = NSMutableDictionary(); + for (final MapEntry entry + in value.entries) { + res.setObject( + writeValue(entry.value, generic: true), + forKey: NSCopying.as(writeValue(entry.key, generic: true)), + ); + } + return res as T; + } else if (value is Map> && _isTypeOrNullableType(T)) { + final NSMutableDictionary res = NSMutableDictionary(); + for (final MapEntry> entry in value.entries) { + res.setObject( + writeValue(entry.value, generic: true), + forKey: NSCopying.as(writeValue(entry.key, generic: true)), + ); + } + return res as T; + } else if (value is Map?> && _isTypeOrNullableType(T)) { + final NSMutableDictionary res = NSMutableDictionary(); + for (final MapEntry?> entry in value.entries) { + res.setObject( + writeValue(entry.value, generic: true), + forKey: NSCopying.as(writeValue(entry.key, generic: true)), + ); + } + return res as T; + } else if (value is Map> && _isTypeOrNullableType(T)) { + final NSMutableDictionary res = NSMutableDictionary(); + for (final MapEntry> entry in value.entries) { + res.setObject( + writeValue(entry.value, generic: true), + forKey: NSCopying.as(writeValue(entry.key, generic: true)), + ); + } + return res as T; + } else if (value is Map?> && + _isTypeOrNullableType(T)) { + final NSMutableDictionary res = NSMutableDictionary(); + for (final MapEntry?> entry in value.entries) { + res.setObject( + writeValue(entry.value, generic: true), + forKey: NSCopying.as(writeValue(entry.key, generic: true)), + ); + } + return res as T; + } else if (value is Map) { + final NSMutableDictionary res = NSMutableDictionary(); + for (final MapEntry entry in value.entries) { + res.setObject( + writeValue(entry.value, generic: true), + forKey: NSCopying.as(writeValue(entry.key, generic: true)), + ); + } + return res as T; + } else if (value is NativeInteropUnusedClass) { + return value.toFfi() as T; + } else if (value is NativeInteropAllTypes) { + return value.toFfi() as T; + } else if (value is NativeInteropAllNullableTypes) { + return value.toFfi() as T; + } else if (value is NativeInteropAllNullableTypesWithoutRecursion) { + return value.toFfi() as T; + } else if (value is NativeInteropAllClassesWrapper) { + return value.toFfi() as T; + } else if (value is NativeInteropSealedClassWithFields) { + return value.toFfi() as T; + } else if (value is NativeInteropEmptySealedClass) { + return value.toFfi() as T; + } else if (value is NativeInteropSealedClassWrapper) { + return value.toFfi() as T; + } else if (value is NativeInteropReservedNames) { + return value.toFfi() as T; + } else { + throw ArgumentError.value(value); + } + } +} + +ffi_bridge.NativeInteropTestsPigeonTypedData _toPigeonTypedData(TypedData value) { + final int lengthInBytes = value.lengthInBytes; + if (value is Uint8List) { + final int length = value.length; + final Pointer ptr = calloc(length); + ptr.asTypedList(length).setAll(0, value); + final NSData nsData = NSData.dataWithBytes(ptr.cast(), length: lengthInBytes); + calloc.free(ptr); + return ffi_bridge.NativeInteropTestsPigeonTypedData.alloc().initWithData(nsData, type: 0); + } else if (value is Int32List) { + final int length = value.length; + final Pointer ptr = calloc(length); + ptr.asTypedList(length).setAll(0, value); + final NSData nsData = NSData.dataWithBytes(ptr.cast(), length: lengthInBytes); + calloc.free(ptr); + return ffi_bridge.NativeInteropTestsPigeonTypedData.alloc().initWithData(nsData, type: 1); + } else if (value is Int64List) { + final int length = value.length; + final Pointer ptr = calloc(length); + ptr.asTypedList(length).setAll(0, value); + final NSData nsData = NSData.dataWithBytes(ptr.cast(), length: lengthInBytes); + calloc.free(ptr); + return ffi_bridge.NativeInteropTestsPigeonTypedData.alloc().initWithData(nsData, type: 2); + } else if (value is Float32List) { + final int length = value.length; + final Pointer ptr = calloc(length); + ptr.asTypedList(length).setAll(0, value); + final NSData nsData = NSData.dataWithBytes(ptr.cast(), length: lengthInBytes); + calloc.free(ptr); + return ffi_bridge.NativeInteropTestsPigeonTypedData.alloc().initWithData(nsData, type: 3); + } else if (value is Float64List) { + final int length = value.length; + final Pointer ptr = calloc(length); + ptr.asTypedList(length).setAll(0, value); + final NSData nsData = NSData.dataWithBytes(ptr.cast(), length: lengthInBytes); + calloc.free(ptr); + return ffi_bridge.NativeInteropTestsPigeonTypedData.alloc().initWithData(nsData, type: 4); + } + throw ArgumentError.value(value); +} + +Object? _getValueFromPigeonTypedData(ffi_bridge.NativeInteropTestsPigeonTypedData value) { + final NSData data = value.data; + final ObjCObjectRef dataRef = data.object$.ref; + try { + final int lengthInBytes = data.length; + if (lengthInBytes == 0) { + return switch (value.type) { + 0 => Uint8List(0), + 1 => Int32List(0), + 2 => Int64List(0), + 3 => Float32List(0), + 4 => Float64List(0), + _ => throw ArgumentError.value(value), + }; + } + final Pointer bytes = data.bytes; + return switch (value.type) { + 0 => Uint8List.fromList(bytes.cast().asTypedList(lengthInBytes)), + 1 => Int32List.fromList(bytes.cast().asTypedList(lengthInBytes ~/ 4)), + 2 => Int64List.fromList(bytes.cast().asTypedList(lengthInBytes ~/ 8)), + 3 => Float32List.fromList(bytes.cast().asTypedList(lengthInBytes ~/ 4)), + 4 => Float64List.fromList(bytes.cast().asTypedList(lengthInBytes ~/ 8)), + _ => throw ArgumentError.value(value), + }; + } finally { + dataRef.release(); + } +} + +Object? _convertNumberWrapperToDart(ffi_bridge.NativeInteropTestsNumberWrapper value) { + switch (value.type) { + case 1: + return value.number.longValue; + case 2: + return value.number.doubleValue; + case 3: + return value.number.boolValue; + case 4: + return _PigeonInternalNativeInteropAnEnumNativeInterop.fromNSNumber(value.number); + case 5: + return _PigeonInternalNativeInteropAnotherEnumNativeInterop.fromNSNumber(value.number); + default: + throw ArgumentError.value(value); + } +} + +ffi_bridge.NativeInteropTestsNumberWrapper _convertToFfiNumberWrapper(Object value) { + switch (value) { + case int _: + return ffi_bridge.NativeInteropTestsNumberWrapper.alloc().initWithNumber( + NSNumber.alloc().initWithLong(value), + type: 1, + ); + case double _: + return ffi_bridge.NativeInteropTestsNumberWrapper.alloc().initWithNumber( + NSNumber.alloc().initWithDouble(value), + type: 2, + ); + case bool _: + return ffi_bridge.NativeInteropTestsNumberWrapper.alloc().initWithNumber( + NSNumber.alloc().initWithLong(value ? 1 : 0), + type: 3, + ); + case NativeInteropAnEnum _: + return ffi_bridge.NativeInteropTestsNumberWrapper.alloc().initWithNumber( + value.toNSNumber(), + type: 4, + ); + case NativeInteropAnotherEnum _: + return ffi_bridge.NativeInteropTestsNumberWrapper.alloc().initWithNumber( + value.toNSNumber(), + type: 5, + ); + default: + throw ArgumentError.value(value); + } +} + +bool _isType(Type t) => T == t; +bool _isTypeOrNullableType(Type t) => _isType(t) || _isType(t); + +void _throwNoInstanceError(String channelName) { + String nameString = 'named $channelName'; + if (channelName == defaultInstanceName) { + nameString = 'with no name'; + } + final String error = 'No instance $nameString has been registered.'; + throw ArgumentError(error); +} + +void _throwIfFfiError(ffi_bridge.NativeInteropTestsError error) { + if (error.code != null) { + throw _wrapFfiError(error); + } +} + +PlatformException _wrapFfiError(ffi_bridge.NativeInteropTestsError error) => PlatformException( + code: error.code!.toDartString(), + message: error.message?.toDartString(), + details: NSString.isA(error.details) ? error.details!.toDartString() : error.details, +); + +void _reportFfiError(ffi_bridge.NativeInteropTestsError errorOut, Object e) { + if (e is PlatformException) { + errorOut.code = NSString(e.code); + errorOut.message = NSString(e.message ?? ''); + errorOut.details = NSString((e.details ?? '').toString()); + } else { + errorOut.code = NSString('error'); + errorOut.message = NSString(e.toString()); + errorOut.details = null; + } +} + +PlatformException _wrapJniException(JThrowable e) { + if (e.isA(jni_bridge.NativeInteropTestsError.type)) { + final jni_bridge.NativeInteropTestsError pigeonError = e.as( + jni_bridge.NativeInteropTestsError.type, + ); + return PlatformException( + code: pigeonError.code.toDartString(), + message: pigeonError.message?.toDartString(), + details: pigeonError.details?.isA(JString.type) ?? false + ? pigeonError.details!.as(JString.type).toDartString() + : pigeonError.details, + stacktrace: e.javaStackTrace, + ); + } + return PlatformException( + code: 'PlatformException', + message: e.message, + details: e, + stacktrace: e.javaStackTrace, + ); +} + +extension _PigeonInternalNativeInteropAnEnumNativeInterop on NativeInteropAnEnum { + jni_bridge.NativeInteropAnEnum toJni() { + return jni_bridge.NativeInteropAnEnum.Companion.ofRaw(index)!; + } + + static NativeInteropAnEnum? fromJni(jni_bridge.NativeInteropAnEnum? jniEnum) { + return jniEnum == null ? null : NativeInteropAnEnum.values[jniEnum.raw]; + } + + NSNumber toNSNumber() { + return NSNumber.alloc().initWithLong(index); + } + + static NativeInteropAnEnum? fromNSNumber(NSNumber? ffiEnum) { + return ffiEnum == null ? null : NativeInteropAnEnum.values[ffiEnum.intValue]; + } +} + +extension _PigeonInternalNativeInteropAnotherEnumNativeInterop on NativeInteropAnotherEnum { + jni_bridge.NativeInteropAnotherEnum toJni() { + return jni_bridge.NativeInteropAnotherEnum.Companion.ofRaw(index)!; + } + + static NativeInteropAnotherEnum? fromJni(jni_bridge.NativeInteropAnotherEnum? jniEnum) { + return jniEnum == null ? null : NativeInteropAnotherEnum.values[jniEnum.raw]; + } + + NSNumber toNSNumber() { + return NSNumber.alloc().initWithLong(index); + } + + static NativeInteropAnotherEnum? fromNSNumber(NSNumber? ffiEnum) { + return ffiEnum == null ? null : NativeInteropAnotherEnum.values[ffiEnum.intValue]; + } +} + +extension _PigeonInternalNativeInteropUnusedClassNativeInterop on NativeInteropUnusedClass { + jni_bridge.NativeInteropUnusedClass toJni() { + return jni_bridge.NativeInteropUnusedClass(_PigeonJniCodec.writeValue(aField)); + } + + static NativeInteropUnusedClass? fromJni(jni_bridge.NativeInteropUnusedClass? jniClass) { + return jniClass == null + ? null + : NativeInteropUnusedClass(aField: _PigeonJniCodec.readValue(jniClass.aField)); + } + + ffi_bridge.NativeInteropUnusedClassBridge toFfi() { + return ffi_bridge.NativeInteropUnusedClassBridge.alloc().initWithAField( + _PigeonFfiCodec.writeValue(aField, generic: true), + ); + } + + static NativeInteropUnusedClass? fromFfi(ffi_bridge.NativeInteropUnusedClassBridge? ffiClass) { + return ffiClass == null + ? null + : NativeInteropUnusedClass(aField: _PigeonFfiCodec.readValue(ffiClass.aField)); + } +} + +extension _PigeonInternalNativeInteropAllTypesNativeInterop on NativeInteropAllTypes { + jni_bridge.NativeInteropAllTypes toJni() { + return jni_bridge.NativeInteropAllTypes( + aBool, + anInt, + anInt64, + aDouble, + _PigeonJniCodec.writeValue(aByteArray), + _PigeonJniCodec.writeValue(a4ByteArray), + _PigeonJniCodec.writeValue(a8ByteArray), + _PigeonJniCodec.writeValue(aFloatArray), + anEnum.toJni(), + anotherEnum.toJni(), + _PigeonJniCodec.writeValue(aString), + _PigeonJniCodec.writeValue(anObject), + _PigeonJniCodec.writeValue>(list), + _PigeonJniCodec.writeValue>(stringList), + _PigeonJniCodec.writeValue>(intList), + _PigeonJniCodec.writeValue>(doubleList), + _PigeonJniCodec.writeValue>(boolList), + _PigeonJniCodec.writeValue>(enumList), + _PigeonJniCodec.writeValue>(objectList), + _PigeonJniCodec.writeValue>>(listList), + _PigeonJniCodec.writeValue>>(mapList), + _PigeonJniCodec.writeValue>(map), + _PigeonJniCodec.writeValue>(stringMap), + _PigeonJniCodec.writeValue>(intMap), + _PigeonJniCodec.writeValue< + JMap + >(enumMap), + _PigeonJniCodec.writeValue>(objectMap), + _PigeonJniCodec.writeValue>>(listMap), + _PigeonJniCodec.writeValue>>(mapMap), + ); + } + + static NativeInteropAllTypes? fromJni(jni_bridge.NativeInteropAllTypes? jniClass) { + return jniClass == null + ? null + : NativeInteropAllTypes( + aBool: jniClass.aBool, + anInt: jniClass.anInt, + anInt64: jniClass.anInt64, + aDouble: jniClass.aDouble, + aByteArray: _PigeonJniCodec.readValue(jniClass.aByteArray)! as Uint8List, + a4ByteArray: _PigeonJniCodec.readValue(jniClass.a4ByteArray)! as Int32List, + a8ByteArray: _PigeonJniCodec.readValue(jniClass.a8ByteArray)! as Int64List, + aFloatArray: _PigeonJniCodec.readValue(jniClass.aFloatArray)! as Float64List, + anEnum: _PigeonInternalNativeInteropAnEnumNativeInterop.fromJni(jniClass.anEnum)!, + anotherEnum: _PigeonInternalNativeInteropAnotherEnumNativeInterop.fromJni( + jniClass.anotherEnum, + )!, + aString: jniClass.aString.toDartString(releaseOriginal: true), + anObject: _PigeonJniCodec.readValue(jniClass.anObject)!, + list: (_PigeonJniCodec.readValue(jniClass.list)! as List).cast(), + stringList: (_PigeonJniCodec.readValue(jniClass.stringList)! as List) + .cast(), + intList: (_PigeonJniCodec.readValue(jniClass.intList)! as List).cast(), + doubleList: (_PigeonJniCodec.readValue(jniClass.doubleList)! as List) + .cast(), + boolList: (_PigeonJniCodec.readValue(jniClass.boolList)! as List).cast(), + enumList: (_PigeonJniCodec.readValue(jniClass.enumList)! as List) + .cast(), + objectList: (_PigeonJniCodec.readValue(jniClass.objectList)! as List) + .cast(), + listList: (_PigeonJniCodec.readValue(jniClass.listList)! as List) + .cast>(), + mapList: (_PigeonJniCodec.readValue(jniClass.mapList)! as List) + .cast>(), + map: (_PigeonJniCodec.readValue(jniClass.map)! as Map) + .cast(), + stringMap: (_PigeonJniCodec.readValue(jniClass.stringMap)! as Map) + .cast(), + intMap: (_PigeonJniCodec.readValue(jniClass.intMap)! as Map) + .cast(), + enumMap: (_PigeonJniCodec.readValue(jniClass.enumMap)! as Map) + .cast(), + objectMap: (_PigeonJniCodec.readValue(jniClass.objectMap)! as Map) + .cast(), + listMap: (_PigeonJniCodec.readValue(jniClass.listMap)! as Map) + .cast>(), + mapMap: (_PigeonJniCodec.readValue(jniClass.mapMap)! as Map) + .cast>(), + ); + } + + ffi_bridge.NativeInteropAllTypesBridge toFfi() { + return ffi_bridge.NativeInteropAllTypesBridge.alloc().initWithABool( + aBool, + anInt: anInt, + anInt64: anInt64, + aDouble: aDouble, + aByteArray: _PigeonFfiCodec.writeValue( + aByteArray, + ), + a4ByteArray: _PigeonFfiCodec.writeValue( + a4ByteArray, + ), + a8ByteArray: _PigeonFfiCodec.writeValue( + a8ByteArray, + ), + aFloatArray: _PigeonFfiCodec.writeValue( + aFloatArray, + ), + anEnum: ffi_bridge.NativeInteropAnEnum.values[anEnum.index], + anotherEnum: ffi_bridge.NativeInteropAnotherEnum.values[anotherEnum.index], + aString: _PigeonFfiCodec.writeValue(aString), + anObject: _PigeonFfiCodec.writeValue(anObject, generic: true), + list: _PigeonFfiCodec.writeValue(list), + stringList: _PigeonFfiCodec.writeValue(stringList), + intList: _PigeonFfiCodec.writeValue(intList), + doubleList: _PigeonFfiCodec.writeValue(doubleList), + boolList: _PigeonFfiCodec.writeValue(boolList), + enumList: _PigeonFfiCodec.writeValue(enumList), + objectList: _PigeonFfiCodec.writeValue(objectList), + listList: _PigeonFfiCodec.writeValue(listList), + mapList: _PigeonFfiCodec.writeValue(mapList), + map: _PigeonFfiCodec.writeValue(map), + stringMap: _PigeonFfiCodec.writeValue(stringMap), + intMap: _PigeonFfiCodec.writeValue(intMap), + enumMap: _PigeonFfiCodec.writeValue(enumMap), + objectMap: _PigeonFfiCodec.writeValue(objectMap), + listMap: _PigeonFfiCodec.writeValue(listMap), + mapMap: _PigeonFfiCodec.writeValue(mapMap), + ); + } + + static NativeInteropAllTypes? fromFfi(ffi_bridge.NativeInteropAllTypesBridge? ffiClass) { + return ffiClass == null + ? null + : NativeInteropAllTypes( + aBool: ffiClass.aBool, + anInt: ffiClass.anInt, + anInt64: ffiClass.anInt64, + aDouble: ffiClass.aDouble, + aByteArray: _PigeonFfiCodec.readValue(ffiClass.aByteArray)! as Uint8List, + a4ByteArray: _PigeonFfiCodec.readValue(ffiClass.a4ByteArray)! as Int32List, + a8ByteArray: _PigeonFfiCodec.readValue(ffiClass.a8ByteArray)! as Int64List, + aFloatArray: _PigeonFfiCodec.readValue(ffiClass.aFloatArray)! as Float64List, + anEnum: NativeInteropAnEnum.values[ffiClass.anEnum.index], + anotherEnum: NativeInteropAnotherEnum.values[ffiClass.anotherEnum.index], + aString: ffiClass.aString.toDartString(), + anObject: _PigeonFfiCodec.readValue(ffiClass.anObject)!, + list: (_PigeonFfiCodec.readValue(ffiClass.list)! as List).cast(), + stringList: (_PigeonFfiCodec.readValue(ffiClass.stringList)! as List) + .cast(), + intList: (_PigeonFfiCodec.readValue(ffiClass.intList, int)! as List) + .cast(), + doubleList: (_PigeonFfiCodec.readValue(ffiClass.doubleList, double)! as List) + .cast(), + boolList: (_PigeonFfiCodec.readValue(ffiClass.boolList, bool)! as List) + .cast(), + enumList: + (_PigeonFfiCodec.readValue(ffiClass.enumList, NativeInteropAnEnum)! + as List) + .cast(), + objectList: (_PigeonFfiCodec.readValue(ffiClass.objectList)! as List) + .cast(), + listList: (_PigeonFfiCodec.readValue(ffiClass.listList)! as List) + .cast>(), + mapList: (_PigeonFfiCodec.readValue(ffiClass.mapList)! as List) + .cast>(), + map: (_PigeonFfiCodec.readValue(ffiClass.map)! as Map) + .cast(), + stringMap: (_PigeonFfiCodec.readValue(ffiClass.stringMap)! as Map) + .cast(), + intMap: (_PigeonFfiCodec.readValue(ffiClass.intMap, int, int)! as Map) + .cast(), + enumMap: + (_PigeonFfiCodec.readValue( + ffiClass.enumMap, + NativeInteropAnEnum, + NativeInteropAnEnum, + )! + as Map) + .cast(), + objectMap: (_PigeonFfiCodec.readValue(ffiClass.objectMap)! as Map) + .cast(), + listMap: (_PigeonFfiCodec.readValue(ffiClass.listMap, int)! as Map) + .cast>(), + mapMap: (_PigeonFfiCodec.readValue(ffiClass.mapMap, int)! as Map) + .cast>(), + ); + } +} + +extension _PigeonInternalNativeInteropAllNullableTypesNativeInterop + on NativeInteropAllNullableTypes { + jni_bridge.NativeInteropAllNullableTypes toJni() { + return jni_bridge.NativeInteropAllNullableTypes( + _PigeonJniCodec.writeValue(aNullableBool), + _PigeonJniCodec.writeValue(aNullableInt), + _PigeonJniCodec.writeValue(aNullableInt64), + _PigeonJniCodec.writeValue(aNullableDouble), + _PigeonJniCodec.writeValue(aNullableByteArray), + _PigeonJniCodec.writeValue(aNullable4ByteArray), + _PigeonJniCodec.writeValue(aNullable8ByteArray), + _PigeonJniCodec.writeValue(aNullableFloatArray), + aNullableEnum?.toJni(), + anotherNullableEnum?.toJni(), + _PigeonJniCodec.writeValue(aNullableString), + _PigeonJniCodec.writeValue(aNullableObject), + allNullableTypes?.toJni(), + _PigeonJniCodec.writeValue?>(list), + _PigeonJniCodec.writeValue?>(stringList), + _PigeonJniCodec.writeValue?>(intList), + _PigeonJniCodec.writeValue?>(doubleList), + _PigeonJniCodec.writeValue?>(boolList), + _PigeonJniCodec.writeValue?>(enumList), + _PigeonJniCodec.writeValue?>(objectList), + _PigeonJniCodec.writeValue?>?>(listList), + _PigeonJniCodec.writeValue?>?>(mapList), + _PigeonJniCodec.writeValue?>( + recursiveClassList, + ), + _PigeonJniCodec.writeValue?>(map), + _PigeonJniCodec.writeValue?>(stringMap), + _PigeonJniCodec.writeValue?>(intMap), + _PigeonJniCodec.writeValue< + JMap? + >(enumMap), + _PigeonJniCodec.writeValue?>(objectMap), + _PigeonJniCodec.writeValue?>?>(listMap), + _PigeonJniCodec.writeValue?>?>(mapMap), + _PigeonJniCodec.writeValue?>( + recursiveClassMap, + ), + ); + } + + static NativeInteropAllNullableTypes? fromJni( + jni_bridge.NativeInteropAllNullableTypes? jniClass, + ) { + return jniClass == null + ? null + : NativeInteropAllNullableTypes( + aNullableBool: jniClass.aNullableBool?.toDartBool(releaseOriginal: true), + aNullableInt: jniClass.aNullableInt?.toDartInt(releaseOriginal: true), + aNullableInt64: jniClass.aNullableInt64?.toDartInt(releaseOriginal: true), + aNullableDouble: jniClass.aNullableDouble?.toDartDouble(releaseOriginal: true), + aNullableByteArray: + _PigeonJniCodec.readValue(jniClass.aNullableByteArray) as Uint8List?, + aNullable4ByteArray: + _PigeonJniCodec.readValue(jniClass.aNullable4ByteArray) as Int32List?, + aNullable8ByteArray: + _PigeonJniCodec.readValue(jniClass.aNullable8ByteArray) as Int64List?, + aNullableFloatArray: + _PigeonJniCodec.readValue(jniClass.aNullableFloatArray) as Float64List?, + aNullableEnum: _PigeonInternalNativeInteropAnEnumNativeInterop.fromJni( + jniClass.aNullableEnum, + ), + anotherNullableEnum: _PigeonInternalNativeInteropAnotherEnumNativeInterop.fromJni( + jniClass.anotherNullableEnum, + ), + aNullableString: jniClass.aNullableString?.toDartString(releaseOriginal: true), + aNullableObject: _PigeonJniCodec.readValue(jniClass.aNullableObject), + allNullableTypes: _PigeonInternalNativeInteropAllNullableTypesNativeInterop.fromJni( + jniClass.allNullableTypes, + ), + list: (_PigeonJniCodec.readValue(jniClass.list) as List?)?.cast(), + stringList: (_PigeonJniCodec.readValue(jniClass.stringList) as List?) + ?.cast(), + intList: (_PigeonJniCodec.readValue(jniClass.intList) as List?)?.cast(), + doubleList: (_PigeonJniCodec.readValue(jniClass.doubleList) as List?) + ?.cast(), + boolList: (_PigeonJniCodec.readValue(jniClass.boolList) as List?) + ?.cast(), + enumList: (_PigeonJniCodec.readValue(jniClass.enumList) as List?) + ?.cast(), + objectList: (_PigeonJniCodec.readValue(jniClass.objectList) as List?) + ?.cast(), + listList: (_PigeonJniCodec.readValue(jniClass.listList) as List?) + ?.cast?>(), + mapList: (_PigeonJniCodec.readValue(jniClass.mapList) as List?) + ?.cast?>(), + recursiveClassList: + (_PigeonJniCodec.readValue(jniClass.recursiveClassList) as List?) + ?.cast(), + map: (_PigeonJniCodec.readValue(jniClass.map) as Map?) + ?.cast(), + stringMap: (_PigeonJniCodec.readValue(jniClass.stringMap) as Map?) + ?.cast(), + intMap: (_PigeonJniCodec.readValue(jniClass.intMap) as Map?) + ?.cast(), + enumMap: (_PigeonJniCodec.readValue(jniClass.enumMap) as Map?) + ?.cast(), + objectMap: (_PigeonJniCodec.readValue(jniClass.objectMap) as Map?) + ?.cast(), + listMap: (_PigeonJniCodec.readValue(jniClass.listMap) as Map?) + ?.cast?>(), + mapMap: (_PigeonJniCodec.readValue(jniClass.mapMap) as Map?) + ?.cast?>(), + recursiveClassMap: + (_PigeonJniCodec.readValue(jniClass.recursiveClassMap) as Map?) + ?.cast(), + ); + } + + ffi_bridge.NativeInteropAllNullableTypesBridge toFfi() { + return ffi_bridge.NativeInteropAllNullableTypesBridge.alloc().initWithANullableBool( + _PigeonFfiCodec.writeValue(aNullableBool), + aNullableInt: _PigeonFfiCodec.writeValue(aNullableInt), + aNullableInt64: _PigeonFfiCodec.writeValue(aNullableInt64), + aNullableDouble: _PigeonFfiCodec.writeValue(aNullableDouble), + aNullableByteArray: _PigeonFfiCodec.writeValue( + aNullableByteArray, + ), + aNullable4ByteArray: + _PigeonFfiCodec.writeValue( + aNullable4ByteArray, + ), + aNullable8ByteArray: + _PigeonFfiCodec.writeValue( + aNullable8ByteArray, + ), + aNullableFloatArray: + _PigeonFfiCodec.writeValue( + aNullableFloatArray, + ), + aNullableEnum: _PigeonFfiCodec.writeValue(aNullableEnum?.index), + anotherNullableEnum: _PigeonFfiCodec.writeValue(anotherNullableEnum?.index), + aNullableString: _PigeonFfiCodec.writeValue(aNullableString), + aNullableObject: _PigeonFfiCodec.writeValue(aNullableObject, generic: true), + allNullableTypes: allNullableTypes?.toFfi(), + list: _PigeonFfiCodec.writeValue(list), + stringList: _PigeonFfiCodec.writeValue(stringList), + intList: _PigeonFfiCodec.writeValue(intList), + doubleList: _PigeonFfiCodec.writeValue(doubleList), + boolList: _PigeonFfiCodec.writeValue(boolList), + enumList: _PigeonFfiCodec.writeValue(enumList), + objectList: _PigeonFfiCodec.writeValue(objectList), + listList: _PigeonFfiCodec.writeValue(listList), + mapList: _PigeonFfiCodec.writeValue(mapList), + recursiveClassList: _PigeonFfiCodec.writeValue(recursiveClassList), + map: _PigeonFfiCodec.writeValue(map), + stringMap: _PigeonFfiCodec.writeValue(stringMap), + intMap: _PigeonFfiCodec.writeValue(intMap), + enumMap: _PigeonFfiCodec.writeValue(enumMap), + objectMap: _PigeonFfiCodec.writeValue(objectMap), + listMap: _PigeonFfiCodec.writeValue(listMap), + mapMap: _PigeonFfiCodec.writeValue(mapMap), + recursiveClassMap: _PigeonFfiCodec.writeValue(recursiveClassMap), + ); + } + + static NativeInteropAllNullableTypes? fromFfi( + ffi_bridge.NativeInteropAllNullableTypesBridge? ffiClass, + ) { + return ffiClass == null + ? null + : NativeInteropAllNullableTypes( + aNullableBool: ffiClass.aNullableBool?.boolValue, + aNullableInt: ffiClass.aNullableInt?.longValue, + aNullableInt64: ffiClass.aNullableInt64?.longValue, + aNullableDouble: ffiClass.aNullableDouble?.doubleValue, + aNullableByteArray: + _PigeonFfiCodec.readValue(ffiClass.aNullableByteArray) as Uint8List?, + aNullable4ByteArray: + _PigeonFfiCodec.readValue(ffiClass.aNullable4ByteArray) as Int32List?, + aNullable8ByteArray: + _PigeonFfiCodec.readValue(ffiClass.aNullable8ByteArray) as Int64List?, + aNullableFloatArray: + _PigeonFfiCodec.readValue(ffiClass.aNullableFloatArray) as Float64List?, + aNullableEnum: ffiClass.aNullableEnum == null + ? null + : NativeInteropAnEnum.values[ffiClass.aNullableEnum!.longValue], + anotherNullableEnum: ffiClass.anotherNullableEnum == null + ? null + : NativeInteropAnotherEnum.values[ffiClass.anotherNullableEnum!.longValue], + aNullableString: ffiClass.aNullableString?.toDartString(), + aNullableObject: _PigeonFfiCodec.readValue(ffiClass.aNullableObject), + allNullableTypes: _PigeonInternalNativeInteropAllNullableTypesNativeInterop.fromFfi( + ffiClass.allNullableTypes, + ), + list: (_PigeonFfiCodec.readValue(ffiClass.list) as List?)?.cast(), + stringList: (_PigeonFfiCodec.readValue(ffiClass.stringList) as List?) + ?.cast(), + intList: (_PigeonFfiCodec.readValue(ffiClass.intList, int) as List?) + ?.cast(), + doubleList: (_PigeonFfiCodec.readValue(ffiClass.doubleList, double) as List?) + ?.cast(), + boolList: (_PigeonFfiCodec.readValue(ffiClass.boolList, bool) as List?) + ?.cast(), + enumList: + (_PigeonFfiCodec.readValue(ffiClass.enumList, NativeInteropAnEnum) + as List?) + ?.cast(), + objectList: (_PigeonFfiCodec.readValue(ffiClass.objectList) as List?) + ?.cast(), + listList: (_PigeonFfiCodec.readValue(ffiClass.listList) as List?) + ?.cast?>(), + mapList: (_PigeonFfiCodec.readValue(ffiClass.mapList) as List?) + ?.cast?>(), + recursiveClassList: + (_PigeonFfiCodec.readValue(ffiClass.recursiveClassList) as List?) + ?.cast(), + map: (_PigeonFfiCodec.readValue(ffiClass.map) as Map?) + ?.cast(), + stringMap: (_PigeonFfiCodec.readValue(ffiClass.stringMap) as Map?) + ?.cast(), + intMap: (_PigeonFfiCodec.readValue(ffiClass.intMap, int, int) as Map?) + ?.cast(), + enumMap: + (_PigeonFfiCodec.readValue( + ffiClass.enumMap, + NativeInteropAnEnum, + NativeInteropAnEnum, + ) + as Map?) + ?.cast(), + objectMap: (_PigeonFfiCodec.readValue(ffiClass.objectMap) as Map?) + ?.cast(), + listMap: (_PigeonFfiCodec.readValue(ffiClass.listMap, int) as Map?) + ?.cast?>(), + mapMap: (_PigeonFfiCodec.readValue(ffiClass.mapMap, int) as Map?) + ?.cast?>(), + recursiveClassMap: + (_PigeonFfiCodec.readValue(ffiClass.recursiveClassMap, int) + as Map?) + ?.cast(), + ); + } +} + +extension _PigeonInternalNativeInteropAllNullableTypesWithoutRecursionNativeInterop + on NativeInteropAllNullableTypesWithoutRecursion { + jni_bridge.NativeInteropAllNullableTypesWithoutRecursion toJni() { + return jni_bridge.NativeInteropAllNullableTypesWithoutRecursion( + _PigeonJniCodec.writeValue(aNullableBool), + _PigeonJniCodec.writeValue(aNullableInt), + _PigeonJniCodec.writeValue(aNullableInt64), + _PigeonJniCodec.writeValue(aNullableDouble), + _PigeonJniCodec.writeValue(aNullableByteArray), + _PigeonJniCodec.writeValue(aNullable4ByteArray), + _PigeonJniCodec.writeValue(aNullable8ByteArray), + _PigeonJniCodec.writeValue(aNullableFloatArray), + aNullableEnum?.toJni(), + anotherNullableEnum?.toJni(), + _PigeonJniCodec.writeValue(aNullableString), + _PigeonJniCodec.writeValue(aNullableObject), + _PigeonJniCodec.writeValue(type), + _PigeonJniCodec.writeValue?>(list), + _PigeonJniCodec.writeValue?>(stringList), + _PigeonJniCodec.writeValue?>(intList), + _PigeonJniCodec.writeValue?>(doubleList), + _PigeonJniCodec.writeValue?>(boolList), + _PigeonJniCodec.writeValue?>(enumList), + _PigeonJniCodec.writeValue?>(objectList), + _PigeonJniCodec.writeValue?>?>(listList), + _PigeonJniCodec.writeValue?>?>(mapList), + _PigeonJniCodec.writeValue?>(map), + _PigeonJniCodec.writeValue?>(stringMap), + _PigeonJniCodec.writeValue?>(intMap), + _PigeonJniCodec.writeValue< + JMap? + >(enumMap), + _PigeonJniCodec.writeValue?>(objectMap), + _PigeonJniCodec.writeValue?>?>(listMap), + _PigeonJniCodec.writeValue?>?>(mapMap), + ); + } + + static NativeInteropAllNullableTypesWithoutRecursion? fromJni( + jni_bridge.NativeInteropAllNullableTypesWithoutRecursion? jniClass, + ) { + return jniClass == null + ? null + : NativeInteropAllNullableTypesWithoutRecursion( + aNullableBool: jniClass.aNullableBool?.toDartBool(releaseOriginal: true), + aNullableInt: jniClass.aNullableInt?.toDartInt(releaseOriginal: true), + aNullableInt64: jniClass.aNullableInt64?.toDartInt(releaseOriginal: true), + aNullableDouble: jniClass.aNullableDouble?.toDartDouble(releaseOriginal: true), + aNullableByteArray: + _PigeonJniCodec.readValue(jniClass.aNullableByteArray) as Uint8List?, + aNullable4ByteArray: + _PigeonJniCodec.readValue(jniClass.aNullable4ByteArray) as Int32List?, + aNullable8ByteArray: + _PigeonJniCodec.readValue(jniClass.aNullable8ByteArray) as Int64List?, + aNullableFloatArray: + _PigeonJniCodec.readValue(jniClass.aNullableFloatArray) as Float64List?, + aNullableEnum: _PigeonInternalNativeInteropAnEnumNativeInterop.fromJni( + jniClass.aNullableEnum, + ), + anotherNullableEnum: _PigeonInternalNativeInteropAnotherEnumNativeInterop.fromJni( + jniClass.anotherNullableEnum, + ), + aNullableString: jniClass.aNullableString?.toDartString(releaseOriginal: true), + aNullableObject: _PigeonJniCodec.readValue(jniClass.aNullableObject), + type: jniClass.type$1?.toDartInt(releaseOriginal: true), + list: (_PigeonJniCodec.readValue(jniClass.list) as List?)?.cast(), + stringList: (_PigeonJniCodec.readValue(jniClass.stringList) as List?) + ?.cast(), + intList: (_PigeonJniCodec.readValue(jniClass.intList) as List?)?.cast(), + doubleList: (_PigeonJniCodec.readValue(jniClass.doubleList) as List?) + ?.cast(), + boolList: (_PigeonJniCodec.readValue(jniClass.boolList) as List?) + ?.cast(), + enumList: (_PigeonJniCodec.readValue(jniClass.enumList) as List?) + ?.cast(), + objectList: (_PigeonJniCodec.readValue(jniClass.objectList) as List?) + ?.cast(), + listList: (_PigeonJniCodec.readValue(jniClass.listList) as List?) + ?.cast?>(), + mapList: (_PigeonJniCodec.readValue(jniClass.mapList) as List?) + ?.cast?>(), + map: (_PigeonJniCodec.readValue(jniClass.map) as Map?) + ?.cast(), + stringMap: (_PigeonJniCodec.readValue(jniClass.stringMap) as Map?) + ?.cast(), + intMap: (_PigeonJniCodec.readValue(jniClass.intMap) as Map?) + ?.cast(), + enumMap: (_PigeonJniCodec.readValue(jniClass.enumMap) as Map?) + ?.cast(), + objectMap: (_PigeonJniCodec.readValue(jniClass.objectMap) as Map?) + ?.cast(), + listMap: (_PigeonJniCodec.readValue(jniClass.listMap) as Map?) + ?.cast?>(), + mapMap: (_PigeonJniCodec.readValue(jniClass.mapMap) as Map?) + ?.cast?>(), + ); + } + + ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge toFfi() { + return ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge.alloc() + .initWithANullableBool( + _PigeonFfiCodec.writeValue(aNullableBool), + aNullableInt: _PigeonFfiCodec.writeValue(aNullableInt), + aNullableInt64: _PigeonFfiCodec.writeValue(aNullableInt64), + aNullableDouble: _PigeonFfiCodec.writeValue(aNullableDouble), + aNullableByteArray: + _PigeonFfiCodec.writeValue( + aNullableByteArray, + ), + aNullable4ByteArray: + _PigeonFfiCodec.writeValue( + aNullable4ByteArray, + ), + aNullable8ByteArray: + _PigeonFfiCodec.writeValue( + aNullable8ByteArray, + ), + aNullableFloatArray: + _PigeonFfiCodec.writeValue( + aNullableFloatArray, + ), + aNullableEnum: _PigeonFfiCodec.writeValue(aNullableEnum?.index), + anotherNullableEnum: _PigeonFfiCodec.writeValue(anotherNullableEnum?.index), + aNullableString: _PigeonFfiCodec.writeValue(aNullableString), + aNullableObject: _PigeonFfiCodec.writeValue(aNullableObject, generic: true), + type: _PigeonFfiCodec.writeValue(type), + list: _PigeonFfiCodec.writeValue(list), + stringList: _PigeonFfiCodec.writeValue(stringList), + intList: _PigeonFfiCodec.writeValue(intList), + doubleList: _PigeonFfiCodec.writeValue(doubleList), + boolList: _PigeonFfiCodec.writeValue(boolList), + enumList: _PigeonFfiCodec.writeValue(enumList), + objectList: _PigeonFfiCodec.writeValue(objectList), + listList: _PigeonFfiCodec.writeValue(listList), + mapList: _PigeonFfiCodec.writeValue(mapList), + map: _PigeonFfiCodec.writeValue(map), + stringMap: _PigeonFfiCodec.writeValue(stringMap), + intMap: _PigeonFfiCodec.writeValue(intMap), + enumMap: _PigeonFfiCodec.writeValue(enumMap), + objectMap: _PigeonFfiCodec.writeValue(objectMap), + listMap: _PigeonFfiCodec.writeValue(listMap), + mapMap: _PigeonFfiCodec.writeValue(mapMap), + ); + } + + static NativeInteropAllNullableTypesWithoutRecursion? fromFfi( + ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge? ffiClass, + ) { + return ffiClass == null + ? null + : NativeInteropAllNullableTypesWithoutRecursion( + aNullableBool: ffiClass.aNullableBool?.boolValue, + aNullableInt: ffiClass.aNullableInt?.longValue, + aNullableInt64: ffiClass.aNullableInt64?.longValue, + aNullableDouble: ffiClass.aNullableDouble?.doubleValue, + aNullableByteArray: + _PigeonFfiCodec.readValue(ffiClass.aNullableByteArray) as Uint8List?, + aNullable4ByteArray: + _PigeonFfiCodec.readValue(ffiClass.aNullable4ByteArray) as Int32List?, + aNullable8ByteArray: + _PigeonFfiCodec.readValue(ffiClass.aNullable8ByteArray) as Int64List?, + aNullableFloatArray: + _PigeonFfiCodec.readValue(ffiClass.aNullableFloatArray) as Float64List?, + aNullableEnum: ffiClass.aNullableEnum == null + ? null + : NativeInteropAnEnum.values[ffiClass.aNullableEnum!.longValue], + anotherNullableEnum: ffiClass.anotherNullableEnum == null + ? null + : NativeInteropAnotherEnum.values[ffiClass.anotherNullableEnum!.longValue], + aNullableString: ffiClass.aNullableString?.toDartString(), + aNullableObject: _PigeonFfiCodec.readValue(ffiClass.aNullableObject), + type: ffiClass.type?.longValue, + list: (_PigeonFfiCodec.readValue(ffiClass.list) as List?)?.cast(), + stringList: (_PigeonFfiCodec.readValue(ffiClass.stringList) as List?) + ?.cast(), + intList: (_PigeonFfiCodec.readValue(ffiClass.intList, int) as List?) + ?.cast(), + doubleList: (_PigeonFfiCodec.readValue(ffiClass.doubleList, double) as List?) + ?.cast(), + boolList: (_PigeonFfiCodec.readValue(ffiClass.boolList, bool) as List?) + ?.cast(), + enumList: + (_PigeonFfiCodec.readValue(ffiClass.enumList, NativeInteropAnEnum) + as List?) + ?.cast(), + objectList: (_PigeonFfiCodec.readValue(ffiClass.objectList) as List?) + ?.cast(), + listList: (_PigeonFfiCodec.readValue(ffiClass.listList) as List?) + ?.cast?>(), + mapList: (_PigeonFfiCodec.readValue(ffiClass.mapList) as List?) + ?.cast?>(), + map: (_PigeonFfiCodec.readValue(ffiClass.map) as Map?) + ?.cast(), + stringMap: (_PigeonFfiCodec.readValue(ffiClass.stringMap) as Map?) + ?.cast(), + intMap: (_PigeonFfiCodec.readValue(ffiClass.intMap, int, int) as Map?) + ?.cast(), + enumMap: + (_PigeonFfiCodec.readValue( + ffiClass.enumMap, + NativeInteropAnEnum, + NativeInteropAnEnum, + ) + as Map?) + ?.cast(), + objectMap: (_PigeonFfiCodec.readValue(ffiClass.objectMap) as Map?) + ?.cast(), + listMap: (_PigeonFfiCodec.readValue(ffiClass.listMap, int) as Map?) + ?.cast?>(), + mapMap: (_PigeonFfiCodec.readValue(ffiClass.mapMap, int) as Map?) + ?.cast?>(), + ); + } +} + +extension _PigeonInternalNativeInteropAllClassesWrapperNativeInterop + on NativeInteropAllClassesWrapper { + jni_bridge.NativeInteropAllClassesWrapper toJni() { + return jni_bridge.NativeInteropAllClassesWrapper( + allNullableTypes.toJni(), + allNullableTypesWithoutRecursion?.toJni(), + allTypes?.toJni(), + _PigeonJniCodec.writeValue>(classList), + _PigeonJniCodec.writeValue?>( + nullableClassList, + ), + _PigeonJniCodec.writeValue>(classMap), + _PigeonJniCodec.writeValue< + JMap? + >(nullableClassMap), + ); + } + + static NativeInteropAllClassesWrapper? fromJni( + jni_bridge.NativeInteropAllClassesWrapper? jniClass, + ) { + return jniClass == null + ? null + : NativeInteropAllClassesWrapper( + allNullableTypes: _PigeonInternalNativeInteropAllNullableTypesNativeInterop.fromJni( + jniClass.allNullableTypes, + )!, + allNullableTypesWithoutRecursion: + _PigeonInternalNativeInteropAllNullableTypesWithoutRecursionNativeInterop.fromJni( + jniClass.allNullableTypesWithoutRecursion, + ), + allTypes: _PigeonInternalNativeInteropAllTypesNativeInterop.fromJni(jniClass.allTypes), + classList: (_PigeonJniCodec.readValue(jniClass.classList)! as List) + .cast(), + nullableClassList: + (_PigeonJniCodec.readValue(jniClass.nullableClassList) as List?) + ?.cast(), + classMap: (_PigeonJniCodec.readValue(jniClass.classMap)! as Map) + .cast(), + nullableClassMap: + (_PigeonJniCodec.readValue(jniClass.nullableClassMap) as Map?) + ?.cast(), + ); + } + + ffi_bridge.NativeInteropAllClassesWrapperBridge toFfi() { + return ffi_bridge.NativeInteropAllClassesWrapperBridge.alloc().initWithAllNullableTypes( + allNullableTypes.toFfi(), + allNullableTypesWithoutRecursion: allNullableTypesWithoutRecursion?.toFfi(), + allTypes: allTypes?.toFfi(), + classList: _PigeonFfiCodec.writeValue(classList), + nullableClassList: _PigeonFfiCodec.writeValue(nullableClassList), + classMap: _PigeonFfiCodec.writeValue(classMap), + nullableClassMap: _PigeonFfiCodec.writeValue(nullableClassMap), + ); + } + + static NativeInteropAllClassesWrapper? fromFfi( + ffi_bridge.NativeInteropAllClassesWrapperBridge? ffiClass, + ) { + return ffiClass == null + ? null + : NativeInteropAllClassesWrapper( + allNullableTypes: _PigeonInternalNativeInteropAllNullableTypesNativeInterop.fromFfi( + ffiClass.allNullableTypes, + )!, + allNullableTypesWithoutRecursion: + _PigeonInternalNativeInteropAllNullableTypesWithoutRecursionNativeInterop.fromFfi( + ffiClass.allNullableTypesWithoutRecursion, + ), + allTypes: _PigeonInternalNativeInteropAllTypesNativeInterop.fromFfi(ffiClass.allTypes), + classList: (_PigeonFfiCodec.readValue(ffiClass.classList)! as List) + .cast(), + nullableClassList: + (_PigeonFfiCodec.readValue(ffiClass.nullableClassList) as List?) + ?.cast(), + classMap: (_PigeonFfiCodec.readValue(ffiClass.classMap, int)! as Map) + .cast(), + nullableClassMap: + (_PigeonFfiCodec.readValue(ffiClass.nullableClassMap, int) + as Map?) + ?.cast(), + ); + } +} + +extension _PigeonInternalNativeInteropSealedClassNativeInterop on NativeInteropSealedClass { + jni_bridge.NativeInteropSealedClass toJni() { + return switch (this) { + final NativeInteropSealedClassWithFields child => child.toJni(), + final NativeInteropEmptySealedClass child => child.toJni(), + }; + } + + static NativeInteropSealedClass? fromJni(jni_bridge.NativeInteropSealedClass? jniClass) { + if (jniClass == null) { + return null; + } + if (jniClass.isA( + jni_bridge.NativeInteropSealedClassWithFields.type, + )) { + return _PigeonInternalNativeInteropSealedClassWithFieldsNativeInterop.fromJni( + jniClass.as(jni_bridge.NativeInteropSealedClassWithFields.type), + ); + } + if (jniClass.isA( + jni_bridge.NativeInteropEmptySealedClass.type, + )) { + return _PigeonInternalNativeInteropEmptySealedClassNativeInterop.fromJni( + jniClass.as(jni_bridge.NativeInteropEmptySealedClass.type), + ); + } + throw ArgumentError.value(jniClass); + } + + ffi_bridge.NativeInteropSealedClassBridge toFfi() { + return switch (this) { + final NativeInteropSealedClassWithFields child => child.toFfi(), + final NativeInteropEmptySealedClass child => child.toFfi(), + }; + } + + static NativeInteropSealedClass? fromFfi(ffi_bridge.NativeInteropSealedClassBridge? ffiClass) { + if (ffiClass == null) { + return null; + } + if (ffi_bridge.NativeInteropSealedClassWithFieldsBridge.isA(ffiClass)) { + return _PigeonInternalNativeInteropSealedClassWithFieldsNativeInterop.fromFfi( + ffi_bridge.NativeInteropSealedClassWithFieldsBridge.as(ffiClass), + ); + } + if (ffi_bridge.NativeInteropEmptySealedClassBridge.isA(ffiClass)) { + return _PigeonInternalNativeInteropEmptySealedClassNativeInterop.fromFfi( + ffi_bridge.NativeInteropEmptySealedClassBridge.as(ffiClass), + ); + } + throw ArgumentError.value(ffiClass); + } +} + +extension _PigeonInternalNativeInteropSealedClassWithFieldsNativeInterop + on NativeInteropSealedClassWithFields { + jni_bridge.NativeInteropSealedClassWithFields toJni() { + return jni_bridge.NativeInteropSealedClassWithFields( + _PigeonJniCodec.writeValue(aString), + _PigeonJniCodec.writeValue(aNullableInt), + anEnum.toJni(), + aClass?.toJni(), + ); + } + + static NativeInteropSealedClassWithFields? fromJni( + jni_bridge.NativeInteropSealedClassWithFields? jniClass, + ) { + return jniClass == null + ? null + : NativeInteropSealedClassWithFields( + aString: jniClass.aString.toDartString(releaseOriginal: true), + aNullableInt: jniClass.aNullableInt?.toDartInt(releaseOriginal: true), + anEnum: _PigeonInternalNativeInteropAnEnumNativeInterop.fromJni(jniClass.anEnum)!, + aClass: + _PigeonInternalNativeInteropAllNullableTypesWithoutRecursionNativeInterop.fromJni( + jniClass.aClass, + ), + ); + } + + ffi_bridge.NativeInteropSealedClassWithFieldsBridge toFfi() { + return ffi_bridge.NativeInteropSealedClassWithFieldsBridge.alloc().initWithAString( + _PigeonFfiCodec.writeValue(aString), + aNullableInt: _PigeonFfiCodec.writeValue(aNullableInt), + anEnum: ffi_bridge.NativeInteropAnEnum.values[anEnum.index], + aClass: aClass?.toFfi(), + ); + } + + static NativeInteropSealedClassWithFields? fromFfi( + ffi_bridge.NativeInteropSealedClassWithFieldsBridge? ffiClass, + ) { + return ffiClass == null + ? null + : NativeInteropSealedClassWithFields( + aString: ffiClass.aString.toDartString(), + aNullableInt: ffiClass.aNullableInt?.longValue, + anEnum: NativeInteropAnEnum.values[ffiClass.anEnum.index], + aClass: + _PigeonInternalNativeInteropAllNullableTypesWithoutRecursionNativeInterop.fromFfi( + ffiClass.aClass, + ), + ); + } +} + +extension _PigeonInternalNativeInteropEmptySealedClassNativeInterop + on NativeInteropEmptySealedClass { + jni_bridge.NativeInteropEmptySealedClass toJni() { + return jni_bridge.NativeInteropEmptySealedClass(); + } + + static NativeInteropEmptySealedClass? fromJni( + jni_bridge.NativeInteropEmptySealedClass? jniClass, + ) { + return jniClass == null ? null : NativeInteropEmptySealedClass(); + } + + ffi_bridge.NativeInteropEmptySealedClassBridge toFfi() { + return ffi_bridge.NativeInteropEmptySealedClassBridge.alloc().init(); + } + + static NativeInteropEmptySealedClass? fromFfi( + ffi_bridge.NativeInteropEmptySealedClassBridge? ffiClass, + ) { + return ffiClass == null ? null : NativeInteropEmptySealedClass(); + } +} + +extension _PigeonInternalNativeInteropSealedClassWrapperNativeInterop + on NativeInteropSealedClassWrapper { + jni_bridge.NativeInteropSealedClassWrapper toJni() { + return jni_bridge.NativeInteropSealedClassWrapper( + sealedClass.toJni(), + nullableSealedClass?.toJni(), + _PigeonJniCodec.writeValue>(sealedClassList), + ); + } + + static NativeInteropSealedClassWrapper? fromJni( + jni_bridge.NativeInteropSealedClassWrapper? jniClass, + ) { + return jniClass == null + ? null + : NativeInteropSealedClassWrapper( + sealedClass: _PigeonInternalNativeInteropSealedClassNativeInterop.fromJni( + jniClass.sealedClass, + )!, + nullableSealedClass: _PigeonInternalNativeInteropSealedClassNativeInterop.fromJni( + jniClass.nullableSealedClass, + ), + sealedClassList: (_PigeonJniCodec.readValue(jniClass.sealedClassList)! as List) + .cast(), + ); + } + + ffi_bridge.NativeInteropSealedClassWrapperBridge toFfi() { + return ffi_bridge.NativeInteropSealedClassWrapperBridge.alloc().initWithSealedClass( + sealedClass.toFfi(), + nullableSealedClass: nullableSealedClass?.toFfi(), + sealedClassList: _PigeonFfiCodec.writeValue(sealedClassList), + ); + } + + static NativeInteropSealedClassWrapper? fromFfi( + ffi_bridge.NativeInteropSealedClassWrapperBridge? ffiClass, + ) { + return ffiClass == null + ? null + : NativeInteropSealedClassWrapper( + sealedClass: _PigeonInternalNativeInteropSealedClassNativeInterop.fromFfi( + ffiClass.sealedClass, + )!, + nullableSealedClass: _PigeonInternalNativeInteropSealedClassNativeInterop.fromFfi( + ffiClass.nullableSealedClass, + ), + sealedClassList: (_PigeonFfiCodec.readValue(ffiClass.sealedClassList)! as List) + .cast(), + ); + } +} + +extension _PigeonInternalNativeInteropReservedNamesNativeInterop on NativeInteropReservedNames { + jni_bridge.NativeInteropReservedNames toJni() { + return jni_bridge.NativeInteropReservedNames( + _PigeonJniCodec.writeValue(type), + _PigeonJniCodec.writeValue(use), + _PigeonJniCodec.writeValue(reference), + _PigeonJniCodec.writeValue(releasedBy), + _PigeonJniCodec.writeValue(fromReference), + _PigeonJniCodec.writeValue(jClass), + _PigeonJniCodec.writeValue(isInstanceOf), + _PigeonJniCodec.writeValue(isNull), + isReleased, + _PigeonJniCodec.writeValue(equals), + isEnabled, + _PigeonJniCodec.writeValue(isMaybe), + _PigeonJniCodec.writeValue(isCount), + _PigeonJniCodec.writeValue(getValue), + ); + } + + static NativeInteropReservedNames? fromJni(jni_bridge.NativeInteropReservedNames? jniClass) { + return jniClass == null + ? null + : NativeInteropReservedNames( + type: jniClass.type$1?.toDartString(releaseOriginal: true), + use: jniClass.use$1?.toDartString(releaseOriginal: true), + reference: jniClass.reference$1?.toDartString(releaseOriginal: true), + releasedBy: jniClass.releasedBy$1?.toDartString(releaseOriginal: true), + fromReference: jniClass.fromReference$1?.toDartString(releaseOriginal: true), + jClass: jniClass.jClass$1?.toDartString(releaseOriginal: true), + isInstanceOf: jniClass.isInstanceOf$1()?.toDartString(releaseOriginal: true), + isNull: jniClass.isNull$1()?.toDartString(releaseOriginal: true), + isReleased: jniClass.isReleased$1, + equals: jniClass.equals?.toDartString(releaseOriginal: true), + isEnabled: jniClass.isEnabled, + isMaybe: jniClass.isMaybe()?.toDartBool(releaseOriginal: true), + isCount: jniClass.isCount()?.toDartInt(releaseOriginal: true), + getValue: jniClass.getValue?.toDartString(releaseOriginal: true), + ); + } + + ffi_bridge.NativeInteropReservedNamesBridge toFfi() { + return ffi_bridge.NativeInteropReservedNamesBridge.alloc().initWithType( + _PigeonFfiCodec.writeValue(type), + use: _PigeonFfiCodec.writeValue(use), + reference: _PigeonFfiCodec.writeValue(reference), + releasedBy: _PigeonFfiCodec.writeValue(releasedBy), + fromReference: _PigeonFfiCodec.writeValue(fromReference), + jClass: _PigeonFfiCodec.writeValue(jClass), + isInstanceOf: _PigeonFfiCodec.writeValue(isInstanceOf), + isNull: _PigeonFfiCodec.writeValue(isNull), + isReleased: isReleased, + equals: _PigeonFfiCodec.writeValue(equals), + isEnabled: isEnabled, + isMaybe: _PigeonFfiCodec.writeValue(isMaybe), + isCount: _PigeonFfiCodec.writeValue(isCount), + getValue: _PigeonFfiCodec.writeValue(getValue), + ); + } + + static NativeInteropReservedNames? fromFfi( + ffi_bridge.NativeInteropReservedNamesBridge? ffiClass, + ) { + return ffiClass == null + ? null + : NativeInteropReservedNames( + type: ffiClass.type?.toDartString(), + use: ffiClass.use?.toDartString(), + reference: ffiClass.reference?.toDartString(), + releasedBy: ffiClass.releasedBy?.toDartString(), + fromReference: ffiClass.fromReference?.toDartString(), + jClass: ffiClass.jClass?.toDartString(), + isInstanceOf: ffiClass.isInstanceOf?.toDartString(), + isNull: ffiClass.isNull?.toDartString(), + isReleased: ffiClass.isReleased, + equals: ffiClass.equals?.toDartString(), + isEnabled: ffiClass.isEnabled, + isMaybe: ffiClass.isMaybe?.boolValue, + isCount: ffiClass.isCount?.longValue, + getValue: ffiClass.getValue?.toDartString(), + ); + } +} + +NativeInteropHostIntegrationCoreApiForNativeInterop? +pigeon_getInstance_NativeInteropHostIntegrationCoreApi({ + String channelName = defaultInstanceName, +}) => _NativeInteropHostIntegrationCoreApiForNativeInterop.getInstance(channelName: channelName); + +class _NativeInteropHostIntegrationCoreApiForNativeInterop + implements NativeInteropHostIntegrationCoreApiForNativeInterop { + _NativeInteropHostIntegrationCoreApiForNativeInterop._withRegistrar({ + jni_bridge.NativeInteropHostIntegrationCoreApiRegistrar? jniApi, + ffi_bridge.NativeInteropHostIntegrationCoreApiSetup? ffiApi, + }) : _jniApi = jniApi, + _ffiApi = ffiApi; + + /// Returns instance of NativeInteropHostIntegrationCoreApiForNativeInterop with specified [channelName] if one has been registered. + static NativeInteropHostIntegrationCoreApiForNativeInterop? getInstance({ + String channelName = defaultInstanceName, + }) { + final NativeInteropHostIntegrationCoreApiForNativeInterop res; + if (Platform.isAndroid) { + final jni_bridge.NativeInteropHostIntegrationCoreApiRegistrar? link = + jni_bridge.NativeInteropHostIntegrationCoreApiRegistrar().getInstance( + channelName.toJString(), + ); + if (link == null) { + _throwNoInstanceError(channelName); + } + res = _NativeInteropHostIntegrationCoreApiForNativeInterop._withRegistrar(jniApi: link); + } else if (Platform.isIOS || Platform.isMacOS) { + final ffi_bridge.NativeInteropHostIntegrationCoreApiSetup? link = ffi_bridge + .NativeInteropHostIntegrationCoreApiSetup.getInstanceWithName(NSString(channelName)); + if (link == null) { + _throwNoInstanceError(channelName); + } + res = _NativeInteropHostIntegrationCoreApiForNativeInterop._withRegistrar(ffiApi: link); + } else { + throw UnsupportedError( + 'Native Interop is not supported on this platform. Use NativeInteropHostIntegrationCoreApi instead.', + ); + } + return res; + } + + late final jni_bridge.NativeInteropHostIntegrationCoreApiRegistrar? _jniApi; + late final ffi_bridge.NativeInteropHostIntegrationCoreApiSetup? _ffiApi; + + @override + void noop() { + try { + if (_jniApi != null) { + return _jniApi.noop(); + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + _ffiApi.noopWithWrappedError(pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + return; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropAllTypes echoAllTypes(NativeInteropAllTypes everything) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAllTypes pigeonVar_res = _jniApi.echoAllTypes( + everything.toJni(), + ); + final NativeInteropAllTypes pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllTypesNativeInterop.fromJni(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropAllTypesBridge? pigeonVar_res = _ffiApi + .echoAllTypesWithEverything(everything.toFfi(), wrappedError: pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + final NativeInteropAllTypes pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllTypesNativeInterop.fromFfi(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Object? throwError() { + try { + if (_jniApi != null) { + final JObject? pigeonVar_res = _jniApi.throwError(); + final Object? pigeonVar_dartTypeRes = _PigeonJniCodec.readValue(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSObject? pigeonVar_res = _ffiApi.throwErrorWithWrappedError(pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + final Object? pigeonVar_dartTypeRes = _PigeonFfiCodec.readValue(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + void throwErrorFromVoid() { + try { + if (_jniApi != null) { + return _jniApi.throwErrorFromVoid(); + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + _ffiApi.throwErrorFromVoidWithWrappedError(pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + return; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Object? throwFlutterError() { + try { + if (_jniApi != null) { + final JObject? pigeonVar_res = _jniApi.throwFlutterError(); + final Object? pigeonVar_dartTypeRes = _PigeonJniCodec.readValue(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSObject? pigeonVar_res = _ffiApi.throwFlutterErrorWithWrappedError(pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + final Object? pigeonVar_dartTypeRes = _PigeonFfiCodec.readValue(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + int echoInt(int anInt) { + try { + if (_jniApi != null) { + return _jniApi.echoInt(anInt); + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.echoIntWithAnInt( + anInt, + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final int pigeonVar_dartTypeRes = pigeonVar_res!.longValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + double echoDouble(double aDouble) { + try { + if (_jniApi != null) { + return _jniApi.echoDouble(aDouble); + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.echoDoubleWithADouble( + aDouble, + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final double pigeonVar_dartTypeRes = pigeonVar_res!.doubleValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + bool echoBool(bool aBool) { + try { + if (_jniApi != null) { + return _jniApi.echoBool(aBool); + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.echoBoolWithABool( + aBool, + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final bool pigeonVar_dartTypeRes = pigeonVar_res!.boolValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + String echoString(String aString) { + try { + if (_jniApi != null) { + final JString pigeonVar_res = _jniApi.echoString( + _PigeonJniCodec.writeValue(aString), + ); + final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSString? pigeonVar_res = _ffiApi.echoStringWithAString( + _PigeonFfiCodec.writeValue(aString), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final String pigeonVar_dartTypeRes = pigeonVar_res!.toDartString(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Uint8List echoUint8List(Uint8List aUint8List) { + try { + if (_jniApi != null) { + final JByteArray pigeonVar_res = _jniApi.echoUint8List( + _PigeonJniCodec.writeValue(aUint8List), + ); + final Uint8List pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res)! as Uint8List; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi + .echoUint8ListWithAUint8List( + _PigeonFfiCodec.writeValue(aUint8List), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Uint8List pigeonVar_dartTypeRes = + _PigeonFfiCodec.readValue(pigeonVar_res)! as Uint8List; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Int32List echoInt32List(Int32List aInt32List) { + try { + if (_jniApi != null) { + final JIntArray pigeonVar_res = _jniApi.echoInt32List( + _PigeonJniCodec.writeValue(aInt32List), + ); + final Int32List pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res)! as Int32List; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi + .echoInt32ListWithAInt32List( + _PigeonFfiCodec.writeValue(aInt32List), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Int32List pigeonVar_dartTypeRes = + _PigeonFfiCodec.readValue(pigeonVar_res)! as Int32List; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Int64List echoInt64List(Int64List aInt64List) { + try { + if (_jniApi != null) { + final JLongArray pigeonVar_res = _jniApi.echoInt64List( + _PigeonJniCodec.writeValue(aInt64List), + ); + final Int64List pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res)! as Int64List; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi + .echoInt64ListWithAInt64List( + _PigeonFfiCodec.writeValue(aInt64List), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Int64List pigeonVar_dartTypeRes = + _PigeonFfiCodec.readValue(pigeonVar_res)! as Int64List; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Float64List echoFloat64List(Float64List aFloat64List) { + try { + if (_jniApi != null) { + final JDoubleArray pigeonVar_res = _jniApi.echoFloat64List( + _PigeonJniCodec.writeValue(aFloat64List), + ); + final Float64List pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res)! as Float64List; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi + .echoFloat64ListWithAFloat64List( + _PigeonFfiCodec.writeValue( + aFloat64List, + ), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Float64List pigeonVar_dartTypeRes = + _PigeonFfiCodec.readValue(pigeonVar_res)! as Float64List; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Object echoObject(Object anObject) { + try { + if (_jniApi != null) { + final JObject pigeonVar_res = _jniApi.echoObject( + _PigeonJniCodec.writeValue(anObject), + ); + final Object pigeonVar_dartTypeRes = _PigeonJniCodec.readValue(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSObject? pigeonVar_res = _ffiApi.echoObjectWithAnObject( + _PigeonFfiCodec.writeValue(anObject, generic: true), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Object pigeonVar_dartTypeRes = _PigeonFfiCodec.readValue(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List echoList(List list) { + try { + if (_jniApi != null) { + final JList pigeonVar_res = _jniApi.echoList( + _PigeonJniCodec.writeValue>(list), + ); + final List pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as List).cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.echoListWithList( + _PigeonFfiCodec.writeValue(list), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res)! as List).cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List echoStringList(List stringList) { + try { + if (_jniApi != null) { + final JList pigeonVar_res = _jniApi.echoStringList( + _PigeonJniCodec.writeValue>(stringList), + ); + final List pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as List).cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.echoStringListWithStringList( + _PigeonFfiCodec.writeValue(stringList), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res)! as List).cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List echoIntList(List intList) { + try { + if (_jniApi != null) { + final JList pigeonVar_res = _jniApi.echoIntList( + _PigeonJniCodec.writeValue>(intList), + ); + final List pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as List).cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.echoIntListWithIntList( + _PigeonFfiCodec.writeValue(intList), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, int)! as List).cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List echoDoubleList(List doubleList) { + try { + if (_jniApi != null) { + final JList pigeonVar_res = _jniApi.echoDoubleList( + _PigeonJniCodec.writeValue>(doubleList), + ); + final List pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as List).cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.echoDoubleListWithDoubleList( + _PigeonFfiCodec.writeValue(doubleList), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, double)! as List).cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List echoBoolList(List boolList) { + try { + if (_jniApi != null) { + final JList pigeonVar_res = _jniApi.echoBoolList( + _PigeonJniCodec.writeValue>(boolList), + ); + final List pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as List).cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.echoBoolListWithBoolList( + _PigeonFfiCodec.writeValue(boolList), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, bool)! as List).cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List echoEnumList(List enumList) { + try { + if (_jniApi != null) { + final JList pigeonVar_res = _jniApi.echoEnumList( + _PigeonJniCodec.writeValue>(enumList), + ); + final List pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as List) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.echoEnumListWithEnumList( + _PigeonFfiCodec.writeValue(enumList), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum)! as List) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List echoClassList( + List classList, + ) { + try { + if (_jniApi != null) { + final JList pigeonVar_res = _jniApi + .echoClassList( + _PigeonJniCodec.writeValue>( + classList, + ), + ); + final List pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as List) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.echoClassListWithClassList( + _PigeonFfiCodec.writeValue(classList), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res)! as List) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List echoNonNullEnumList(List enumList) { + try { + if (_jniApi != null) { + final JList pigeonVar_res = _jniApi.echoNonNullEnumList( + _PigeonJniCodec.writeValue>(enumList), + ); + final List pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as List) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.echoNonNullEnumListWithEnumList( + _PigeonFfiCodec.writeValue(enumList), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum)! as List) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List echoNonNullClassList( + List classList, + ) { + try { + if (_jniApi != null) { + final JList pigeonVar_res = _jniApi + .echoNonNullClassList( + _PigeonJniCodec.writeValue>( + classList, + ), + ); + final List pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as List) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.echoNonNullClassListWithClassList( + _PigeonFfiCodec.writeValue(classList), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res)! as List) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map echoMap(Map map) { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = _jniApi.echoMap( + _PigeonJniCodec.writeValue>(map), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.echoMapWithMap( + _PigeonFfiCodec.writeValue(map), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map echoStringMap(Map stringMap) { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = _jniApi.echoStringMap( + _PigeonJniCodec.writeValue>(stringMap), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.echoStringMapWithStringMap( + _PigeonFfiCodec.writeValue(stringMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map echoIntMap(Map intMap) { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = _jniApi.echoIntMap( + _PigeonJniCodec.writeValue>(intMap), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map).cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.echoIntMapWithIntMap( + _PigeonFfiCodec.writeValue(intMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, int, int)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map echoEnumMap( + Map enumMap, + ) { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = + _jniApi.echoEnumMap( + _PigeonJniCodec.writeValue< + JMap + >(enumMap), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.echoEnumMapWithEnumMap( + _PigeonFfiCodec.writeValue(enumMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum, NativeInteropAnEnum)! + as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map echoClassMap( + Map classMap, + ) { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = _jniApi + .echoClassMap( + _PigeonJniCodec.writeValue>( + classMap, + ), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.echoClassMapWithClassMap( + _PigeonFfiCodec.writeValue(classMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, int)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map echoNonNullStringMap(Map stringMap) { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = _jniApi.echoNonNullStringMap( + _PigeonJniCodec.writeValue>(stringMap), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.echoNonNullStringMapWithStringMap( + _PigeonFfiCodec.writeValue(stringMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map echoNonNullIntMap(Map intMap) { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = _jniApi.echoNonNullIntMap( + _PigeonJniCodec.writeValue>(intMap), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map).cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.echoNonNullIntMapWithIntMap( + _PigeonFfiCodec.writeValue(intMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, int, int)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map echoNonNullEnumMap( + Map enumMap, + ) { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = + _jniApi.echoNonNullEnumMap( + _PigeonJniCodec.writeValue< + JMap + >(enumMap), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.echoNonNullEnumMapWithEnumMap( + _PigeonFfiCodec.writeValue(enumMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum, NativeInteropAnEnum)! + as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map echoNonNullClassMap( + Map classMap, + ) { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = _jniApi + .echoNonNullClassMap( + _PigeonJniCodec.writeValue>( + classMap, + ), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.echoNonNullClassMapWithClassMap( + _PigeonFfiCodec.writeValue(classMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, int)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropAllClassesWrapper echoClassWrapper(NativeInteropAllClassesWrapper wrapper) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAllClassesWrapper pigeonVar_res = _jniApi.echoClassWrapper( + wrapper.toJni(), + ); + final NativeInteropAllClassesWrapper pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllClassesWrapperNativeInterop.fromJni(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropAllClassesWrapperBridge? pigeonVar_res = _ffiApi + .echoClassWrapperWithWrapper(wrapper.toFfi(), wrappedError: pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + final NativeInteropAllClassesWrapper pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllClassesWrapperNativeInterop.fromFfi(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropSealedClass echoSealedClass(NativeInteropSealedClass sealedClass) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropSealedClass pigeonVar_res = _jniApi.echoSealedClass( + sealedClass.toJni(), + ); + final NativeInteropSealedClass pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropSealedClassNativeInterop.fromJni(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropSealedClassBridge? pigeonVar_res = _ffiApi + .echoSealedClassWithSealedClass(sealedClass.toFfi(), wrappedError: pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + final NativeInteropSealedClass pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropSealedClassNativeInterop.fromFfi(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropSealedClass? echoNullableSealedClass(NativeInteropSealedClass? sealedClass) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropSealedClass? pigeonVar_res = _jniApi.echoNullableSealedClass( + sealedClass?.toJni(), + ); + final NativeInteropSealedClass? pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropSealedClassNativeInterop.fromJni(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropSealedClassBridge? pigeonVar_res = _ffiApi + .echoNullableSealedClassWithSealedClass( + sealedClass?.toFfi(), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final NativeInteropSealedClass? pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropSealedClassNativeInterop.fromFfi(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List echoSealedClassList( + List sealedClassList, + ) { + try { + if (_jniApi != null) { + final JList pigeonVar_res = _jniApi + .echoSealedClassList( + _PigeonJniCodec.writeValue>( + sealedClassList, + ), + ); + final List pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as List) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.echoSealedClassListWithSealedClassList( + _PigeonFfiCodec.writeValue(sealedClassList), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res)! as List) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropSealedClassWrapper echoSealedClassWrapper(NativeInteropSealedClassWrapper wrapper) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropSealedClassWrapper pigeonVar_res = _jniApi + .echoSealedClassWrapper(wrapper.toJni()); + final NativeInteropSealedClassWrapper pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropSealedClassWrapperNativeInterop.fromJni(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropSealedClassWrapperBridge? pigeonVar_res = _ffiApi + .echoSealedClassWrapperWithWrapper(wrapper.toFfi(), wrappedError: pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + final NativeInteropSealedClassWrapper pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropSealedClassWrapperNativeInterop.fromFfi(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropAnEnum echoEnum(NativeInteropAnEnum anEnum) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAnEnum pigeonVar_res = _jniApi.echoEnum(anEnum.toJni()); + final NativeInteropAnEnum pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAnEnumNativeInterop.fromJni(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.echoEnumWithAnEnum( + ffi_bridge.NativeInteropAnEnum.values[anEnum.index], + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final NativeInteropAnEnum pigeonVar_dartTypeRes = + _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum)! as NativeInteropAnEnum; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropAnotherEnum echoAnotherEnum(NativeInteropAnotherEnum anotherEnum) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAnotherEnum pigeonVar_res = _jniApi.echoAnotherEnum( + anotherEnum.toJni(), + ); + final NativeInteropAnotherEnum pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAnotherEnumNativeInterop.fromJni(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.echoAnotherEnumWithAnotherEnum( + ffi_bridge.NativeInteropAnotherEnum.values[anotherEnum.index], + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final NativeInteropAnotherEnum pigeonVar_dartTypeRes = + _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnotherEnum)! + as NativeInteropAnotherEnum; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + String echoNamedDefaultString({String aString = 'default'}) { + try { + if (_jniApi != null) { + final JString pigeonVar_res = _jniApi.echoNamedDefaultString( + _PigeonJniCodec.writeValue(aString), + ); + final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSString? pigeonVar_res = _ffiApi.echoNamedDefaultStringWithAString( + _PigeonFfiCodec.writeValue(aString), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final String pigeonVar_dartTypeRes = pigeonVar_res!.toDartString(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + double echoOptionalDefaultDouble([double aDouble = 3.14]) { + try { + if (_jniApi != null) { + return _jniApi.echoOptionalDefaultDouble(aDouble); + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.echoOptionalDefaultDoubleWithADouble( + aDouble, + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final double pigeonVar_dartTypeRes = pigeonVar_res!.doubleValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + int echoRequiredInt({required int anInt}) { + try { + if (_jniApi != null) { + return _jniApi.echoRequiredInt(anInt); + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.echoRequiredIntWithAnInt( + anInt, + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final int pigeonVar_dartTypeRes = pigeonVar_res!.longValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropAllNullableTypes? echoAllNullableTypes(NativeInteropAllNullableTypes? everything) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAllNullableTypes? pigeonVar_res = _jniApi + .echoAllNullableTypes(everything?.toJni()); + final NativeInteropAllNullableTypes? pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllNullableTypesNativeInterop.fromJni(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropAllNullableTypesBridge? pigeonVar_res = _ffiApi + .echoAllNullableTypesWithEverything(everything?.toFfi(), wrappedError: pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + final NativeInteropAllNullableTypes? pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllNullableTypesNativeInterop.fromFfi(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropAllNullableTypesWithoutRecursion? echoAllNullableTypesWithoutRecursion( + NativeInteropAllNullableTypesWithoutRecursion? everything, + ) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAllNullableTypesWithoutRecursion? pigeonVar_res = _jniApi + .echoAllNullableTypesWithoutRecursion(everything?.toJni()); + final NativeInteropAllNullableTypesWithoutRecursion? pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllNullableTypesWithoutRecursionNativeInterop.fromJni( + pigeonVar_res, + ); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge? pigeonVar_res = + _ffiApi.echoAllNullableTypesWithoutRecursionWithEverything( + everything?.toFfi(), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final NativeInteropAllNullableTypesWithoutRecursion? pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllNullableTypesWithoutRecursionNativeInterop.fromFfi( + pigeonVar_res, + ); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + String? extractNestedNullableString(NativeInteropAllClassesWrapper wrapper) { + try { + if (_jniApi != null) { + final JString? pigeonVar_res = _jniApi.extractNestedNullableString(wrapper.toJni()); + final String? pigeonVar_dartTypeRes = pigeonVar_res?.toDartString(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSString? pigeonVar_res = _ffiApi.extractNestedNullableStringWithWrapper( + wrapper.toFfi(), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final String? pigeonVar_dartTypeRes = pigeonVar_res?.toDartString(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropAllClassesWrapper createNestedNullableString(String? nullableString) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAllClassesWrapper pigeonVar_res = _jniApi + .createNestedNullableString(_PigeonJniCodec.writeValue(nullableString)); + final NativeInteropAllClassesWrapper pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllClassesWrapperNativeInterop.fromJni(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropAllClassesWrapperBridge? pigeonVar_res = _ffiApi + .createNestedNullableStringWithNullableString( + _PigeonFfiCodec.writeValue(nullableString), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final NativeInteropAllClassesWrapper pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllClassesWrapperNativeInterop.fromFfi(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropAllNullableTypes sendMultipleNullableTypes( + bool? aNullableBool, + int? aNullableInt, + String? aNullableString, + ) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAllNullableTypes pigeonVar_res = _jniApi + .sendMultipleNullableTypes( + _PigeonJniCodec.writeValue(aNullableBool), + _PigeonJniCodec.writeValue(aNullableInt), + _PigeonJniCodec.writeValue(aNullableString), + ); + final NativeInteropAllNullableTypes pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllNullableTypesNativeInterop.fromJni(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropAllNullableTypesBridge? pigeonVar_res = _ffiApi + .sendMultipleNullableTypesWithANullableBool( + _PigeonFfiCodec.writeValue(aNullableBool), + aNullableInt: _PigeonFfiCodec.writeValue(aNullableInt), + aNullableString: _PigeonFfiCodec.writeValue(aNullableString), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final NativeInteropAllNullableTypes pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllNullableTypesNativeInterop.fromFfi(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropAllNullableTypesWithoutRecursion sendMultipleNullableTypesWithoutRecursion( + bool? aNullableBool, + int? aNullableInt, + String? aNullableString, + ) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAllNullableTypesWithoutRecursion pigeonVar_res = _jniApi + .sendMultipleNullableTypesWithoutRecursion( + _PigeonJniCodec.writeValue(aNullableBool), + _PigeonJniCodec.writeValue(aNullableInt), + _PigeonJniCodec.writeValue(aNullableString), + ); + final NativeInteropAllNullableTypesWithoutRecursion pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllNullableTypesWithoutRecursionNativeInterop.fromJni( + pigeonVar_res, + )!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge? pigeonVar_res = + _ffiApi.sendMultipleNullableTypesWithoutRecursionWithANullableBool( + _PigeonFfiCodec.writeValue(aNullableBool), + aNullableInt: _PigeonFfiCodec.writeValue(aNullableInt), + aNullableString: _PigeonFfiCodec.writeValue(aNullableString), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final NativeInteropAllNullableTypesWithoutRecursion pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllNullableTypesWithoutRecursionNativeInterop.fromFfi( + pigeonVar_res, + )!; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + int? echoNullableInt(int? aNullableInt) { + try { + if (_jniApi != null) { + final JLong? pigeonVar_res = _jniApi.echoNullableInt( + _PigeonJniCodec.writeValue(aNullableInt), + ); + final int? pigeonVar_dartTypeRes = pigeonVar_res?.toDartInt(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.echoNullableIntWithANullableInt( + _PigeonFfiCodec.writeValue(aNullableInt), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final int? pigeonVar_dartTypeRes = pigeonVar_res?.longValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + double? echoNullableDouble(double? aNullableDouble) { + try { + if (_jniApi != null) { + final JDouble? pigeonVar_res = _jniApi.echoNullableDouble( + _PigeonJniCodec.writeValue(aNullableDouble), + ); + final double? pigeonVar_dartTypeRes = pigeonVar_res?.toDartDouble(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.echoNullableDoubleWithANullableDouble( + _PigeonFfiCodec.writeValue(aNullableDouble), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final double? pigeonVar_dartTypeRes = pigeonVar_res?.doubleValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + bool? echoNullableBool(bool? aNullableBool) { + try { + if (_jniApi != null) { + final JBoolean? pigeonVar_res = _jniApi.echoNullableBool( + _PigeonJniCodec.writeValue(aNullableBool), + ); + final bool? pigeonVar_dartTypeRes = pigeonVar_res?.toDartBool(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.echoNullableBoolWithANullableBool( + _PigeonFfiCodec.writeValue(aNullableBool), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final bool? pigeonVar_dartTypeRes = pigeonVar_res?.boolValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + String? echoNullableString(String? aNullableString) { + try { + if (_jniApi != null) { + final JString? pigeonVar_res = _jniApi.echoNullableString( + _PigeonJniCodec.writeValue(aNullableString), + ); + final String? pigeonVar_dartTypeRes = pigeonVar_res?.toDartString(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSString? pigeonVar_res = _ffiApi.echoNullableStringWithANullableString( + _PigeonFfiCodec.writeValue(aNullableString), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final String? pigeonVar_dartTypeRes = pigeonVar_res?.toDartString(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Uint8List? echoNullableUint8List(Uint8List? aNullableUint8List) { + try { + if (_jniApi != null) { + final JByteArray? pigeonVar_res = _jniApi.echoNullableUint8List( + _PigeonJniCodec.writeValue(aNullableUint8List), + ); + final Uint8List? pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res) as Uint8List?; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi + .echoNullableUint8ListWithANullableUint8List( + _PigeonFfiCodec.writeValue( + aNullableUint8List, + ), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Uint8List? pigeonVar_dartTypeRes = + _PigeonFfiCodec.readValue(pigeonVar_res) as Uint8List?; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Int32List? echoNullableInt32List(Int32List? aNullableInt32List) { + try { + if (_jniApi != null) { + final JIntArray? pigeonVar_res = _jniApi.echoNullableInt32List( + _PigeonJniCodec.writeValue(aNullableInt32List), + ); + final Int32List? pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res) as Int32List?; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi + .echoNullableInt32ListWithANullableInt32List( + _PigeonFfiCodec.writeValue( + aNullableInt32List, + ), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Int32List? pigeonVar_dartTypeRes = + _PigeonFfiCodec.readValue(pigeonVar_res) as Int32List?; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Int64List? echoNullableInt64List(Int64List? aNullableInt64List) { + try { + if (_jniApi != null) { + final JLongArray? pigeonVar_res = _jniApi.echoNullableInt64List( + _PigeonJniCodec.writeValue(aNullableInt64List), + ); + final Int64List? pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res) as Int64List?; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi + .echoNullableInt64ListWithANullableInt64List( + _PigeonFfiCodec.writeValue( + aNullableInt64List, + ), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Int64List? pigeonVar_dartTypeRes = + _PigeonFfiCodec.readValue(pigeonVar_res) as Int64List?; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Float64List? echoNullableFloat64List(Float64List? aNullableFloat64List) { + try { + if (_jniApi != null) { + final JDoubleArray? pigeonVar_res = _jniApi.echoNullableFloat64List( + _PigeonJniCodec.writeValue(aNullableFloat64List), + ); + final Float64List? pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res) as Float64List?; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi + .echoNullableFloat64ListWithANullableFloat64List( + _PigeonFfiCodec.writeValue( + aNullableFloat64List, + ), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Float64List? pigeonVar_dartTypeRes = + _PigeonFfiCodec.readValue(pigeonVar_res) as Float64List?; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Object? echoNullableObject(Object? aNullableObject) { + try { + if (_jniApi != null) { + final JObject? pigeonVar_res = _jniApi.echoNullableObject( + _PigeonJniCodec.writeValue(aNullableObject), + ); + final Object? pigeonVar_dartTypeRes = _PigeonJniCodec.readValue(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSObject? pigeonVar_res = _ffiApi.echoNullableObjectWithANullableObject( + _PigeonFfiCodec.writeValue(aNullableObject, generic: true), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Object? pigeonVar_dartTypeRes = _PigeonFfiCodec.readValue(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List? echoNullableList(List? aNullableList) { + try { + if (_jniApi != null) { + final JList? pigeonVar_res = _jniApi.echoNullableList( + _PigeonJniCodec.writeValue?>(aNullableList), + ); + final List? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as List?)?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.echoNullableListWithANullableList( + _PigeonFfiCodec.writeValue(aNullableList), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res) as List?)?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List? echoNullableEnumList(List? enumList) { + try { + if (_jniApi != null) { + final JList? pigeonVar_res = _jniApi.echoNullableEnumList( + _PigeonJniCodec.writeValue?>(enumList), + ); + final List? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as List?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.echoNullableEnumListWithEnumList( + _PigeonFfiCodec.writeValue(enumList), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum) as List?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List? echoNullableClassList( + List? classList, + ) { + try { + if (_jniApi != null) { + final JList? pigeonVar_res = _jniApi + .echoNullableClassList( + _PigeonJniCodec.writeValue?>( + classList, + ), + ); + final List? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as List?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.echoNullableClassListWithClassList( + _PigeonFfiCodec.writeValue(classList), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res) as List?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List? echoNullableNonNullEnumList(List? enumList) { + try { + if (_jniApi != null) { + final JList? pigeonVar_res = _jniApi + .echoNullableNonNullEnumList( + _PigeonJniCodec.writeValue?>(enumList), + ); + final List? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as List?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.echoNullableNonNullEnumListWithEnumList( + _PigeonFfiCodec.writeValue(enumList), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum) as List?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List? echoNullableNonNullClassList( + List? classList, + ) { + try { + if (_jniApi != null) { + final JList? pigeonVar_res = _jniApi + .echoNullableNonNullClassList( + _PigeonJniCodec.writeValue?>( + classList, + ), + ); + final List? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as List?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.echoNullableNonNullClassListWithClassList( + _PigeonFfiCodec.writeValue(classList), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res) as List?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map? echoNullableMap(Map? map) { + try { + if (_jniApi != null) { + final JMap? pigeonVar_res = _jniApi.echoNullableMap( + _PigeonJniCodec.writeValue?>(map), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.echoNullableMapWithMap( + _PigeonFfiCodec.writeValue(map), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map? echoNullableStringMap(Map? stringMap) { + try { + if (_jniApi != null) { + final JMap? pigeonVar_res = _jniApi.echoNullableStringMap( + _PigeonJniCodec.writeValue?>(stringMap), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.echoNullableStringMapWithStringMap( + _PigeonFfiCodec.writeValue(stringMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map? echoNullableIntMap(Map? intMap) { + try { + if (_jniApi != null) { + final JMap? pigeonVar_res = _jniApi.echoNullableIntMap( + _PigeonJniCodec.writeValue?>(intMap), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.echoNullableIntMapWithIntMap( + _PigeonFfiCodec.writeValue(intMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, int, int) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map? echoNullableEnumMap( + Map? enumMap, + ) { + try { + if (_jniApi != null) { + final JMap? + pigeonVar_res = _jniApi.echoNullableEnumMap( + _PigeonJniCodec.writeValue< + JMap? + >(enumMap), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.echoNullableEnumMapWithEnumMap( + _PigeonFfiCodec.writeValue(enumMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum, NativeInteropAnEnum) + as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map? echoNullableClassMap( + Map? classMap, + ) { + try { + if (_jniApi != null) { + final JMap? pigeonVar_res = _jniApi + .echoNullableClassMap( + _PigeonJniCodec.writeValue?>( + classMap, + ), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.echoNullableClassMapWithClassMap( + _PigeonFfiCodec.writeValue(classMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, int) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map? echoNullableNonNullStringMap(Map? stringMap) { + try { + if (_jniApi != null) { + final JMap? pigeonVar_res = _jniApi.echoNullableNonNullStringMap( + _PigeonJniCodec.writeValue?>(stringMap), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.echoNullableNonNullStringMapWithStringMap( + _PigeonFfiCodec.writeValue(stringMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map? echoNullableNonNullIntMap(Map? intMap) { + try { + if (_jniApi != null) { + final JMap? pigeonVar_res = _jniApi.echoNullableNonNullIntMap( + _PigeonJniCodec.writeValue?>(intMap), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?)?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.echoNullableNonNullIntMapWithIntMap( + _PigeonFfiCodec.writeValue(intMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, int, int) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map? echoNullableNonNullEnumMap( + Map? enumMap, + ) { + try { + if (_jniApi != null) { + final JMap? pigeonVar_res = + _jniApi.echoNullableNonNullEnumMap( + _PigeonJniCodec.writeValue< + JMap? + >(enumMap), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.echoNullableNonNullEnumMapWithEnumMap( + _PigeonFfiCodec.writeValue(enumMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum, NativeInteropAnEnum) + as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map? echoNullableNonNullClassMap( + Map? classMap, + ) { + try { + if (_jniApi != null) { + final JMap? pigeonVar_res = _jniApi + .echoNullableNonNullClassMap( + _PigeonJniCodec.writeValue?>( + classMap, + ), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.echoNullableNonNullClassMapWithClassMap( + _PigeonFfiCodec.writeValue(classMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, int) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropAnEnum? echoNullableEnum(NativeInteropAnEnum? anEnum) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAnEnum? pigeonVar_res = _jniApi.echoNullableEnum( + anEnum?.toJni(), + ); + final NativeInteropAnEnum? pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAnEnumNativeInterop.fromJni(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.echoNullableEnumWithAnEnum( + _PigeonFfiCodec.writeValue(anEnum), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final NativeInteropAnEnum? pigeonVar_dartTypeRes = + _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum) as NativeInteropAnEnum?; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropAnotherEnum? echoAnotherNullableEnum(NativeInteropAnotherEnum? anotherEnum) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAnotherEnum? pigeonVar_res = _jniApi.echoAnotherNullableEnum( + anotherEnum?.toJni(), + ); + final NativeInteropAnotherEnum? pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAnotherEnumNativeInterop.fromJni(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.echoAnotherNullableEnumWithAnotherEnum( + _PigeonFfiCodec.writeValue(anotherEnum), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final NativeInteropAnotherEnum? pigeonVar_dartTypeRes = + _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnotherEnum) + as NativeInteropAnotherEnum?; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + int? echoOptionalNullableInt([int? aNullableInt]) { + try { + if (_jniApi != null) { + final JLong? pigeonVar_res = _jniApi.echoOptionalNullableInt( + _PigeonJniCodec.writeValue(aNullableInt), + ); + final int? pigeonVar_dartTypeRes = pigeonVar_res?.toDartInt(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.echoOptionalNullableIntWithANullableInt( + _PigeonFfiCodec.writeValue(aNullableInt), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final int? pigeonVar_dartTypeRes = pigeonVar_res?.longValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + String? echoNamedNullableString({String? aNullableString}) { + try { + if (_jniApi != null) { + final JString? pigeonVar_res = _jniApi.echoNamedNullableString( + _PigeonJniCodec.writeValue(aNullableString), + ); + final String? pigeonVar_dartTypeRes = pigeonVar_res?.toDartString(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSString? pigeonVar_res = _ffiApi.echoNamedNullableStringWithANullableString( + _PigeonFfiCodec.writeValue(aNullableString), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final String? pigeonVar_dartTypeRes = pigeonVar_res?.toDartString(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future noopAsync() async { + try { + if (_jniApi != null) { + await _jniApi.noopAsync(); + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.noopAsyncWithWrappedError( + pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid.listener(() { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAsyncInt(int anInt) async { + try { + if (_jniApi != null) { + final JLong pigeonVar_res = await _jniApi.echoAsyncInt(anInt); + final int pigeonVar_dartTypeRes = pigeonVar_res.toDartInt(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.echoAsyncIntWithAnInt( + anInt, + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( + NSNumber? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(pigeonVar_res!.longValue); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAsyncDouble(double aDouble) async { + try { + if (_jniApi != null) { + final JDouble pigeonVar_res = await _jniApi.echoAsyncDouble(aDouble); + final double pigeonVar_dartTypeRes = pigeonVar_res.toDartDouble(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.echoAsyncDoubleWithADouble( + aDouble, + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( + NSNumber? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(pigeonVar_res!.doubleValue); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAsyncBool(bool aBool) async { + try { + if (_jniApi != null) { + final JBoolean pigeonVar_res = await _jniApi.echoAsyncBool(aBool); + final bool pigeonVar_dartTypeRes = pigeonVar_res.toDartBool(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.echoAsyncBoolWithABool( + aBool, + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( + NSNumber? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(pigeonVar_res!.boolValue); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAsyncString(String aString) async { + try { + if (_jniApi != null) { + final JString pigeonVar_res = await _jniApi.echoAsyncString( + _PigeonJniCodec.writeValue(aString), + ); + final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.echoAsyncStringWithAString( + _PigeonFfiCodec.writeValue(aString), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSString.listener(( + NSString? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(pigeonVar_res!.toDartString()); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAsyncUint8List(Uint8List aUint8List) async { + try { + if (_jniApi != null) { + final JByteArray pigeonVar_res = await _jniApi.echoAsyncUint8List( + _PigeonJniCodec.writeValue(aUint8List), + ); + final Uint8List pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res)! as Uint8List; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.echoAsyncUint8ListWithAUint8List( + _PigeonFfiCodec.writeValue(aUint8List), + wrappedError: pigeonVar_error, + completionHandler: + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( + ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonFfiCodec.readValue(pigeonVar_res)! as Uint8List, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAsyncInt32List(Int32List aInt32List) async { + try { + if (_jniApi != null) { + final JIntArray pigeonVar_res = await _jniApi.echoAsyncInt32List( + _PigeonJniCodec.writeValue(aInt32List), + ); + final Int32List pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res)! as Int32List; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.echoAsyncInt32ListWithAInt32List( + _PigeonFfiCodec.writeValue(aInt32List), + wrappedError: pigeonVar_error, + completionHandler: + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( + ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonFfiCodec.readValue(pigeonVar_res)! as Int32List, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAsyncInt64List(Int64List aInt64List) async { + try { + if (_jniApi != null) { + final JLongArray pigeonVar_res = await _jniApi.echoAsyncInt64List( + _PigeonJniCodec.writeValue(aInt64List), + ); + final Int64List pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res)! as Int64List; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.echoAsyncInt64ListWithAInt64List( + _PigeonFfiCodec.writeValue(aInt64List), + wrappedError: pigeonVar_error, + completionHandler: + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( + ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonFfiCodec.readValue(pigeonVar_res)! as Int64List, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAsyncFloat64List(Float64List aFloat64List) async { + try { + if (_jniApi != null) { + final JDoubleArray pigeonVar_res = await _jniApi.echoAsyncFloat64List( + _PigeonJniCodec.writeValue(aFloat64List), + ); + final Float64List pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res)! as Float64List; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.echoAsyncFloat64ListWithAFloat64List( + _PigeonFfiCodec.writeValue(aFloat64List), + wrappedError: pigeonVar_error, + completionHandler: + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( + ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonFfiCodec.readValue(pigeonVar_res)! as Float64List, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAsyncObject(Object anObject) async { + try { + if (_jniApi != null) { + final JObject pigeonVar_res = await _jniApi.echoAsyncObject( + _PigeonJniCodec.writeValue(anObject), + ); + final Object pigeonVar_dartTypeRes = _PigeonJniCodec.readValue(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.echoAsyncObjectWithAnObject( + _PigeonFfiCodec.writeValue(anObject, generic: true), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSObject.listener(( + NSObject? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(_PigeonFfiCodec.readValue(pigeonVar_res)!); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future> echoAsyncList(List list) async { + try { + if (_jniApi != null) { + final JList pigeonVar_res = await _jniApi.echoAsyncList( + _PigeonJniCodec.writeValue>(list), + ); + final List pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as List).cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer> pigeonVar_completer = Completer>(); + _ffiApi.echoAsyncListWithList( + _PigeonFfiCodec.writeValue(list), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( + NSArray? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res)! as List).cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future> echoAsyncEnumList(List enumList) async { + try { + if (_jniApi != null) { + final JList pigeonVar_res = await _jniApi + .echoAsyncEnumList( + _PigeonJniCodec.writeValue>(enumList), + ); + final List pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as List) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer> pigeonVar_completer = + Completer>(); + _ffiApi.echoAsyncEnumListWithEnumList( + _PigeonFfiCodec.writeValue(enumList), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( + NSArray? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum)! as List) + .cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future> echoAsyncClassList( + List classList, + ) async { + try { + if (_jniApi != null) { + final JList pigeonVar_res = await _jniApi + .echoAsyncClassList( + _PigeonJniCodec.writeValue>( + classList, + ), + ); + final List pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as List) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer> pigeonVar_completer = + Completer>(); + _ffiApi.echoAsyncClassListWithClassList( + _PigeonFfiCodec.writeValue(classList), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( + NSArray? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res)! as List) + .cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future> echoAsyncMap(Map map) async { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = await _jniApi.echoAsyncMap( + _PigeonJniCodec.writeValue>(map), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer> pigeonVar_completer = + Completer>(); + _ffiApi.echoAsyncMapWithMap( + _PigeonFfiCodec.writeValue(map), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( + NSDictionary? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res)! as Map) + .cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future> echoAsyncStringMap(Map stringMap) async { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = await _jniApi.echoAsyncStringMap( + _PigeonJniCodec.writeValue>(stringMap), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer> pigeonVar_completer = + Completer>(); + _ffiApi.echoAsyncStringMapWithStringMap( + _PigeonFfiCodec.writeValue(stringMap), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( + NSDictionary? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res)! as Map) + .cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future> echoAsyncIntMap(Map intMap) async { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = await _jniApi.echoAsyncIntMap( + _PigeonJniCodec.writeValue>(intMap), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map).cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer> pigeonVar_completer = Completer>(); + _ffiApi.echoAsyncIntMapWithIntMap( + _PigeonFfiCodec.writeValue(intMap), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( + NSDictionary? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res, int, int)! as Map) + .cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future> echoAsyncEnumMap( + Map enumMap, + ) async { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = + await _jniApi.echoAsyncEnumMap( + _PigeonJniCodec.writeValue< + JMap + >(enumMap), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer> pigeonVar_completer = + Completer>(); + _ffiApi.echoAsyncEnumMapWithEnumMap( + _PigeonFfiCodec.writeValue(enumMap), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( + NSDictionary? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum, NativeInteropAnEnum)! + as Map) + .cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future> echoAsyncClassMap( + Map classMap, + ) async { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = await _jniApi + .echoAsyncClassMap( + _PigeonJniCodec.writeValue>( + classMap, + ), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer> pigeonVar_completer = + Completer>(); + _ffiApi.echoAsyncClassMapWithClassMap( + _PigeonFfiCodec.writeValue(classMap), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( + NSDictionary? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res, int)! as Map) + .cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAsyncEnum(NativeInteropAnEnum anEnum) async { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAnEnum pigeonVar_res = await _jniApi.echoAsyncEnum( + anEnum.toJni(), + ); + final NativeInteropAnEnum pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAnEnumNativeInterop.fromJni(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.echoAsyncEnumWithAnEnum( + ffi_bridge.NativeInteropAnEnum.values[anEnum.index], + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( + NSNumber? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum)! + as NativeInteropAnEnum, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAnotherAsyncEnum( + NativeInteropAnotherEnum anotherEnum, + ) async { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAnotherEnum pigeonVar_res = await _jniApi + .echoAnotherAsyncEnum(anotherEnum.toJni()); + final NativeInteropAnotherEnum pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAnotherEnumNativeInterop.fromJni(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = + Completer(); + _ffiApi.echoAnotherAsyncEnumWithAnotherEnum( + ffi_bridge.NativeInteropAnotherEnum.values[anotherEnum.index], + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( + NSNumber? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnotherEnum)! + as NativeInteropAnotherEnum, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future throwAsyncError() async { + try { + if (_jniApi != null) { + final JObject? pigeonVar_res = await _jniApi.throwAsyncError(); + final Object? pigeonVar_dartTypeRes = _PigeonJniCodec.readValue(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.throwAsyncErrorWithWrappedError( + pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSObject.listener(( + NSObject? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(_PigeonFfiCodec.readValue(pigeonVar_res)); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future throwAsyncErrorFromVoid() async { + try { + if (_jniApi != null) { + await _jniApi.throwAsyncErrorFromVoid(); + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.throwAsyncErrorFromVoidWithWrappedError( + pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid.listener(() { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future throwAsyncFlutterError() async { + try { + if (_jniApi != null) { + final JObject? pigeonVar_res = await _jniApi.throwAsyncFlutterError(); + final Object? pigeonVar_dartTypeRes = _PigeonJniCodec.readValue(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.throwAsyncFlutterErrorWithWrappedError( + pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSObject.listener(( + NSObject? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(_PigeonFfiCodec.readValue(pigeonVar_res)); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAsyncNativeInteropAllTypes( + NativeInteropAllTypes everything, + ) async { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAllTypes pigeonVar_res = await _jniApi + .echoAsyncNativeInteropAllTypes(everything.toJni()); + final NativeInteropAllTypes pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllTypesNativeInterop.fromJni(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = + Completer(); + _ffiApi.echoAsyncNativeInteropAllTypesWithEverything( + everything.toFfi(), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllTypesBridge.listener(( + ffi_bridge.NativeInteropAllTypesBridge? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonInternalNativeInteropAllTypesNativeInterop.fromFfi(pigeonVar_res)!, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAsyncSealedClass( + NativeInteropSealedClass sealedClass, + ) async { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropSealedClass pigeonVar_res = await _jniApi + .echoAsyncSealedClass(sealedClass.toJni()); + final NativeInteropSealedClass pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropSealedClassNativeInterop.fromJni(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = + Completer(); + _ffiApi.echoAsyncSealedClassWithSealedClass( + sealedClass.toFfi(), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NativeInteropSealedClassBridge.listener(( + ffi_bridge.NativeInteropSealedClassBridge? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonInternalNativeInteropSealedClassNativeInterop.fromFfi(pigeonVar_res)!, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAsyncNullableNativeInteropAllNullableTypes( + NativeInteropAllNullableTypes? everything, + ) async { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAllNullableTypes? pigeonVar_res = await _jniApi + .echoAsyncNullableNativeInteropAllNullableTypes(everything?.toJni()); + final NativeInteropAllNullableTypes? pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllNullableTypesNativeInterop.fromJni(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = + Completer(); + _ffiApi.echoAsyncNullableNativeInteropAllNullableTypesWithEverything( + everything?.toFfi(), + wrappedError: pigeonVar_error, + completionHandler: + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllNullableTypesBridge.listener(( + ffi_bridge.NativeInteropAllNullableTypesBridge? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonInternalNativeInteropAllNullableTypesNativeInterop.fromFfi( + pigeonVar_res, + ), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future + echoAsyncNullableNativeInteropAllNullableTypesWithoutRecursion( + NativeInteropAllNullableTypesWithoutRecursion? everything, + ) async { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAllNullableTypesWithoutRecursion? pigeonVar_res = + await _jniApi.echoAsyncNullableNativeInteropAllNullableTypesWithoutRecursion( + everything?.toJni(), + ); + final NativeInteropAllNullableTypesWithoutRecursion? pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllNullableTypesWithoutRecursionNativeInterop.fromJni( + pigeonVar_res, + ); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = + Completer(); + _ffiApi.echoAsyncNullableNativeInteropAllNullableTypesWithoutRecursionWithEverything( + everything?.toFfi(), + wrappedError: pigeonVar_error, + completionHandler: + ffi_bridge + .ObjCBlock_ffiVoid_NativeInteropAllNullableTypesWithoutRecursionBridge.listener(( + ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonInternalNativeInteropAllNullableTypesWithoutRecursionNativeInterop.fromFfi( + pigeonVar_res, + ), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAsyncNullableInt(int? anInt) async { + try { + if (_jniApi != null) { + final JLong? pigeonVar_res = await _jniApi.echoAsyncNullableInt( + _PigeonJniCodec.writeValue(anInt), + ); + final int? pigeonVar_dartTypeRes = pigeonVar_res?.toDartInt(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.echoAsyncNullableIntWithAnInt( + _PigeonFfiCodec.writeValue(anInt), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( + NSNumber? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(pigeonVar_res?.longValue); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAsyncNullableDouble(double? aDouble) async { + try { + if (_jniApi != null) { + final JDouble? pigeonVar_res = await _jniApi.echoAsyncNullableDouble( + _PigeonJniCodec.writeValue(aDouble), + ); + final double? pigeonVar_dartTypeRes = pigeonVar_res?.toDartDouble(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.echoAsyncNullableDoubleWithADouble( + _PigeonFfiCodec.writeValue(aDouble), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( + NSNumber? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(pigeonVar_res?.doubleValue); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAsyncNullableBool(bool? aBool) async { + try { + if (_jniApi != null) { + final JBoolean? pigeonVar_res = await _jniApi.echoAsyncNullableBool( + _PigeonJniCodec.writeValue(aBool), + ); + final bool? pigeonVar_dartTypeRes = pigeonVar_res?.toDartBool(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.echoAsyncNullableBoolWithABool( + _PigeonFfiCodec.writeValue(aBool), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( + NSNumber? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(pigeonVar_res?.boolValue); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAsyncNullableString(String? aString) async { + try { + if (_jniApi != null) { + final JString? pigeonVar_res = await _jniApi.echoAsyncNullableString( + _PigeonJniCodec.writeValue(aString), + ); + final String? pigeonVar_dartTypeRes = pigeonVar_res?.toDartString(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.echoAsyncNullableStringWithAString( + _PigeonFfiCodec.writeValue(aString), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSString.listener(( + NSString? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(pigeonVar_res?.toDartString()); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAsyncNullableUint8List(Uint8List? aUint8List) async { + try { + if (_jniApi != null) { + final JByteArray? pigeonVar_res = await _jniApi.echoAsyncNullableUint8List( + _PigeonJniCodec.writeValue(aUint8List), + ); + final Uint8List? pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res) as Uint8List?; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.echoAsyncNullableUint8ListWithAUint8List( + _PigeonFfiCodec.writeValue(aUint8List), + wrappedError: pigeonVar_error, + completionHandler: + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( + ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonFfiCodec.readValue(pigeonVar_res) as Uint8List?, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAsyncNullableInt32List(Int32List? aInt32List) async { + try { + if (_jniApi != null) { + final JIntArray? pigeonVar_res = await _jniApi.echoAsyncNullableInt32List( + _PigeonJniCodec.writeValue(aInt32List), + ); + final Int32List? pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res) as Int32List?; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.echoAsyncNullableInt32ListWithAInt32List( + _PigeonFfiCodec.writeValue(aInt32List), + wrappedError: pigeonVar_error, + completionHandler: + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( + ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonFfiCodec.readValue(pigeonVar_res) as Int32List?, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAsyncNullableInt64List(Int64List? aInt64List) async { + try { + if (_jniApi != null) { + final JLongArray? pigeonVar_res = await _jniApi.echoAsyncNullableInt64List( + _PigeonJniCodec.writeValue(aInt64List), + ); + final Int64List? pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res) as Int64List?; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.echoAsyncNullableInt64ListWithAInt64List( + _PigeonFfiCodec.writeValue(aInt64List), + wrappedError: pigeonVar_error, + completionHandler: + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( + ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonFfiCodec.readValue(pigeonVar_res) as Int64List?, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAsyncNullableFloat64List(Float64List? aFloat64List) async { + try { + if (_jniApi != null) { + final JDoubleArray? pigeonVar_res = await _jniApi.echoAsyncNullableFloat64List( + _PigeonJniCodec.writeValue(aFloat64List), + ); + final Float64List? pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res) as Float64List?; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.echoAsyncNullableFloat64ListWithAFloat64List( + _PigeonFfiCodec.writeValue(aFloat64List), + wrappedError: pigeonVar_error, + completionHandler: + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( + ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonFfiCodec.readValue(pigeonVar_res) as Float64List?, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAsyncNullableObject(Object? anObject) async { + try { + if (_jniApi != null) { + final JObject? pigeonVar_res = await _jniApi.echoAsyncNullableObject( + _PigeonJniCodec.writeValue(anObject), + ); + final Object? pigeonVar_dartTypeRes = _PigeonJniCodec.readValue(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.echoAsyncNullableObjectWithAnObject( + _PigeonFfiCodec.writeValue(anObject, generic: true), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSObject.listener(( + NSObject? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(_PigeonFfiCodec.readValue(pigeonVar_res)); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future?> echoAsyncNullableList(List? list) async { + try { + if (_jniApi != null) { + final JList? pigeonVar_res = await _jniApi.echoAsyncNullableList( + _PigeonJniCodec.writeValue?>(list), + ); + final List? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as List?)?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer?> pigeonVar_completer = Completer?>(); + _ffiApi.echoAsyncNullableListWithList( + _PigeonFfiCodec.writeValue(list), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( + NSArray? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res) as List?)?.cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future?> echoAsyncNullableEnumList( + List? enumList, + ) async { + try { + if (_jniApi != null) { + final JList? pigeonVar_res = await _jniApi + .echoAsyncNullableEnumList( + _PigeonJniCodec.writeValue?>(enumList), + ); + final List? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as List?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer?> pigeonVar_completer = + Completer?>(); + _ffiApi.echoAsyncNullableEnumListWithEnumList( + _PigeonFfiCodec.writeValue(enumList), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( + NSArray? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum) as List?) + ?.cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future?> echoAsyncNullableClassList( + List? classList, + ) async { + try { + if (_jniApi != null) { + final JList? pigeonVar_res = await _jniApi + .echoAsyncNullableClassList( + _PigeonJniCodec.writeValue?>( + classList, + ), + ); + final List? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as List?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer?> pigeonVar_completer = + Completer?>(); + _ffiApi.echoAsyncNullableClassListWithClassList( + _PigeonFfiCodec.writeValue(classList), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( + NSArray? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res) as List?) + ?.cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future?> echoAsyncNullableMap(Map? map) async { + try { + if (_jniApi != null) { + final JMap? pigeonVar_res = await _jniApi.echoAsyncNullableMap( + _PigeonJniCodec.writeValue?>(map), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer?> pigeonVar_completer = + Completer?>(); + _ffiApi.echoAsyncNullableMapWithMap( + _PigeonFfiCodec.writeValue(map), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( + NSDictionary? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res) as Map?) + ?.cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future?> echoAsyncNullableStringMap( + Map? stringMap, + ) async { + try { + if (_jniApi != null) { + final JMap? pigeonVar_res = await _jniApi.echoAsyncNullableStringMap( + _PigeonJniCodec.writeValue?>(stringMap), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer?> pigeonVar_completer = + Completer?>(); + _ffiApi.echoAsyncNullableStringMapWithStringMap( + _PigeonFfiCodec.writeValue(stringMap), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( + NSDictionary? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res) as Map?) + ?.cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future?> echoAsyncNullableIntMap(Map? intMap) async { + try { + if (_jniApi != null) { + final JMap? pigeonVar_res = await _jniApi.echoAsyncNullableIntMap( + _PigeonJniCodec.writeValue?>(intMap), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer?> pigeonVar_completer = Completer?>(); + _ffiApi.echoAsyncNullableIntMapWithIntMap( + _PigeonFfiCodec.writeValue(intMap), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( + NSDictionary? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res, int, int) as Map?) + ?.cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future?> echoAsyncNullableEnumMap( + Map? enumMap, + ) async { + try { + if (_jniApi != null) { + final JMap? + pigeonVar_res = await _jniApi.echoAsyncNullableEnumMap( + _PigeonJniCodec.writeValue< + JMap? + >(enumMap), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer?> pigeonVar_completer = + Completer?>(); + _ffiApi.echoAsyncNullableEnumMapWithEnumMap( + _PigeonFfiCodec.writeValue(enumMap), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( + NSDictionary? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum, NativeInteropAnEnum) + as Map?) + ?.cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future?> echoAsyncNullableClassMap( + Map? classMap, + ) async { + try { + if (_jniApi != null) { + final JMap? pigeonVar_res = await _jniApi + .echoAsyncNullableClassMap( + _PigeonJniCodec.writeValue?>( + classMap, + ), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer?> pigeonVar_completer = + Completer?>(); + _ffiApi.echoAsyncNullableClassMapWithClassMap( + _PigeonFfiCodec.writeValue(classMap), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( + NSDictionary? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res, int) as Map?) + ?.cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAsyncNullableEnum(NativeInteropAnEnum? anEnum) async { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAnEnum? pigeonVar_res = await _jniApi.echoAsyncNullableEnum( + anEnum?.toJni(), + ); + final NativeInteropAnEnum? pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAnEnumNativeInterop.fromJni(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = + Completer(); + _ffiApi.echoAsyncNullableEnumWithAnEnum( + _PigeonFfiCodec.writeValue(anEnum), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( + NSNumber? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum) + as NativeInteropAnEnum?, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future echoAnotherAsyncNullableEnum( + NativeInteropAnotherEnum? anotherEnum, + ) async { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAnotherEnum? pigeonVar_res = await _jniApi + .echoAnotherAsyncNullableEnum(anotherEnum?.toJni()); + final NativeInteropAnotherEnum? pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAnotherEnumNativeInterop.fromJni(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = + Completer(); + _ffiApi.echoAnotherAsyncNullableEnumWithAnotherEnum( + _PigeonFfiCodec.writeValue(anotherEnum), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( + NSNumber? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnotherEnum) + as NativeInteropAnotherEnum?, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + void callFlutterNoop() { + try { + if (_jniApi != null) { + return _jniApi.callFlutterNoop(); + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + _ffiApi.callFlutterNoopWithWrappedError(pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + return; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Object? callFlutterThrowError() { + try { + if (_jniApi != null) { + final JObject? pigeonVar_res = _jniApi.callFlutterThrowError(); + final Object? pigeonVar_dartTypeRes = _PigeonJniCodec.readValue(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSObject? pigeonVar_res = _ffiApi.callFlutterThrowErrorWithWrappedError( + pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Object? pigeonVar_dartTypeRes = _PigeonFfiCodec.readValue(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + void callFlutterThrowErrorFromVoid() { + try { + if (_jniApi != null) { + return _jniApi.callFlutterThrowErrorFromVoid(); + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + _ffiApi.callFlutterThrowErrorFromVoidWithWrappedError(pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + return; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropAllTypes callFlutterEchoNativeInteropAllTypes(NativeInteropAllTypes everything) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAllTypes pigeonVar_res = _jniApi + .callFlutterEchoNativeInteropAllTypes(everything.toJni()); + final NativeInteropAllTypes pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllTypesNativeInterop.fromJni(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropAllTypesBridge? pigeonVar_res = _ffiApi + .callFlutterEchoNativeInteropAllTypesWithEverything( + everything.toFfi(), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final NativeInteropAllTypes pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllTypesNativeInterop.fromFfi(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropAllNullableTypes? callFlutterEchoNativeInteropAllNullableTypes( + NativeInteropAllNullableTypes? everything, + ) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAllNullableTypes? pigeonVar_res = _jniApi + .callFlutterEchoNativeInteropAllNullableTypes(everything?.toJni()); + final NativeInteropAllNullableTypes? pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllNullableTypesNativeInterop.fromJni(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropAllNullableTypesBridge? pigeonVar_res = _ffiApi + .callFlutterEchoNativeInteropAllNullableTypesWithEverything( + everything?.toFfi(), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final NativeInteropAllNullableTypes? pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllNullableTypesNativeInterop.fromFfi(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropSealedClass callFlutterEchoSealedClass(NativeInteropSealedClass sealedClass) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropSealedClass pigeonVar_res = _jniApi + .callFlutterEchoSealedClass(sealedClass.toJni()); + final NativeInteropSealedClass pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropSealedClassNativeInterop.fromJni(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropSealedClassBridge? pigeonVar_res = _ffiApi + .callFlutterEchoSealedClassWithSealedClass( + sealedClass.toFfi(), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final NativeInteropSealedClass pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropSealedClassNativeInterop.fromFfi(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropAllNullableTypes callFlutterSendMultipleNullableTypes( + bool? aNullableBool, + int? aNullableInt, + String? aNullableString, + ) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAllNullableTypes pigeonVar_res = _jniApi + .callFlutterSendMultipleNullableTypes( + _PigeonJniCodec.writeValue(aNullableBool), + _PigeonJniCodec.writeValue(aNullableInt), + _PigeonJniCodec.writeValue(aNullableString), + ); + final NativeInteropAllNullableTypes pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllNullableTypesNativeInterop.fromJni(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropAllNullableTypesBridge? pigeonVar_res = _ffiApi + .callFlutterSendMultipleNullableTypesWithANullableBool( + _PigeonFfiCodec.writeValue(aNullableBool), + aNullableInt: _PigeonFfiCodec.writeValue(aNullableInt), + aNullableString: _PigeonFfiCodec.writeValue(aNullableString), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final NativeInteropAllNullableTypes pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllNullableTypesNativeInterop.fromFfi(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropAllNullableTypesWithoutRecursion? + callFlutterEchoNativeInteropAllNullableTypesWithoutRecursion( + NativeInteropAllNullableTypesWithoutRecursion? everything, + ) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAllNullableTypesWithoutRecursion? pigeonVar_res = _jniApi + .callFlutterEchoNativeInteropAllNullableTypesWithoutRecursion(everything?.toJni()); + final NativeInteropAllNullableTypesWithoutRecursion? pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllNullableTypesWithoutRecursionNativeInterop.fromJni( + pigeonVar_res, + ); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge? pigeonVar_res = + _ffiApi.callFlutterEchoNativeInteropAllNullableTypesWithoutRecursionWithEverything( + everything?.toFfi(), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final NativeInteropAllNullableTypesWithoutRecursion? pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllNullableTypesWithoutRecursionNativeInterop.fromFfi( + pigeonVar_res, + ); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropAllNullableTypesWithoutRecursion + callFlutterSendMultipleNullableTypesWithoutRecursion( + bool? aNullableBool, + int? aNullableInt, + String? aNullableString, + ) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAllNullableTypesWithoutRecursion pigeonVar_res = _jniApi + .callFlutterSendMultipleNullableTypesWithoutRecursion( + _PigeonJniCodec.writeValue(aNullableBool), + _PigeonJniCodec.writeValue(aNullableInt), + _PigeonJniCodec.writeValue(aNullableString), + ); + final NativeInteropAllNullableTypesWithoutRecursion pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllNullableTypesWithoutRecursionNativeInterop.fromJni( + pigeonVar_res, + )!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge? pigeonVar_res = + _ffiApi.callFlutterSendMultipleNullableTypesWithoutRecursionWithANullableBool( + _PigeonFfiCodec.writeValue(aNullableBool), + aNullableInt: _PigeonFfiCodec.writeValue(aNullableInt), + aNullableString: _PigeonFfiCodec.writeValue(aNullableString), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final NativeInteropAllNullableTypesWithoutRecursion pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllNullableTypesWithoutRecursionNativeInterop.fromFfi( + pigeonVar_res, + )!; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + bool callFlutterEchoBool(bool aBool) { + try { + if (_jniApi != null) { + return _jniApi.callFlutterEchoBool(aBool); + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.callFlutterEchoBoolWithABool( + aBool, + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final bool pigeonVar_dartTypeRes = pigeonVar_res!.boolValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + int callFlutterEchoInt(int anInt) { + try { + if (_jniApi != null) { + return _jniApi.callFlutterEchoInt(anInt); + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.callFlutterEchoIntWithAnInt( + anInt, + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final int pigeonVar_dartTypeRes = pigeonVar_res!.longValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + double callFlutterEchoDouble(double aDouble) { + try { + if (_jniApi != null) { + return _jniApi.callFlutterEchoDouble(aDouble); + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.callFlutterEchoDoubleWithADouble( + aDouble, + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final double pigeonVar_dartTypeRes = pigeonVar_res!.doubleValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + String callFlutterEchoString(String aString) { + try { + if (_jniApi != null) { + final JString pigeonVar_res = _jniApi.callFlutterEchoString( + _PigeonJniCodec.writeValue(aString), + ); + final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSString? pigeonVar_res = _ffiApi.callFlutterEchoStringWithAString( + _PigeonFfiCodec.writeValue(aString), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final String pigeonVar_dartTypeRes = pigeonVar_res!.toDartString(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Uint8List callFlutterEchoUint8List(Uint8List list) { + try { + if (_jniApi != null) { + final JByteArray pigeonVar_res = _jniApi.callFlutterEchoUint8List( + _PigeonJniCodec.writeValue(list), + ); + final Uint8List pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res)! as Uint8List; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi + .callFlutterEchoUint8ListWithList( + _PigeonFfiCodec.writeValue(list), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Uint8List pigeonVar_dartTypeRes = + _PigeonFfiCodec.readValue(pigeonVar_res)! as Uint8List; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Int32List callFlutterEchoInt32List(Int32List list) { + try { + if (_jniApi != null) { + final JIntArray pigeonVar_res = _jniApi.callFlutterEchoInt32List( + _PigeonJniCodec.writeValue(list), + ); + final Int32List pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res)! as Int32List; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi + .callFlutterEchoInt32ListWithList( + _PigeonFfiCodec.writeValue(list), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Int32List pigeonVar_dartTypeRes = + _PigeonFfiCodec.readValue(pigeonVar_res)! as Int32List; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Int64List callFlutterEchoInt64List(Int64List list) { + try { + if (_jniApi != null) { + final JLongArray pigeonVar_res = _jniApi.callFlutterEchoInt64List( + _PigeonJniCodec.writeValue(list), + ); + final Int64List pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res)! as Int64List; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi + .callFlutterEchoInt64ListWithList( + _PigeonFfiCodec.writeValue(list), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Int64List pigeonVar_dartTypeRes = + _PigeonFfiCodec.readValue(pigeonVar_res)! as Int64List; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Float64List callFlutterEchoFloat64List(Float64List list) { + try { + if (_jniApi != null) { + final JDoubleArray pigeonVar_res = _jniApi.callFlutterEchoFloat64List( + _PigeonJniCodec.writeValue(list), + ); + final Float64List pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res)! as Float64List; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi + .callFlutterEchoFloat64ListWithList( + _PigeonFfiCodec.writeValue(list), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Float64List pigeonVar_dartTypeRes = + _PigeonFfiCodec.readValue(pigeonVar_res)! as Float64List; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List callFlutterEchoList(List list) { + try { + if (_jniApi != null) { + final JList pigeonVar_res = _jniApi.callFlutterEchoList( + _PigeonJniCodec.writeValue>(list), + ); + final List pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as List).cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.callFlutterEchoListWithList( + _PigeonFfiCodec.writeValue(list), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res)! as List).cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List callFlutterEchoEnumList(List enumList) { + try { + if (_jniApi != null) { + final JList pigeonVar_res = _jniApi + .callFlutterEchoEnumList( + _PigeonJniCodec.writeValue>(enumList), + ); + final List pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as List) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.callFlutterEchoEnumListWithEnumList( + _PigeonFfiCodec.writeValue(enumList), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum)! as List) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List callFlutterEchoClassList( + List classList, + ) { + try { + if (_jniApi != null) { + final JList pigeonVar_res = _jniApi + .callFlutterEchoClassList( + _PigeonJniCodec.writeValue>( + classList, + ), + ); + final List pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as List) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.callFlutterEchoClassListWithClassList( + _PigeonFfiCodec.writeValue(classList), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res)! as List) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List callFlutterEchoNonNullEnumList(List enumList) { + try { + if (_jniApi != null) { + final JList pigeonVar_res = _jniApi + .callFlutterEchoNonNullEnumList( + _PigeonJniCodec.writeValue>(enumList), + ); + final List pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as List) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.callFlutterEchoNonNullEnumListWithEnumList( + _PigeonFfiCodec.writeValue(enumList), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum)! as List) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List callFlutterEchoNonNullClassList( + List classList, + ) { + try { + if (_jniApi != null) { + final JList pigeonVar_res = _jniApi + .callFlutterEchoNonNullClassList( + _PigeonJniCodec.writeValue>( + classList, + ), + ); + final List pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as List) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.callFlutterEchoNonNullClassListWithClassList( + _PigeonFfiCodec.writeValue(classList), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res)! as List) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map callFlutterEchoMap(Map map) { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = _jniApi.callFlutterEchoMap( + _PigeonJniCodec.writeValue>(map), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoMapWithMap( + _PigeonFfiCodec.writeValue(map), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map callFlutterEchoStringMap(Map stringMap) { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = _jniApi.callFlutterEchoStringMap( + _PigeonJniCodec.writeValue>(stringMap), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoStringMapWithStringMap( + _PigeonFfiCodec.writeValue(stringMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map callFlutterEchoIntMap(Map intMap) { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = _jniApi.callFlutterEchoIntMap( + _PigeonJniCodec.writeValue>(intMap), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map).cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoIntMapWithIntMap( + _PigeonFfiCodec.writeValue(intMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, int, int)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map callFlutterEchoEnumMap( + Map enumMap, + ) { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = + _jniApi.callFlutterEchoEnumMap( + _PigeonJniCodec.writeValue< + JMap + >(enumMap), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoEnumMapWithEnumMap( + _PigeonFfiCodec.writeValue(enumMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum, NativeInteropAnEnum)! + as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map callFlutterEchoClassMap( + Map classMap, + ) { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = _jniApi + .callFlutterEchoClassMap( + _PigeonJniCodec.writeValue>( + classMap, + ), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoClassMapWithClassMap( + _PigeonFfiCodec.writeValue(classMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, int)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map callFlutterEchoNonNullStringMap(Map stringMap) { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = _jniApi.callFlutterEchoNonNullStringMap( + _PigeonJniCodec.writeValue>(stringMap), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoNonNullStringMapWithStringMap( + _PigeonFfiCodec.writeValue(stringMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map callFlutterEchoNonNullIntMap(Map intMap) { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = _jniApi.callFlutterEchoNonNullIntMap( + _PigeonJniCodec.writeValue>(intMap), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map).cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoNonNullIntMapWithIntMap( + _PigeonFfiCodec.writeValue(intMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, int, int)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map callFlutterEchoNonNullEnumMap( + Map enumMap, + ) { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = + _jniApi.callFlutterEchoNonNullEnumMap( + _PigeonJniCodec.writeValue< + JMap + >(enumMap), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoNonNullEnumMapWithEnumMap( + _PigeonFfiCodec.writeValue(enumMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum, NativeInteropAnEnum)! + as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map callFlutterEchoNonNullClassMap( + Map classMap, + ) { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = _jniApi + .callFlutterEchoNonNullClassMap( + _PigeonJniCodec.writeValue>( + classMap, + ), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoNonNullClassMapWithClassMap( + _PigeonFfiCodec.writeValue(classMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, int)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropAnEnum callFlutterEchoEnum(NativeInteropAnEnum anEnum) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAnEnum pigeonVar_res = _jniApi.callFlutterEchoEnum( + anEnum.toJni(), + ); + final NativeInteropAnEnum pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAnEnumNativeInterop.fromJni(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.callFlutterEchoEnumWithAnEnum( + ffi_bridge.NativeInteropAnEnum.values[anEnum.index], + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final NativeInteropAnEnum pigeonVar_dartTypeRes = + _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum)! as NativeInteropAnEnum; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropAnotherEnum callFlutterEchoNativeInteropAnotherEnum( + NativeInteropAnotherEnum anotherEnum, + ) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAnotherEnum pigeonVar_res = _jniApi + .callFlutterEchoNativeInteropAnotherEnum(anotherEnum.toJni()); + final NativeInteropAnotherEnum pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAnotherEnumNativeInterop.fromJni(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi + .callFlutterEchoNativeInteropAnotherEnumWithAnotherEnum( + ffi_bridge.NativeInteropAnotherEnum.values[anotherEnum.index], + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final NativeInteropAnotherEnum pigeonVar_dartTypeRes = + _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnotherEnum)! + as NativeInteropAnotherEnum; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + bool? callFlutterEchoNullableBool(bool? aBool) { + try { + if (_jniApi != null) { + final JBoolean? pigeonVar_res = _jniApi.callFlutterEchoNullableBool( + _PigeonJniCodec.writeValue(aBool), + ); + final bool? pigeonVar_dartTypeRes = pigeonVar_res?.toDartBool(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.callFlutterEchoNullableBoolWithABool( + _PigeonFfiCodec.writeValue(aBool), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final bool? pigeonVar_dartTypeRes = pigeonVar_res?.boolValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + int? callFlutterEchoNullableInt(int? anInt) { + try { + if (_jniApi != null) { + final JLong? pigeonVar_res = _jniApi.callFlutterEchoNullableInt( + _PigeonJniCodec.writeValue(anInt), + ); + final int? pigeonVar_dartTypeRes = pigeonVar_res?.toDartInt(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.callFlutterEchoNullableIntWithAnInt( + _PigeonFfiCodec.writeValue(anInt), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final int? pigeonVar_dartTypeRes = pigeonVar_res?.longValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + double? callFlutterEchoNullableDouble(double? aDouble) { + try { + if (_jniApi != null) { + final JDouble? pigeonVar_res = _jniApi.callFlutterEchoNullableDouble( + _PigeonJniCodec.writeValue(aDouble), + ); + final double? pigeonVar_dartTypeRes = pigeonVar_res?.toDartDouble(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.callFlutterEchoNullableDoubleWithADouble( + _PigeonFfiCodec.writeValue(aDouble), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final double? pigeonVar_dartTypeRes = pigeonVar_res?.doubleValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + String? callFlutterEchoNullableString(String? aString) { + try { + if (_jniApi != null) { + final JString? pigeonVar_res = _jniApi.callFlutterEchoNullableString( + _PigeonJniCodec.writeValue(aString), + ); + final String? pigeonVar_dartTypeRes = pigeonVar_res?.toDartString(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSString? pigeonVar_res = _ffiApi.callFlutterEchoNullableStringWithAString( + _PigeonFfiCodec.writeValue(aString), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final String? pigeonVar_dartTypeRes = pigeonVar_res?.toDartString(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Uint8List? callFlutterEchoNullableUint8List(Uint8List? list) { + try { + if (_jniApi != null) { + final JByteArray? pigeonVar_res = _jniApi.callFlutterEchoNullableUint8List( + _PigeonJniCodec.writeValue(list), + ); + final Uint8List? pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res) as Uint8List?; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi + .callFlutterEchoNullableUint8ListWithList( + _PigeonFfiCodec.writeValue(list), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Uint8List? pigeonVar_dartTypeRes = + _PigeonFfiCodec.readValue(pigeonVar_res) as Uint8List?; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Int32List? callFlutterEchoNullableInt32List(Int32List? list) { + try { + if (_jniApi != null) { + final JIntArray? pigeonVar_res = _jniApi.callFlutterEchoNullableInt32List( + _PigeonJniCodec.writeValue(list), + ); + final Int32List? pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res) as Int32List?; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi + .callFlutterEchoNullableInt32ListWithList( + _PigeonFfiCodec.writeValue(list), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Int32List? pigeonVar_dartTypeRes = + _PigeonFfiCodec.readValue(pigeonVar_res) as Int32List?; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Int64List? callFlutterEchoNullableInt64List(Int64List? list) { + try { + if (_jniApi != null) { + final JLongArray? pigeonVar_res = _jniApi.callFlutterEchoNullableInt64List( + _PigeonJniCodec.writeValue(list), + ); + final Int64List? pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res) as Int64List?; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi + .callFlutterEchoNullableInt64ListWithList( + _PigeonFfiCodec.writeValue(list), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Int64List? pigeonVar_dartTypeRes = + _PigeonFfiCodec.readValue(pigeonVar_res) as Int64List?; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Float64List? callFlutterEchoNullableFloat64List(Float64List? list) { + try { + if (_jniApi != null) { + final JDoubleArray? pigeonVar_res = _jniApi.callFlutterEchoNullableFloat64List( + _PigeonJniCodec.writeValue(list), + ); + final Float64List? pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res) as Float64List?; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res = _ffiApi + .callFlutterEchoNullableFloat64ListWithList( + _PigeonFfiCodec.writeValue(list), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Float64List? pigeonVar_dartTypeRes = + _PigeonFfiCodec.readValue(pigeonVar_res) as Float64List?; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List? callFlutterEchoNullableList(List? list) { + try { + if (_jniApi != null) { + final JList? pigeonVar_res = _jniApi.callFlutterEchoNullableList( + _PigeonJniCodec.writeValue?>(list), + ); + final List? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as List?)?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.callFlutterEchoNullableListWithList( + _PigeonFfiCodec.writeValue(list), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res) as List?)?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List? callFlutterEchoNullableEnumList( + List? enumList, + ) { + try { + if (_jniApi != null) { + final JList? pigeonVar_res = _jniApi + .callFlutterEchoNullableEnumList( + _PigeonJniCodec.writeValue?>(enumList), + ); + final List? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as List?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.callFlutterEchoNullableEnumListWithEnumList( + _PigeonFfiCodec.writeValue(enumList), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum) as List?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List? callFlutterEchoNullableClassList( + List? classList, + ) { + try { + if (_jniApi != null) { + final JList? pigeonVar_res = _jniApi + .callFlutterEchoNullableClassList( + _PigeonJniCodec.writeValue?>( + classList, + ), + ); + final List? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as List?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.callFlutterEchoNullableClassListWithClassList( + _PigeonFfiCodec.writeValue(classList), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res) as List?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List? callFlutterEchoNullableNonNullEnumList( + List? enumList, + ) { + try { + if (_jniApi != null) { + final JList? pigeonVar_res = _jniApi + .callFlutterEchoNullableNonNullEnumList( + _PigeonJniCodec.writeValue?>(enumList), + ); + final List? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as List?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.callFlutterEchoNullableNonNullEnumListWithEnumList( + _PigeonFfiCodec.writeValue(enumList), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum) as List?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + List? callFlutterEchoNullableNonNullClassList( + List? classList, + ) { + try { + if (_jniApi != null) { + final JList? pigeonVar_res = _jniApi + .callFlutterEchoNullableNonNullClassList( + _PigeonJniCodec.writeValue?>( + classList, + ), + ); + final List? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as List?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSArray? pigeonVar_res = _ffiApi.callFlutterEchoNullableNonNullClassListWithClassList( + _PigeonFfiCodec.writeValue(classList), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final List? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res) as List?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map? callFlutterEchoNullableMap(Map? map) { + try { + if (_jniApi != null) { + final JMap? pigeonVar_res = _jniApi.callFlutterEchoNullableMap( + _PigeonJniCodec.writeValue?>(map), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoNullableMapWithMap( + _PigeonFfiCodec.writeValue(map), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map? callFlutterEchoNullableStringMap(Map? stringMap) { + try { + if (_jniApi != null) { + final JMap? pigeonVar_res = _jniApi.callFlutterEchoNullableStringMap( + _PigeonJniCodec.writeValue?>(stringMap), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoNullableStringMapWithStringMap( + _PigeonFfiCodec.writeValue(stringMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map? callFlutterEchoNullableIntMap(Map? intMap) { + try { + if (_jniApi != null) { + final JMap? pigeonVar_res = _jniApi.callFlutterEchoNullableIntMap( + _PigeonJniCodec.writeValue?>(intMap), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoNullableIntMapWithIntMap( + _PigeonFfiCodec.writeValue(intMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, int, int) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map? callFlutterEchoNullableEnumMap( + Map? enumMap, + ) { + try { + if (_jniApi != null) { + final JMap? + pigeonVar_res = _jniApi.callFlutterEchoNullableEnumMap( + _PigeonJniCodec.writeValue< + JMap? + >(enumMap), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoNullableEnumMapWithEnumMap( + _PigeonFfiCodec.writeValue(enumMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum, NativeInteropAnEnum) + as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map? callFlutterEchoNullableClassMap( + Map? classMap, + ) { + try { + if (_jniApi != null) { + final JMap? pigeonVar_res = _jniApi + .callFlutterEchoNullableClassMap( + _PigeonJniCodec.writeValue?>( + classMap, + ), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoNullableClassMapWithClassMap( + _PigeonFfiCodec.writeValue(classMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, int) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map? callFlutterEchoNullableNonNullStringMap(Map? stringMap) { + try { + if (_jniApi != null) { + final JMap? pigeonVar_res = _jniApi + .callFlutterEchoNullableNonNullStringMap( + _PigeonJniCodec.writeValue?>(stringMap), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi + .callFlutterEchoNullableNonNullStringMapWithStringMap( + _PigeonFfiCodec.writeValue(stringMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map? callFlutterEchoNullableNonNullIntMap(Map? intMap) { + try { + if (_jniApi != null) { + final JMap? pigeonVar_res = _jniApi.callFlutterEchoNullableNonNullIntMap( + _PigeonJniCodec.writeValue?>(intMap), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?)?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi.callFlutterEchoNullableNonNullIntMapWithIntMap( + _PigeonFfiCodec.writeValue(intMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, int, int) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map? callFlutterEchoNullableNonNullEnumMap( + Map? enumMap, + ) { + try { + if (_jniApi != null) { + final JMap? pigeonVar_res = + _jniApi.callFlutterEchoNullableNonNullEnumMap( + _PigeonJniCodec.writeValue< + JMap? + >(enumMap), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi + .callFlutterEchoNullableNonNullEnumMapWithEnumMap( + _PigeonFfiCodec.writeValue(enumMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum, NativeInteropAnEnum) + as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Map? callFlutterEchoNullableNonNullClassMap( + Map? classMap, + ) { + try { + if (_jniApi != null) { + final JMap? pigeonVar_res = _jniApi + .callFlutterEchoNullableNonNullClassMap( + _PigeonJniCodec.writeValue?>( + classMap, + ), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSDictionary? pigeonVar_res = _ffiApi + .callFlutterEchoNullableNonNullClassMapWithClassMap( + _PigeonFfiCodec.writeValue(classMap), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final Map? pigeonVar_dartTypeRes = + (_PigeonFfiCodec.readValue(pigeonVar_res, int) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropAnEnum? callFlutterEchoNullableEnum(NativeInteropAnEnum? anEnum) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAnEnum? pigeonVar_res = _jniApi.callFlutterEchoNullableEnum( + anEnum?.toJni(), + ); + final NativeInteropAnEnum? pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAnEnumNativeInterop.fromJni(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.callFlutterEchoNullableEnumWithAnEnum( + _PigeonFfiCodec.writeValue(anEnum), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final NativeInteropAnEnum? pigeonVar_dartTypeRes = + _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum) as NativeInteropAnEnum?; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropAnotherEnum? callFlutterEchoAnotherNullableEnum( + NativeInteropAnotherEnum? anotherEnum, + ) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAnotherEnum? pigeonVar_res = _jniApi + .callFlutterEchoAnotherNullableEnum(anotherEnum?.toJni()); + final NativeInteropAnotherEnum? pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAnotherEnumNativeInterop.fromJni(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.callFlutterEchoAnotherNullableEnumWithAnotherEnum( + _PigeonFfiCodec.writeValue(anotherEnum), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final NativeInteropAnotherEnum? pigeonVar_dartTypeRes = + _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnotherEnum) + as NativeInteropAnotherEnum?; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterNoopAsync() async { + try { + if (_jniApi != null) { + await _jniApi.callFlutterNoopAsync(); + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.callFlutterNoopAsyncWithWrappedError( + pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid.listener(() { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterEchoAsyncNativeInteropAllTypes( + NativeInteropAllTypes everything, + ) async { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAllTypes pigeonVar_res = await _jniApi + .callFlutterEchoAsyncNativeInteropAllTypes(everything.toJni()); + final NativeInteropAllTypes pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllTypesNativeInterop.fromJni(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = + Completer(); + _ffiApi.callFlutterEchoAsyncNativeInteropAllTypesWithEverything( + everything.toFfi(), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllTypesBridge.listener(( + ffi_bridge.NativeInteropAllTypesBridge? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonInternalNativeInteropAllTypesNativeInterop.fromFfi(pigeonVar_res)!, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterEchoAsyncNullableNativeInteropAllNullableTypes( + NativeInteropAllNullableTypes? everything, + ) async { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAllNullableTypes? pigeonVar_res = await _jniApi + .callFlutterEchoAsyncNullableNativeInteropAllNullableTypes(everything?.toJni()); + final NativeInteropAllNullableTypes? pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllNullableTypesNativeInterop.fromJni(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = + Completer(); + _ffiApi.callFlutterEchoAsyncNullableNativeInteropAllNullableTypesWithEverything( + everything?.toFfi(), + wrappedError: pigeonVar_error, + completionHandler: + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllNullableTypesBridge.listener(( + ffi_bridge.NativeInteropAllNullableTypesBridge? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonInternalNativeInteropAllNullableTypesNativeInterop.fromFfi( + pigeonVar_res, + ), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future + callFlutterEchoAsyncNullableNativeInteropAllNullableTypesWithoutRecursion( + NativeInteropAllNullableTypesWithoutRecursion? everything, + ) async { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAllNullableTypesWithoutRecursion? pigeonVar_res = + await _jniApi.callFlutterEchoAsyncNullableNativeInteropAllNullableTypesWithoutRecursion( + everything?.toJni(), + ); + final NativeInteropAllNullableTypesWithoutRecursion? pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAllNullableTypesWithoutRecursionNativeInterop.fromJni( + pigeonVar_res, + ); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = + Completer(); + _ffiApi.callFlutterEchoAsyncNullableNativeInteropAllNullableTypesWithoutRecursionWithEverything( + everything?.toFfi(), + wrappedError: pigeonVar_error, + completionHandler: + ffi_bridge + .ObjCBlock_ffiVoid_NativeInteropAllNullableTypesWithoutRecursionBridge.listener(( + ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonInternalNativeInteropAllNullableTypesWithoutRecursionNativeInterop.fromFfi( + pigeonVar_res, + ), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterEchoAsyncBool(bool aBool) async { + try { + if (_jniApi != null) { + final JBoolean pigeonVar_res = await _jniApi.callFlutterEchoAsyncBool(aBool); + final bool pigeonVar_dartTypeRes = pigeonVar_res.toDartBool(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.callFlutterEchoAsyncBoolWithABool( + aBool, + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( + NSNumber? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(pigeonVar_res!.boolValue); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterEchoAsyncInt(int anInt) async { + try { + if (_jniApi != null) { + final JLong pigeonVar_res = await _jniApi.callFlutterEchoAsyncInt(anInt); + final int pigeonVar_dartTypeRes = pigeonVar_res.toDartInt(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.callFlutterEchoAsyncIntWithAnInt( + anInt, + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( + NSNumber? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(pigeonVar_res!.longValue); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterEchoAsyncDouble(double aDouble) async { + try { + if (_jniApi != null) { + final JDouble pigeonVar_res = await _jniApi.callFlutterEchoAsyncDouble(aDouble); + final double pigeonVar_dartTypeRes = pigeonVar_res.toDartDouble(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.callFlutterEchoAsyncDoubleWithADouble( + aDouble, + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( + NSNumber? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(pigeonVar_res!.doubleValue); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterEchoAsyncString(String aString) async { + try { + if (_jniApi != null) { + final JString pigeonVar_res = await _jniApi.callFlutterEchoAsyncString( + _PigeonJniCodec.writeValue(aString), + ); + final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.callFlutterEchoAsyncStringWithAString( + _PigeonFfiCodec.writeValue(aString), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSString.listener(( + NSString? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(pigeonVar_res!.toDartString()); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterEchoAsyncUint8List(Uint8List list) async { + try { + if (_jniApi != null) { + final JByteArray pigeonVar_res = await _jniApi.callFlutterEchoAsyncUint8List( + _PigeonJniCodec.writeValue(list), + ); + final Uint8List pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res)! as Uint8List; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.callFlutterEchoAsyncUint8ListWithList( + _PigeonFfiCodec.writeValue(list), + wrappedError: pigeonVar_error, + completionHandler: + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( + ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonFfiCodec.readValue(pigeonVar_res)! as Uint8List, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterEchoAsyncInt32List(Int32List list) async { + try { + if (_jniApi != null) { + final JIntArray pigeonVar_res = await _jniApi.callFlutterEchoAsyncInt32List( + _PigeonJniCodec.writeValue(list), + ); + final Int32List pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res)! as Int32List; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.callFlutterEchoAsyncInt32ListWithList( + _PigeonFfiCodec.writeValue(list), + wrappedError: pigeonVar_error, + completionHandler: + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( + ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonFfiCodec.readValue(pigeonVar_res)! as Int32List, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterEchoAsyncInt64List(Int64List list) async { + try { + if (_jniApi != null) { + final JLongArray pigeonVar_res = await _jniApi.callFlutterEchoAsyncInt64List( + _PigeonJniCodec.writeValue(list), + ); + final Int64List pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res)! as Int64List; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.callFlutterEchoAsyncInt64ListWithList( + _PigeonFfiCodec.writeValue(list), + wrappedError: pigeonVar_error, + completionHandler: + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( + ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonFfiCodec.readValue(pigeonVar_res)! as Int64List, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterEchoAsyncFloat64List(Float64List list) async { + try { + if (_jniApi != null) { + final JDoubleArray pigeonVar_res = await _jniApi.callFlutterEchoAsyncFloat64List( + _PigeonJniCodec.writeValue(list), + ); + final Float64List pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res)! as Float64List; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.callFlutterEchoAsyncFloat64ListWithList( + _PigeonFfiCodec.writeValue(list), + wrappedError: pigeonVar_error, + completionHandler: + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( + ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonFfiCodec.readValue(pigeonVar_res)! as Float64List, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterEchoAsyncObject(Object anObject) async { + try { + if (_jniApi != null) { + final JObject pigeonVar_res = await _jniApi.callFlutterEchoAsyncObject( + _PigeonJniCodec.writeValue(anObject), + ); + final Object pigeonVar_dartTypeRes = _PigeonJniCodec.readValue(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.callFlutterEchoAsyncObjectWithAnObject( + _PigeonFfiCodec.writeValue(anObject, generic: true), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSObject.listener(( + NSObject? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(_PigeonFfiCodec.readValue(pigeonVar_res)!); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future> callFlutterEchoAsyncList(List list) async { + try { + if (_jniApi != null) { + final JList pigeonVar_res = await _jniApi.callFlutterEchoAsyncList( + _PigeonJniCodec.writeValue>(list), + ); + final List pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as List).cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer> pigeonVar_completer = Completer>(); + _ffiApi.callFlutterEchoAsyncListWithList( + _PigeonFfiCodec.writeValue(list), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( + NSArray? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res)! as List).cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future> callFlutterEchoAsyncEnumList( + List enumList, + ) async { + try { + if (_jniApi != null) { + final JList pigeonVar_res = await _jniApi + .callFlutterEchoAsyncEnumList( + _PigeonJniCodec.writeValue>(enumList), + ); + final List pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as List) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer> pigeonVar_completer = + Completer>(); + _ffiApi.callFlutterEchoAsyncEnumListWithEnumList( + _PigeonFfiCodec.writeValue(enumList), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( + NSArray? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum)! as List) + .cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future> callFlutterEchoAsyncClassList( + List classList, + ) async { + try { + if (_jniApi != null) { + final JList pigeonVar_res = await _jniApi + .callFlutterEchoAsyncClassList( + _PigeonJniCodec.writeValue>( + classList, + ), + ); + final List pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as List) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer> pigeonVar_completer = + Completer>(); + _ffiApi.callFlutterEchoAsyncClassListWithClassList( + _PigeonFfiCodec.writeValue(classList), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( + NSArray? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res)! as List) + .cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future> callFlutterEchoAsyncNonNullEnumList( + List enumList, + ) async { + try { + if (_jniApi != null) { + final JList pigeonVar_res = await _jniApi + .callFlutterEchoAsyncNonNullEnumList( + _PigeonJniCodec.writeValue>(enumList), + ); + final List pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as List) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer> pigeonVar_completer = + Completer>(); + _ffiApi.callFlutterEchoAsyncNonNullEnumListWithEnumList( + _PigeonFfiCodec.writeValue(enumList), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( + NSArray? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum)! as List) + .cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future> callFlutterEchoAsyncNonNullClassList( + List classList, + ) async { + try { + if (_jniApi != null) { + final JList pigeonVar_res = await _jniApi + .callFlutterEchoAsyncNonNullClassList( + _PigeonJniCodec.writeValue>( + classList, + ), + ); + final List pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as List) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer> pigeonVar_completer = + Completer>(); + _ffiApi.callFlutterEchoAsyncNonNullClassListWithClassList( + _PigeonFfiCodec.writeValue(classList), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( + NSArray? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res)! as List) + .cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future> callFlutterEchoAsyncMap(Map map) async { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = await _jniApi.callFlutterEchoAsyncMap( + _PigeonJniCodec.writeValue>(map), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer> pigeonVar_completer = + Completer>(); + _ffiApi.callFlutterEchoAsyncMapWithMap( + _PigeonFfiCodec.writeValue(map), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( + NSDictionary? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res)! as Map) + .cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future> callFlutterEchoAsyncStringMap( + Map stringMap, + ) async { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = await _jniApi.callFlutterEchoAsyncStringMap( + _PigeonJniCodec.writeValue>(stringMap), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer> pigeonVar_completer = + Completer>(); + _ffiApi.callFlutterEchoAsyncStringMapWithStringMap( + _PigeonFfiCodec.writeValue(stringMap), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( + NSDictionary? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res)! as Map) + .cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future> callFlutterEchoAsyncIntMap(Map intMap) async { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = await _jniApi.callFlutterEchoAsyncIntMap( + _PigeonJniCodec.writeValue>(intMap), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map).cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer> pigeonVar_completer = Completer>(); + _ffiApi.callFlutterEchoAsyncIntMapWithIntMap( + _PigeonFfiCodec.writeValue(intMap), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( + NSDictionary? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res, int, int)! as Map) + .cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future> callFlutterEchoAsyncEnumMap( + Map enumMap, + ) async { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = + await _jniApi.callFlutterEchoAsyncEnumMap( + _PigeonJniCodec.writeValue< + JMap + >(enumMap), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer> pigeonVar_completer = + Completer>(); + _ffiApi.callFlutterEchoAsyncEnumMapWithEnumMap( + _PigeonFfiCodec.writeValue(enumMap), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( + NSDictionary? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum, NativeInteropAnEnum)! + as Map) + .cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future> callFlutterEchoAsyncClassMap( + Map classMap, + ) async { + try { + if (_jniApi != null) { + final JMap pigeonVar_res = await _jniApi + .callFlutterEchoAsyncClassMap( + _PigeonJniCodec.writeValue>( + classMap, + ), + ); + final Map pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res)! as Map) + .cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer> pigeonVar_completer = + Completer>(); + _ffiApi.callFlutterEchoAsyncClassMapWithClassMap( + _PigeonFfiCodec.writeValue(classMap), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( + NSDictionary? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res, int)! as Map) + .cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterEchoAsyncEnum(NativeInteropAnEnum anEnum) async { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAnEnum pigeonVar_res = await _jniApi.callFlutterEchoAsyncEnum( + anEnum.toJni(), + ); + final NativeInteropAnEnum pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAnEnumNativeInterop.fromJni(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.callFlutterEchoAsyncEnumWithAnEnum( + ffi_bridge.NativeInteropAnEnum.values[anEnum.index], + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( + NSNumber? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum)! + as NativeInteropAnEnum, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterEchoAnotherAsyncEnum( + NativeInteropAnotherEnum anotherEnum, + ) async { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAnotherEnum pigeonVar_res = await _jniApi + .callFlutterEchoAnotherAsyncEnum(anotherEnum.toJni()); + final NativeInteropAnotherEnum pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAnotherEnumNativeInterop.fromJni(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = + Completer(); + _ffiApi.callFlutterEchoAnotherAsyncEnumWithAnotherEnum( + ffi_bridge.NativeInteropAnotherEnum.values[anotherEnum.index], + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( + NSNumber? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnotherEnum)! + as NativeInteropAnotherEnum, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterEchoAsyncNullableBool(bool? aBool) async { + try { + if (_jniApi != null) { + final JBoolean? pigeonVar_res = await _jniApi.callFlutterEchoAsyncNullableBool( + _PigeonJniCodec.writeValue(aBool), + ); + final bool? pigeonVar_dartTypeRes = pigeonVar_res?.toDartBool(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.callFlutterEchoAsyncNullableBoolWithABool( + _PigeonFfiCodec.writeValue(aBool), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( + NSNumber? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(pigeonVar_res?.boolValue); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterEchoAsyncNullableInt(int? anInt) async { + try { + if (_jniApi != null) { + final JLong? pigeonVar_res = await _jniApi.callFlutterEchoAsyncNullableInt( + _PigeonJniCodec.writeValue(anInt), + ); + final int? pigeonVar_dartTypeRes = pigeonVar_res?.toDartInt(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.callFlutterEchoAsyncNullableIntWithAnInt( + _PigeonFfiCodec.writeValue(anInt), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( + NSNumber? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(pigeonVar_res?.longValue); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterEchoAsyncNullableDouble(double? aDouble) async { + try { + if (_jniApi != null) { + final JDouble? pigeonVar_res = await _jniApi.callFlutterEchoAsyncNullableDouble( + _PigeonJniCodec.writeValue(aDouble), + ); + final double? pigeonVar_dartTypeRes = pigeonVar_res?.toDartDouble(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.callFlutterEchoAsyncNullableDoubleWithADouble( + _PigeonFfiCodec.writeValue(aDouble), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( + NSNumber? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(pigeonVar_res?.doubleValue); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterEchoAsyncNullableString(String? aString) async { + try { + if (_jniApi != null) { + final JString? pigeonVar_res = await _jniApi.callFlutterEchoAsyncNullableString( + _PigeonJniCodec.writeValue(aString), + ); + final String? pigeonVar_dartTypeRes = pigeonVar_res?.toDartString(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.callFlutterEchoAsyncNullableStringWithAString( + _PigeonFfiCodec.writeValue(aString), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSString.listener(( + NSString? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(pigeonVar_res?.toDartString()); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterEchoAsyncNullableUint8List(Uint8List? list) async { + try { + if (_jniApi != null) { + final JByteArray? pigeonVar_res = await _jniApi.callFlutterEchoAsyncNullableUint8List( + _PigeonJniCodec.writeValue(list), + ); + final Uint8List? pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res) as Uint8List?; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.callFlutterEchoAsyncNullableUint8ListWithList( + _PigeonFfiCodec.writeValue(list), + wrappedError: pigeonVar_error, + completionHandler: + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( + ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonFfiCodec.readValue(pigeonVar_res) as Uint8List?, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterEchoAsyncNullableInt32List(Int32List? list) async { + try { + if (_jniApi != null) { + final JIntArray? pigeonVar_res = await _jniApi.callFlutterEchoAsyncNullableInt32List( + _PigeonJniCodec.writeValue(list), + ); + final Int32List? pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res) as Int32List?; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.callFlutterEchoAsyncNullableInt32ListWithList( + _PigeonFfiCodec.writeValue(list), + wrappedError: pigeonVar_error, + completionHandler: + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( + ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonFfiCodec.readValue(pigeonVar_res) as Int32List?, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterEchoAsyncNullableInt64List(Int64List? list) async { + try { + if (_jniApi != null) { + final JLongArray? pigeonVar_res = await _jniApi.callFlutterEchoAsyncNullableInt64List( + _PigeonJniCodec.writeValue(list), + ); + final Int64List? pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res) as Int64List?; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.callFlutterEchoAsyncNullableInt64ListWithList( + _PigeonFfiCodec.writeValue(list), + wrappedError: pigeonVar_error, + completionHandler: + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( + ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonFfiCodec.readValue(pigeonVar_res) as Int64List?, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterEchoAsyncNullableFloat64List(Float64List? list) async { + try { + if (_jniApi != null) { + final JDoubleArray? pigeonVar_res = await _jniApi.callFlutterEchoAsyncNullableFloat64List( + _PigeonJniCodec.writeValue(list), + ); + final Float64List? pigeonVar_dartTypeRes = + _PigeonJniCodec.readValue(pigeonVar_res) as Float64List?; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.callFlutterEchoAsyncNullableFloat64ListWithList( + _PigeonFfiCodec.writeValue(list), + wrappedError: pigeonVar_error, + completionHandler: + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData.listener(( + ffi_bridge.NativeInteropTestsPigeonTypedData? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonFfiCodec.readValue(pigeonVar_res) as Float64List?, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterThrowFlutterErrorAsync() async { + try { + if (_jniApi != null) { + final JObject? pigeonVar_res = await _jniApi.callFlutterThrowFlutterErrorAsync(); + final Object? pigeonVar_dartTypeRes = _PigeonJniCodec.readValue(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.callFlutterThrowFlutterErrorAsyncWithWrappedError( + pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSObject.listener(( + NSObject? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(_PigeonFfiCodec.readValue(pigeonVar_res)); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterEchoAsyncNullableObject(Object? anObject) async { + try { + if (_jniApi != null) { + final JObject? pigeonVar_res = await _jniApi.callFlutterEchoAsyncNullableObject( + _PigeonJniCodec.writeValue(anObject), + ); + final Object? pigeonVar_dartTypeRes = _PigeonJniCodec.readValue(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.callFlutterEchoAsyncNullableObjectWithAnObject( + _PigeonFfiCodec.writeValue(anObject, generic: true), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSObject.listener(( + NSObject? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(_PigeonFfiCodec.readValue(pigeonVar_res)); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future?> callFlutterEchoAsyncNullableList(List? list) async { + try { + if (_jniApi != null) { + final JList? pigeonVar_res = await _jniApi.callFlutterEchoAsyncNullableList( + _PigeonJniCodec.writeValue?>(list), + ); + final List? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as List?)?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer?> pigeonVar_completer = Completer?>(); + _ffiApi.callFlutterEchoAsyncNullableListWithList( + _PigeonFfiCodec.writeValue(list), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( + NSArray? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res) as List?)?.cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future?> callFlutterEchoAsyncNullableEnumList( + List? enumList, + ) async { + try { + if (_jniApi != null) { + final JList? pigeonVar_res = await _jniApi + .callFlutterEchoAsyncNullableEnumList( + _PigeonJniCodec.writeValue?>(enumList), + ); + final List? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as List?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer?> pigeonVar_completer = + Completer?>(); + _ffiApi.callFlutterEchoAsyncNullableEnumListWithEnumList( + _PigeonFfiCodec.writeValue(enumList), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( + NSArray? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum) as List?) + ?.cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future?> callFlutterEchoAsyncNullableClassList( + List? classList, + ) async { + try { + if (_jniApi != null) { + final JList? pigeonVar_res = await _jniApi + .callFlutterEchoAsyncNullableClassList( + _PigeonJniCodec.writeValue?>( + classList, + ), + ); + final List? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as List?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer?> pigeonVar_completer = + Completer?>(); + _ffiApi.callFlutterEchoAsyncNullableClassListWithClassList( + _PigeonFfiCodec.writeValue(classList), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( + NSArray? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res) as List?) + ?.cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future?> callFlutterEchoAsyncNullableNonNullEnumList( + List? enumList, + ) async { + try { + if (_jniApi != null) { + final JList? pigeonVar_res = await _jniApi + .callFlutterEchoAsyncNullableNonNullEnumList( + _PigeonJniCodec.writeValue?>(enumList), + ); + final List? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as List?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer?> pigeonVar_completer = + Completer?>(); + _ffiApi.callFlutterEchoAsyncNullableNonNullEnumListWithEnumList( + _PigeonFfiCodec.writeValue(enumList), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( + NSArray? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum) as List?) + ?.cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future?> callFlutterEchoAsyncNullableNonNullClassList( + List? classList, + ) async { + try { + if (_jniApi != null) { + final JList? pigeonVar_res = await _jniApi + .callFlutterEchoAsyncNullableNonNullClassList( + _PigeonJniCodec.writeValue?>( + classList, + ), + ); + final List? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as List?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer?> pigeonVar_completer = + Completer?>(); + _ffiApi.callFlutterEchoAsyncNullableNonNullClassListWithClassList( + _PigeonFfiCodec.writeValue(classList), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSArray.listener(( + NSArray? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res) as List?) + ?.cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future?> callFlutterEchoAsyncNullableMap(Map? map) async { + try { + if (_jniApi != null) { + final JMap? pigeonVar_res = await _jniApi + .callFlutterEchoAsyncNullableMap( + _PigeonJniCodec.writeValue?>(map), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer?> pigeonVar_completer = + Completer?>(); + _ffiApi.callFlutterEchoAsyncNullableMapWithMap( + _PigeonFfiCodec.writeValue(map), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( + NSDictionary? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res) as Map?) + ?.cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future?> callFlutterEchoAsyncNullableStringMap( + Map? stringMap, + ) async { + try { + if (_jniApi != null) { + final JMap? pigeonVar_res = await _jniApi + .callFlutterEchoAsyncNullableStringMap( + _PigeonJniCodec.writeValue?>(stringMap), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer?> pigeonVar_completer = + Completer?>(); + _ffiApi.callFlutterEchoAsyncNullableStringMapWithStringMap( + _PigeonFfiCodec.writeValue(stringMap), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( + NSDictionary? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res) as Map?) + ?.cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future?> callFlutterEchoAsyncNullableIntMap(Map? intMap) async { + try { + if (_jniApi != null) { + final JMap? pigeonVar_res = await _jniApi + .callFlutterEchoAsyncNullableIntMap( + _PigeonJniCodec.writeValue?>(intMap), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer?> pigeonVar_completer = Completer?>(); + _ffiApi.callFlutterEchoAsyncNullableIntMapWithIntMap( + _PigeonFfiCodec.writeValue(intMap), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( + NSDictionary? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res, int, int) as Map?) + ?.cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future?> callFlutterEchoAsyncNullableEnumMap( + Map? enumMap, + ) async { + try { + if (_jniApi != null) { + final JMap? + pigeonVar_res = await _jniApi.callFlutterEchoAsyncNullableEnumMap( + _PigeonJniCodec.writeValue< + JMap? + >(enumMap), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer?> pigeonVar_completer = + Completer?>(); + _ffiApi.callFlutterEchoAsyncNullableEnumMapWithEnumMap( + _PigeonFfiCodec.writeValue(enumMap), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( + NSDictionary? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum, NativeInteropAnEnum) + as Map?) + ?.cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future?> callFlutterEchoAsyncNullableClassMap( + Map? classMap, + ) async { + try { + if (_jniApi != null) { + final JMap? pigeonVar_res = await _jniApi + .callFlutterEchoAsyncNullableClassMap( + _PigeonJniCodec.writeValue?>( + classMap, + ), + ); + final Map? pigeonVar_dartTypeRes = + (_PigeonJniCodec.readValue(pigeonVar_res) as Map?) + ?.cast(); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer?> pigeonVar_completer = + Completer?>(); + _ffiApi.callFlutterEchoAsyncNullableClassMapWithClassMap( + _PigeonFfiCodec.writeValue(classMap), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSDictionary.listener(( + NSDictionary? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + (_PigeonFfiCodec.readValue(pigeonVar_res, int) as Map?) + ?.cast(), + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterEchoAsyncNullableEnum(NativeInteropAnEnum? anEnum) async { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAnEnum? pigeonVar_res = await _jniApi + .callFlutterEchoAsyncNullableEnum(anEnum?.toJni()); + final NativeInteropAnEnum? pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAnEnumNativeInterop.fromJni(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = + Completer(); + _ffiApi.callFlutterEchoAsyncNullableEnumWithAnEnum( + _PigeonFfiCodec.writeValue(anEnum), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( + NSNumber? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnEnum) + as NativeInteropAnEnum?, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterEchoAnotherAsyncNullableEnum( + NativeInteropAnotherEnum? anotherEnum, + ) async { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropAnotherEnum? pigeonVar_res = await _jniApi + .callFlutterEchoAnotherAsyncNullableEnum(anotherEnum?.toJni()); + final NativeInteropAnotherEnum? pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropAnotherEnumNativeInterop.fromJni(pigeonVar_res); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = + Completer(); + _ffiApi.callFlutterEchoAnotherAsyncNullableEnumWithAnotherEnum( + _PigeonFfiCodec.writeValue(anotherEnum), + wrappedError: pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( + NSNumber? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete( + _PigeonFfiCodec.readValue(pigeonVar_res, NativeInteropAnotherEnum) + as NativeInteropAnotherEnum?, + ); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + bool isMainThread() { + try { + if (_jniApi != null) { + return _jniApi.isMainThread; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.isMainThreadWithWrappedError(pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + final bool pigeonVar_dartTypeRes = pigeonVar_res!.boolValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future asyncIsBackgroundThread() async { + try { + if (_jniApi != null) { + final JBoolean pigeonVar_res = await _jniApi.asyncIsBackgroundThread(); + final bool pigeonVar_dartTypeRes = pigeonVar_res.toDartBool(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.asyncIsBackgroundThreadWithWrappedError( + pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( + NSNumber? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(pigeonVar_res!.boolValue); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + bool isGetter() { + try { + if (_jniApi != null) { + return _jniApi.isGetter; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.isGetterWithWrappedError(pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + final bool pigeonVar_dartTypeRes = pigeonVar_res!.boolValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + int getGetter() { + try { + if (_jniApi != null) { + return _jniApi.getter; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.getGetterWithWrappedError(pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + final int pigeonVar_dartTypeRes = pigeonVar_res!.longValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + void setSetter(int value) { + try { + if (_jniApi != null) { + _jniApi.setter = value; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + _ffiApi.setSetterWithValue(value, wrappedError: pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + return; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future callFlutterNoopOnBackgroundThread() async { + try { + if (_jniApi != null) { + final JBoolean pigeonVar_res = await _jniApi.callFlutterNoopOnBackgroundThread(); + final bool pigeonVar_dartTypeRes = pigeonVar_res.toDartBool(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.callFlutterNoopOnBackgroundThreadWithWrappedError( + pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSNumber.listener(( + NSNumber? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(pigeonVar_res!.boolValue); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + bool testDeregisterHostApi() { + try { + if (_jniApi != null) { + return _jniApi.testDeregisterHostApi(); + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.testDeregisterHostApiWithWrappedError( + pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final bool pigeonVar_dartTypeRes = pigeonVar_res!.boolValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + bool testDeregisterFlutterApi() { + try { + if (_jniApi != null) { + return _jniApi.testDeregisterFlutterApi(); + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.testDeregisterFlutterApiWithWrappedError( + pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final bool pigeonVar_dartTypeRes = pigeonVar_res!.boolValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + void registerAndImmediatelyDeregisterHostApi(String name) { + try { + if (_jniApi != null) { + return _jniApi.registerAndImmediatelyDeregisterHostApi( + _PigeonJniCodec.writeValue(name), + ); + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + _ffiApi.registerAndImmediatelyDeregisterHostApiWithName( + _PigeonFfiCodec.writeValue(name), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + return; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + bool testCallDeregisteredFlutterApi(String name) { + try { + if (_jniApi != null) { + return _jniApi.testCallDeregisteredFlutterApi(_PigeonJniCodec.writeValue(name)); + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.testCallDeregisteredFlutterApiWithName( + _PigeonFfiCodec.writeValue(name), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final bool pigeonVar_dartTypeRes = pigeonVar_res!.boolValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } +} + +final class _NativeInteropFlutterIntegrationCoreApiRegistrar + with jni_bridge.$NativeInteropFlutterIntegrationCoreApi { + _NativeInteropFlutterIntegrationCoreApiRegistrar(this.dartApi); + + final NativeInteropFlutterIntegrationCoreApi dartApi; + + NativeInteropFlutterIntegrationCoreApi register({String name = defaultInstanceName}) { + if (Platform.isAndroid) { + final jni_bridge.NativeInteropFlutterIntegrationCoreApi impl = + jni_bridge.NativeInteropFlutterIntegrationCoreApi.implement(this); + jni_bridge.NativeInteropFlutterIntegrationCoreApiRegistrar().registerInstance( + impl, + name.toJString(), + ); + } + if (Platform.isIOS || Platform.isMacOS) { + final ObjCProtocolBuilder builder = ObjCProtocolBuilder( + debugName: 'NativeInteropFlutterIntegrationCoreApiBridge', + ); + ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.noopWithError_.implement( + builder, + (ffi_bridge.NativeInteropTestsError errorOut) { + try { + dartApi.noop(); + return; + } catch (e) { + _reportFfiError(errorOut, e); + return; + } + }, + ); + ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.throwFlutterErrorWithError_ + .implement(builder, (ffi_bridge.NativeInteropTestsError errorOut) { + try { + final Object? response = dartApi.throwFlutterError(); + return _PigeonFfiCodec.writeValue(response, generic: true); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.throwErrorWithError_ + .implement(builder, (ffi_bridge.NativeInteropTestsError errorOut) { + try { + final Object? response = dartApi.throwError(); + return _PigeonFfiCodec.writeValue(response, generic: true); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.throwErrorFromVoidWithError_ + .implement(builder, (ffi_bridge.NativeInteropTestsError errorOut) { + try { + dartApi.throwErrorFromVoid(); + return; + } catch (e) { + _reportFfiError(errorOut, e); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNativeInteropAllTypesWithEverything_error_ + .implement(builder, ( + ffi_bridge.NativeInteropAllTypesBridge? arg_everything, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final NativeInteropAllTypes response = dartApi.echoNativeInteropAllTypes( + _PigeonInternalNativeInteropAllTypesNativeInterop.fromFfi(arg_everything)!, + ); + return response.toFfi(); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNativeInteropAllNullableTypesWithEverything_error_ + .implement(builder, ( + ffi_bridge.NativeInteropAllNullableTypesBridge? arg_everything, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final NativeInteropAllNullableTypes? response = dartApi + .echoNativeInteropAllNullableTypes( + _PigeonInternalNativeInteropAllNullableTypesNativeInterop.fromFfi( + arg_everything, + ), + ); + return response?.toFfi(); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNativeInteropSealedClassWithSealedClass_error_ + .implement(builder, ( + ffi_bridge.NativeInteropSealedClassBridge? arg_sealedClass, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final NativeInteropSealedClass response = dartApi.echoNativeInteropSealedClass( + _PigeonInternalNativeInteropSealedClassNativeInterop.fromFfi(arg_sealedClass)!, + ); + return response.toFfi(); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .sendMultipleNullableTypesWithANullableBool_aNullableInt_aNullableString_error_ + .implement(builder, ( + NSNumber? arg_aNullableBool, + NSNumber? arg_aNullableInt, + NSString? arg_aNullableString, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final NativeInteropAllNullableTypes response = dartApi.sendMultipleNullableTypes( + arg_aNullableBool?.boolValue, + arg_aNullableInt?.longValue, + arg_aNullableString?.toDartString(), + ); + return response.toFfi(); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNativeInteropAllNullableTypesWithoutRecursionWithEverything_error_ + .implement(builder, ( + ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge? arg_everything, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final NativeInteropAllNullableTypesWithoutRecursion? + response = dartApi.echoNativeInteropAllNullableTypesWithoutRecursion( + _PigeonInternalNativeInteropAllNullableTypesWithoutRecursionNativeInterop.fromFfi( + arg_everything, + ), + ); + return response?.toFfi(); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .sendMultipleNullableTypesWithoutRecursionWithANullableBool_aNullableInt_aNullableString_error_ + .implement(builder, ( + NSNumber? arg_aNullableBool, + NSNumber? arg_aNullableInt, + NSString? arg_aNullableString, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final NativeInteropAllNullableTypesWithoutRecursion response = dartApi + .sendMultipleNullableTypesWithoutRecursion( + arg_aNullableBool?.boolValue, + arg_aNullableInt?.longValue, + arg_aNullableString?.toDartString(), + ); + return response.toFfi(); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoBoolWithABool_error_ + .implement(builder, (NSNumber? arg_aBool, ffi_bridge.NativeInteropTestsError errorOut) { + try { + final bool response = dartApi.echoBool(arg_aBool!.boolValue); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoIntWithAnInt_error_ + .implement(builder, (NSNumber? arg_anInt, ffi_bridge.NativeInteropTestsError errorOut) { + try { + final int response = dartApi.echoInt(arg_anInt!.longValue); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoDoubleWithADouble_error_ + .implement(builder, (NSNumber? arg_aDouble, ffi_bridge.NativeInteropTestsError errorOut) { + try { + final double response = dartApi.echoDouble(arg_aDouble!.doubleValue); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoStringWithAString_error_ + .implement(builder, (NSString? arg_aString, ffi_bridge.NativeInteropTestsError errorOut) { + try { + final String response = dartApi.echoString(arg_aString!.toDartString()); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoUint8ListWithList_error_ + .implement(builder, ( + ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final Uint8List response = dartApi.echoUint8List( + _PigeonFfiCodec.readValue(arg_list)! as Uint8List, + ); + return _PigeonFfiCodec.writeValue( + response, + ); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoInt32ListWithList_error_ + .implement(builder, ( + ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final Int32List response = dartApi.echoInt32List( + _PigeonFfiCodec.readValue(arg_list)! as Int32List, + ); + return _PigeonFfiCodec.writeValue( + response, + ); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoInt64ListWithList_error_ + .implement(builder, ( + ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final Int64List response = dartApi.echoInt64List( + _PigeonFfiCodec.readValue(arg_list)! as Int64List, + ); + return _PigeonFfiCodec.writeValue( + response, + ); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoFloat64ListWithList_error_ + .implement(builder, ( + ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final Float64List response = dartApi.echoFloat64List( + _PigeonFfiCodec.readValue(arg_list)! as Float64List, + ); + return _PigeonFfiCodec.writeValue( + response, + ); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoListWithList_error_ + .implement(builder, (NSArray? arg_list, ffi_bridge.NativeInteropTestsError errorOut) { + try { + final List response = dartApi.echoList( + (_PigeonFfiCodec.readValue(arg_list)! as List).cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoEnumListWithEnumList_error_ + .implement(builder, (NSArray? arg_enumList, ffi_bridge.NativeInteropTestsError errorOut) { + try { + final List response = dartApi.echoEnumList( + (_PigeonFfiCodec.readValue(arg_enumList, NativeInteropAnEnum)! as List) + .cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoClassListWithClassList_error_ + .implement(builder, ( + NSArray? arg_classList, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final List response = dartApi.echoClassList( + (_PigeonFfiCodec.readValue(arg_classList)! as List) + .cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNonNullEnumListWithEnumList_error_ + .implement(builder, (NSArray? arg_enumList, ffi_bridge.NativeInteropTestsError errorOut) { + try { + final List response = dartApi.echoNonNullEnumList( + (_PigeonFfiCodec.readValue(arg_enumList, NativeInteropAnEnum)! as List) + .cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNonNullClassListWithClassList_error_ + .implement(builder, ( + NSArray? arg_classList, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final List response = dartApi.echoNonNullClassList( + (_PigeonFfiCodec.readValue(arg_classList)! as List) + .cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoMapWithMap_error_ + .implement(builder, (NSDictionary? arg_map, ffi_bridge.NativeInteropTestsError errorOut) { + try { + final Map response = dartApi.echoMap( + (_PigeonFfiCodec.readValue(arg_map)! as Map) + .cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoStringMapWithStringMap_error_ + .implement(builder, ( + NSDictionary? arg_stringMap, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final Map response = dartApi.echoStringMap( + (_PigeonFfiCodec.readValue(arg_stringMap)! as Map) + .cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoIntMapWithIntMap_error_ + .implement(builder, ( + NSDictionary? arg_intMap, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final Map response = dartApi.echoIntMap( + (_PigeonFfiCodec.readValue(arg_intMap, int, int)! as Map) + .cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoEnumMapWithEnumMap_error_ + .implement(builder, ( + NSDictionary? arg_enumMap, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final Map response = dartApi.echoEnumMap( + (_PigeonFfiCodec.readValue(arg_enumMap, NativeInteropAnEnum, NativeInteropAnEnum)! + as Map) + .cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoClassMapWithClassMap_error_ + .implement(builder, ( + NSDictionary? arg_classMap, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final Map response = dartApi.echoClassMap( + (_PigeonFfiCodec.readValue(arg_classMap, int)! as Map) + .cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNonNullStringMapWithStringMap_error_ + .implement(builder, ( + NSDictionary? arg_stringMap, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final Map response = dartApi.echoNonNullStringMap( + (_PigeonFfiCodec.readValue(arg_stringMap)! as Map) + .cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNonNullIntMapWithIntMap_error_ + .implement(builder, ( + NSDictionary? arg_intMap, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final Map response = dartApi.echoNonNullIntMap( + (_PigeonFfiCodec.readValue(arg_intMap, int, int)! as Map) + .cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNonNullEnumMapWithEnumMap_error_ + .implement(builder, ( + NSDictionary? arg_enumMap, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final Map response = dartApi + .echoNonNullEnumMap( + (_PigeonFfiCodec.readValue( + arg_enumMap, + NativeInteropAnEnum, + NativeInteropAnEnum, + )! + as Map) + .cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNonNullClassMapWithClassMap_error_ + .implement(builder, ( + NSDictionary? arg_classMap, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final Map response = dartApi.echoNonNullClassMap( + (_PigeonFfiCodec.readValue(arg_classMap, int)! as Map) + .cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoEnumWithAnEnum_error_ + .implement(builder, (NSNumber? arg_anEnum, ffi_bridge.NativeInteropTestsError errorOut) { + try { + final NativeInteropAnEnum response = dartApi.echoEnum( + _PigeonFfiCodec.readValue(arg_anEnum, NativeInteropAnEnum)! as NativeInteropAnEnum, + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNativeInteropAnotherEnumWithAnotherEnum_error_ + .implement(builder, ( + NSNumber? arg_anotherEnum, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final NativeInteropAnotherEnum response = dartApi.echoNativeInteropAnotherEnum( + _PigeonFfiCodec.readValue(arg_anotherEnum, NativeInteropAnotherEnum)! + as NativeInteropAnotherEnum, + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNullableBoolWithABool_error_ + .implement(builder, (NSNumber? arg_aBool, ffi_bridge.NativeInteropTestsError errorOut) { + try { + final bool? response = dartApi.echoNullableBool(arg_aBool?.boolValue); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNullableIntWithAnInt_error_ + .implement(builder, (NSNumber? arg_anInt, ffi_bridge.NativeInteropTestsError errorOut) { + try { + final int? response = dartApi.echoNullableInt(arg_anInt?.longValue); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNullableDoubleWithADouble_error_ + .implement(builder, (NSNumber? arg_aDouble, ffi_bridge.NativeInteropTestsError errorOut) { + try { + final double? response = dartApi.echoNullableDouble(arg_aDouble?.doubleValue); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNullableStringWithAString_error_ + .implement(builder, (NSString? arg_aString, ffi_bridge.NativeInteropTestsError errorOut) { + try { + final String? response = dartApi.echoNullableString(arg_aString?.toDartString()); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNullableUint8ListWithList_error_ + .implement(builder, ( + ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final Uint8List? response = dartApi.echoNullableUint8List( + _PigeonFfiCodec.readValue(arg_list) as Uint8List?, + ); + return _PigeonFfiCodec.writeValue( + response, + ); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNullableInt32ListWithList_error_ + .implement(builder, ( + ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final Int32List? response = dartApi.echoNullableInt32List( + _PigeonFfiCodec.readValue(arg_list) as Int32List?, + ); + return _PigeonFfiCodec.writeValue( + response, + ); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNullableInt64ListWithList_error_ + .implement(builder, ( + ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final Int64List? response = dartApi.echoNullableInt64List( + _PigeonFfiCodec.readValue(arg_list) as Int64List?, + ); + return _PigeonFfiCodec.writeValue( + response, + ); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNullableFloat64ListWithList_error_ + .implement(builder, ( + ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final Float64List? response = dartApi.echoNullableFloat64List( + _PigeonFfiCodec.readValue(arg_list) as Float64List?, + ); + return _PigeonFfiCodec.writeValue( + response, + ); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNullableListWithList_error_ + .implement(builder, (NSArray? arg_list, ffi_bridge.NativeInteropTestsError errorOut) { + try { + final List? response = dartApi.echoNullableList( + (_PigeonFfiCodec.readValue(arg_list) as List?)?.cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNullableEnumListWithEnumList_error_ + .implement(builder, (NSArray? arg_enumList, ffi_bridge.NativeInteropTestsError errorOut) { + try { + final List? response = dartApi.echoNullableEnumList( + (_PigeonFfiCodec.readValue(arg_enumList, NativeInteropAnEnum) as List?) + ?.cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNullableClassListWithClassList_error_ + .implement(builder, ( + NSArray? arg_classList, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final List? response = dartApi.echoNullableClassList( + (_PigeonFfiCodec.readValue(arg_classList) as List?) + ?.cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNullableNonNullEnumListWithEnumList_error_ + .implement(builder, (NSArray? arg_enumList, ffi_bridge.NativeInteropTestsError errorOut) { + try { + final List? response = dartApi.echoNullableNonNullEnumList( + (_PigeonFfiCodec.readValue(arg_enumList, NativeInteropAnEnum) as List?) + ?.cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNullableNonNullClassListWithClassList_error_ + .implement(builder, ( + NSArray? arg_classList, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final List? response = dartApi + .echoNullableNonNullClassList( + (_PigeonFfiCodec.readValue(arg_classList) as List?) + ?.cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.echoNullableMapWithMap_error_ + .implement(builder, (NSDictionary? arg_map, ffi_bridge.NativeInteropTestsError errorOut) { + try { + final Map? response = dartApi.echoNullableMap( + (_PigeonFfiCodec.readValue(arg_map) as Map?) + ?.cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNullableStringMapWithStringMap_error_ + .implement(builder, ( + NSDictionary? arg_stringMap, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final Map? response = dartApi.echoNullableStringMap( + (_PigeonFfiCodec.readValue(arg_stringMap) as Map?) + ?.cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNullableIntMapWithIntMap_error_ + .implement(builder, ( + NSDictionary? arg_intMap, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final Map? response = dartApi.echoNullableIntMap( + (_PigeonFfiCodec.readValue(arg_intMap, int, int) as Map?) + ?.cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNullableEnumMapWithEnumMap_error_ + .implement(builder, ( + NSDictionary? arg_enumMap, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final Map? response = dartApi + .echoNullableEnumMap( + (_PigeonFfiCodec.readValue( + arg_enumMap, + NativeInteropAnEnum, + NativeInteropAnEnum, + ) + as Map?) + ?.cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNullableClassMapWithClassMap_error_ + .implement(builder, ( + NSDictionary? arg_classMap, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final Map? response = dartApi + .echoNullableClassMap( + (_PigeonFfiCodec.readValue(arg_classMap, int) as Map?) + ?.cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNullableNonNullStringMapWithStringMap_error_ + .implement(builder, ( + NSDictionary? arg_stringMap, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final Map? response = dartApi.echoNullableNonNullStringMap( + (_PigeonFfiCodec.readValue(arg_stringMap) as Map?) + ?.cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNullableNonNullIntMapWithIntMap_error_ + .implement(builder, ( + NSDictionary? arg_intMap, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final Map? response = dartApi.echoNullableNonNullIntMap( + (_PigeonFfiCodec.readValue(arg_intMap, int, int) as Map?) + ?.cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNullableNonNullEnumMapWithEnumMap_error_ + .implement(builder, ( + NSDictionary? arg_enumMap, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final Map? response = dartApi + .echoNullableNonNullEnumMap( + (_PigeonFfiCodec.readValue( + arg_enumMap, + NativeInteropAnEnum, + NativeInteropAnEnum, + ) + as Map?) + ?.cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNullableNonNullClassMapWithClassMap_error_ + .implement(builder, ( + NSDictionary? arg_classMap, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final Map? response = dartApi + .echoNullableNonNullClassMap( + (_PigeonFfiCodec.readValue(arg_classMap, int) as Map?) + ?.cast(), + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoNullableEnumWithAnEnum_error_ + .implement(builder, (NSNumber? arg_anEnum, ffi_bridge.NativeInteropTestsError errorOut) { + try { + final NativeInteropAnEnum? response = dartApi.echoNullableEnum( + _PigeonFfiCodec.readValue(arg_anEnum, NativeInteropAnEnum) as NativeInteropAnEnum?, + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAnotherNullableEnumWithAnotherEnum_error_ + .implement(builder, ( + NSNumber? arg_anotherEnum, + ffi_bridge.NativeInteropTestsError errorOut, + ) { + try { + final NativeInteropAnotherEnum? response = dartApi.echoAnotherNullableEnum( + _PigeonFfiCodec.readValue(arg_anotherEnum, NativeInteropAnotherEnum) + as NativeInteropAnotherEnum?, + ); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .noopAsyncWithError_completionHandler_ + .implementAsListener(builder, ( + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi.noopAsync().then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid$CallExtension(completionHandler).call(); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid$CallExtension(completionHandler).call(); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid$CallExtension(completionHandler).call(); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .throwFlutterErrorAsyncWithError_completionHandler_ + .implementAsListener(builder, ( + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi.throwFlutterErrorAsync().then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSObject$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response, generic: true)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSObject$CallExtension(completionHandler).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSObject$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNativeInteropAllTypesWithEverything_error_completionHandler_ + .implementAsListener(builder, ( + ffi_bridge.NativeInteropAllTypesBridge? arg_everything, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncNativeInteropAllTypes( + _PigeonInternalNativeInteropAllTypesNativeInterop.fromFfi(arg_everything)!, + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllTypesBridge$CallExtension( + completionHandler, + ).call(response.toFfi()); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllTypesBridge$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllTypesBridge$CallExtension( + completionHandler, + ).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNullableNativeInteropAllNullableTypesWithEverything_error_completionHandler_ + .implementAsListener(builder, ( + ffi_bridge.NativeInteropAllNullableTypesBridge? arg_everything, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock + completionHandler, + ) { + try { + dartApi + .echoAsyncNullableNativeInteropAllNullableTypes( + _PigeonInternalNativeInteropAllNullableTypesNativeInterop.fromFfi( + arg_everything, + ), + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllNullableTypesBridge$CallExtension( + completionHandler, + ).call(response?.toFfi()); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllNullableTypesBridge$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllNullableTypesBridge$CallExtension( + completionHandler, + ).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNullableNativeInteropAllNullableTypesWithoutRecursionWithEverything_error_completionHandler_ + .implementAsListener(builder, ( + ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge? arg_everything, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock< + Void Function(ffi_bridge.NativeInteropAllNullableTypesWithoutRecursionBridge?) + > + completionHandler, + ) { + try { + dartApi + .echoAsyncNullableNativeInteropAllNullableTypesWithoutRecursion( + _PigeonInternalNativeInteropAllNullableTypesWithoutRecursionNativeInterop.fromFfi( + arg_everything, + ), + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllNullableTypesWithoutRecursionBridge$CallExtension( + completionHandler, + ).call(response?.toFfi()); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllNullableTypesWithoutRecursionBridge$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropAllNullableTypesWithoutRecursionBridge$CallExtension( + completionHandler, + ).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncBoolWithABool_error_completionHandler_ + .implementAsListener(builder, ( + NSNumber? arg_aBool, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncBool(arg_aBool!.boolValue) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncIntWithAnInt_error_completionHandler_ + .implementAsListener(builder, ( + NSNumber? arg_anInt, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncInt(arg_anInt!.longValue) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncDoubleWithADouble_error_completionHandler_ + .implementAsListener(builder, ( + NSNumber? arg_aDouble, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncDouble(arg_aDouble!.doubleValue) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncStringWithAString_error_completionHandler_ + .implementAsListener(builder, ( + NSString? arg_aString, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncString(arg_aString!.toDartString()) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSString$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSString$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSString$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncUint8ListWithList_error_completionHandler_ + .implementAsListener(builder, ( + ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock + completionHandler, + ) { + try { + dartApi + .echoAsyncUint8List(_PigeonFfiCodec.readValue(arg_list)! as Uint8List) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( + completionHandler, + ).call( + _PigeonFfiCodec.writeValue( + response, + ), + ); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( + completionHandler, + ).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncInt32ListWithList_error_completionHandler_ + .implementAsListener(builder, ( + ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock + completionHandler, + ) { + try { + dartApi + .echoAsyncInt32List(_PigeonFfiCodec.readValue(arg_list)! as Int32List) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( + completionHandler, + ).call( + _PigeonFfiCodec.writeValue( + response, + ), + ); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( + completionHandler, + ).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncInt64ListWithList_error_completionHandler_ + .implementAsListener(builder, ( + ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock + completionHandler, + ) { + try { + dartApi + .echoAsyncInt64List(_PigeonFfiCodec.readValue(arg_list)! as Int64List) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( + completionHandler, + ).call( + _PigeonFfiCodec.writeValue( + response, + ), + ); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( + completionHandler, + ).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncFloat64ListWithList_error_completionHandler_ + .implementAsListener(builder, ( + ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock + completionHandler, + ) { + try { + dartApi + .echoAsyncFloat64List(_PigeonFfiCodec.readValue(arg_list)! as Float64List) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( + completionHandler, + ).call( + _PigeonFfiCodec.writeValue( + response, + ), + ); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( + completionHandler, + ).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncObjectWithAnObject_error_completionHandler_ + .implementAsListener(builder, ( + NSObject? arg_anObject, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncObject(_PigeonFfiCodec.readValue(arg_anObject)!) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSObject$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response, generic: true)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSObject$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSObject$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncListWithList_error_completionHandler_ + .implementAsListener(builder, ( + NSArray? arg_list, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncList( + (_PigeonFfiCodec.readValue(arg_list)! as List).cast(), + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncEnumListWithEnumList_error_completionHandler_ + .implementAsListener(builder, ( + NSArray? arg_enumList, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncEnumList( + (_PigeonFfiCodec.readValue(arg_enumList, NativeInteropAnEnum)! as List) + .cast(), + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncClassListWithClassList_error_completionHandler_ + .implementAsListener(builder, ( + NSArray? arg_classList, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncClassList( + (_PigeonFfiCodec.readValue(arg_classList)! as List) + .cast(), + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNonNullEnumListWithEnumList_error_completionHandler_ + .implementAsListener(builder, ( + NSArray? arg_enumList, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncNonNullEnumList( + (_PigeonFfiCodec.readValue(arg_enumList, NativeInteropAnEnum)! as List) + .cast(), + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNonNullClassListWithClassList_error_completionHandler_ + .implementAsListener(builder, ( + NSArray? arg_classList, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncNonNullClassList( + (_PigeonFfiCodec.readValue(arg_classList)! as List) + .cast(), + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncMapWithMap_error_completionHandler_ + .implementAsListener(builder, ( + NSDictionary? arg_map, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncMap( + (_PigeonFfiCodec.readValue(arg_map)! as Map) + .cast(), + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncStringMapWithStringMap_error_completionHandler_ + .implementAsListener(builder, ( + NSDictionary? arg_stringMap, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncStringMap( + (_PigeonFfiCodec.readValue(arg_stringMap)! as Map) + .cast(), + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncIntMapWithIntMap_error_completionHandler_ + .implementAsListener(builder, ( + NSDictionary? arg_intMap, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncIntMap( + (_PigeonFfiCodec.readValue(arg_intMap, int, int)! as Map) + .cast(), + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncEnumMapWithEnumMap_error_completionHandler_ + .implementAsListener(builder, ( + NSDictionary? arg_enumMap, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncEnumMap( + (_PigeonFfiCodec.readValue( + arg_enumMap, + NativeInteropAnEnum, + NativeInteropAnEnum, + )! + as Map) + .cast(), + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncClassMapWithClassMap_error_completionHandler_ + .implementAsListener(builder, ( + NSDictionary? arg_classMap, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncClassMap( + (_PigeonFfiCodec.readValue(arg_classMap, int)! as Map) + .cast(), + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncEnumWithAnEnum_error_completionHandler_ + .implementAsListener(builder, ( + NSNumber? arg_anEnum, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncEnum( + _PigeonFfiCodec.readValue(arg_anEnum, NativeInteropAnEnum)! + as NativeInteropAnEnum, + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAnotherAsyncEnumWithAnotherEnum_error_completionHandler_ + .implementAsListener(builder, ( + NSNumber? arg_anotherEnum, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAnotherAsyncEnum( + _PigeonFfiCodec.readValue(arg_anotherEnum, NativeInteropAnotherEnum)! + as NativeInteropAnotherEnum, + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNullableBoolWithABool_error_completionHandler_ + .implementAsListener(builder, ( + NSNumber? arg_aBool, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncNullableBool(arg_aBool?.boolValue) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNullableIntWithAnInt_error_completionHandler_ + .implementAsListener(builder, ( + NSNumber? arg_anInt, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncNullableInt(arg_anInt?.longValue) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNullableDoubleWithADouble_error_completionHandler_ + .implementAsListener(builder, ( + NSNumber? arg_aDouble, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncNullableDouble(arg_aDouble?.doubleValue) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNullableStringWithAString_error_completionHandler_ + .implementAsListener(builder, ( + NSString? arg_aString, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncNullableString(arg_aString?.toDartString()) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSString$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSString$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSString$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNullableUint8ListWithList_error_completionHandler_ + .implementAsListener(builder, ( + ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock + completionHandler, + ) { + try { + dartApi + .echoAsyncNullableUint8List(_PigeonFfiCodec.readValue(arg_list) as Uint8List?) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( + completionHandler, + ).call( + _PigeonFfiCodec.writeValue( + response, + ), + ); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( + completionHandler, + ).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNullableInt32ListWithList_error_completionHandler_ + .implementAsListener(builder, ( + ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock + completionHandler, + ) { + try { + dartApi + .echoAsyncNullableInt32List(_PigeonFfiCodec.readValue(arg_list) as Int32List?) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( + completionHandler, + ).call( + _PigeonFfiCodec.writeValue( + response, + ), + ); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( + completionHandler, + ).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNullableInt64ListWithList_error_completionHandler_ + .implementAsListener(builder, ( + ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock + completionHandler, + ) { + try { + dartApi + .echoAsyncNullableInt64List(_PigeonFfiCodec.readValue(arg_list) as Int64List?) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( + completionHandler, + ).call( + _PigeonFfiCodec.writeValue( + response, + ), + ); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( + completionHandler, + ).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNullableFloat64ListWithList_error_completionHandler_ + .implementAsListener(builder, ( + ffi_bridge.NativeInteropTestsPigeonTypedData? arg_list, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock + completionHandler, + ) { + try { + dartApi + .echoAsyncNullableFloat64List(_PigeonFfiCodec.readValue(arg_list) as Float64List?) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( + completionHandler, + ).call( + _PigeonFfiCodec.writeValue( + response, + ), + ); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NativeInteropTestsPigeonTypedData$CallExtension( + completionHandler, + ).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNullableObjectWithAnObject_error_completionHandler_ + .implementAsListener(builder, ( + NSObject? arg_anObject, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncNullableObject(_PigeonFfiCodec.readValue(arg_anObject)) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSObject$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response, generic: true)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSObject$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSObject$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNullableListWithList_error_completionHandler_ + .implementAsListener(builder, ( + NSArray? arg_list, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncNullableList( + (_PigeonFfiCodec.readValue(arg_list) as List?)?.cast(), + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNullableEnumListWithEnumList_error_completionHandler_ + .implementAsListener(builder, ( + NSArray? arg_enumList, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncNullableEnumList( + (_PigeonFfiCodec.readValue(arg_enumList, NativeInteropAnEnum) as List?) + ?.cast(), + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNullableClassListWithClassList_error_completionHandler_ + .implementAsListener(builder, ( + NSArray? arg_classList, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncNullableClassList( + (_PigeonFfiCodec.readValue(arg_classList) as List?) + ?.cast(), + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNullableNonNullEnumListWithEnumList_error_completionHandler_ + .implementAsListener(builder, ( + NSArray? arg_enumList, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncNullableNonNullEnumList( + (_PigeonFfiCodec.readValue(arg_enumList, NativeInteropAnEnum) as List?) + ?.cast(), + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNullableNonNullClassListWithClassList_error_completionHandler_ + .implementAsListener(builder, ( + NSArray? arg_classList, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncNullableNonNullClassList( + (_PigeonFfiCodec.readValue(arg_classList) as List?) + ?.cast(), + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSArray$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNullableMapWithMap_error_completionHandler_ + .implementAsListener(builder, ( + NSDictionary? arg_map, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncNullableMap( + (_PigeonFfiCodec.readValue(arg_map) as Map?) + ?.cast(), + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNullableStringMapWithStringMap_error_completionHandler_ + .implementAsListener(builder, ( + NSDictionary? arg_stringMap, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncNullableStringMap( + (_PigeonFfiCodec.readValue(arg_stringMap) as Map?) + ?.cast(), + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNullableIntMapWithIntMap_error_completionHandler_ + .implementAsListener(builder, ( + NSDictionary? arg_intMap, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncNullableIntMap( + (_PigeonFfiCodec.readValue(arg_intMap, int, int) as Map?) + ?.cast(), + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNullableEnumMapWithEnumMap_error_completionHandler_ + .implementAsListener(builder, ( + NSDictionary? arg_enumMap, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncNullableEnumMap( + (_PigeonFfiCodec.readValue( + arg_enumMap, + NativeInteropAnEnum, + NativeInteropAnEnum, + ) + as Map?) + ?.cast(), + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNullableClassMapWithClassMap_error_completionHandler_ + .implementAsListener(builder, ( + NSDictionary? arg_classMap, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncNullableClassMap( + (_PigeonFfiCodec.readValue(arg_classMap, int) as Map?) + ?.cast(), + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSDictionary$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAsyncNullableEnumWithAnEnum_error_completionHandler_ + .implementAsListener(builder, ( + NSNumber? arg_anEnum, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAsyncNullableEnum( + _PigeonFfiCodec.readValue(arg_anEnum, NativeInteropAnEnum) + as NativeInteropAnEnum?, + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); + return; + } + }); + ffi_bridge + .NativeInteropFlutterIntegrationCoreApiBridge$Builder + .echoAnotherAsyncNullableEnumWithAnotherEnum_error_completionHandler_ + .implementAsListener(builder, ( + NSNumber? arg_anotherEnum, + ffi_bridge.NativeInteropTestsError errorOut, + ObjCBlock completionHandler, + ) { + try { + dartApi + .echoAnotherAsyncNullableEnum( + _PigeonFfiCodec.readValue(arg_anotherEnum, NativeInteropAnotherEnum) + as NativeInteropAnotherEnum?, + ) + .then( + (response) { + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( + completionHandler, + ).call(_PigeonFfiCodec.writeValue(response)); + }, + onError: (Object e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension( + completionHandler, + ).call(null); + }, + ); + return; + } catch (e) { + _reportFfiError(errorOut, e); + ffi_bridge.ObjCBlock_ffiVoid_NSNumber$CallExtension(completionHandler).call(null); + return; + } + }); + builder.addProtocol( + ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge$Builder.$protocol, + ); + final ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge impl = + ffi_bridge.NativeInteropFlutterIntegrationCoreApiBridge.as(builder.build()); + ffi_bridge.NativeInteropFlutterIntegrationCoreApiRegistrar.registerInstanceWithApi( + impl, + name: NSString(name), + ); + } + return dartApi; + } + + @override + void noop() { + dartApi.noop(); + return; + } + + @override + JObject? throwFlutterError() { + final Object? response = dartApi.throwFlutterError(); + return _PigeonJniCodec.writeValue(response); + } + + @override + JObject? throwError() { + final Object? response = dartApi.throwError(); + return _PigeonJniCodec.writeValue(response); + } + + @override + void throwErrorFromVoid() { + dartApi.throwErrorFromVoid(); + return; + } + + @override + jni_bridge.NativeInteropAllTypes echoNativeInteropAllTypes( + jni_bridge.NativeInteropAllTypes arg_everything, + ) { + final NativeInteropAllTypes response = dartApi.echoNativeInteropAllTypes( + _PigeonInternalNativeInteropAllTypesNativeInterop.fromJni(arg_everything)!, + ); + return response.toJni(); + } + + @override + jni_bridge.NativeInteropAllNullableTypes? echoNativeInteropAllNullableTypes( + jni_bridge.NativeInteropAllNullableTypes? arg_everything, + ) { + final NativeInteropAllNullableTypes? response = dartApi.echoNativeInteropAllNullableTypes( + _PigeonInternalNativeInteropAllNullableTypesNativeInterop.fromJni(arg_everything), + ); + return response?.toJni(); + } + + @override + jni_bridge.NativeInteropSealedClass echoNativeInteropSealedClass( + jni_bridge.NativeInteropSealedClass arg_sealedClass, + ) { + final NativeInteropSealedClass response = dartApi.echoNativeInteropSealedClass( + _PigeonInternalNativeInteropSealedClassNativeInterop.fromJni(arg_sealedClass)!, + ); + return response.toJni(); + } + + @override + jni_bridge.NativeInteropAllNullableTypes sendMultipleNullableTypes( + JBoolean? arg_aNullableBool, + JLong? arg_aNullableInt, + JString? arg_aNullableString, + ) { + final NativeInteropAllNullableTypes response = dartApi.sendMultipleNullableTypes( + arg_aNullableBool?.toDartBool(releaseOriginal: true), + arg_aNullableInt?.toDartInt(releaseOriginal: true), + arg_aNullableString?.toDartString(releaseOriginal: true), + ); + return response.toJni(); + } + + @override + jni_bridge.NativeInteropAllNullableTypesWithoutRecursion? + echoNativeInteropAllNullableTypesWithoutRecursion( + jni_bridge.NativeInteropAllNullableTypesWithoutRecursion? arg_everything, + ) { + final NativeInteropAllNullableTypesWithoutRecursion? response = dartApi + .echoNativeInteropAllNullableTypesWithoutRecursion( + _PigeonInternalNativeInteropAllNullableTypesWithoutRecursionNativeInterop.fromJni( + arg_everything, + ), + ); + return response?.toJni(); + } + + @override + jni_bridge.NativeInteropAllNullableTypesWithoutRecursion + sendMultipleNullableTypesWithoutRecursion( + JBoolean? arg_aNullableBool, + JLong? arg_aNullableInt, + JString? arg_aNullableString, + ) { + final NativeInteropAllNullableTypesWithoutRecursion response = dartApi + .sendMultipleNullableTypesWithoutRecursion( + arg_aNullableBool?.toDartBool(releaseOriginal: true), + arg_aNullableInt?.toDartInt(releaseOriginal: true), + arg_aNullableString?.toDartString(releaseOriginal: true), + ); + return response.toJni(); + } + + @override + bool echoBool(bool arg_aBool) { + final bool response = dartApi.echoBool(arg_aBool); + return response; + } + + @override + int echoInt(int arg_anInt) { + final int response = dartApi.echoInt(arg_anInt); + return response; + } + + @override + double echoDouble(double arg_aDouble) { + final double response = dartApi.echoDouble(arg_aDouble); + return response; + } + + @override + JString echoString(JString arg_aString) { + final String response = dartApi.echoString(arg_aString.toDartString(releaseOriginal: true)); + return _PigeonJniCodec.writeValue(response); + } + + @override + JByteArray echoUint8List(JByteArray arg_list) { + final Uint8List response = dartApi.echoUint8List( + _PigeonJniCodec.readValue(arg_list)! as Uint8List, + ); + return _PigeonJniCodec.writeValue(response); + } + + @override + JIntArray echoInt32List(JIntArray arg_list) { + final Int32List response = dartApi.echoInt32List( + _PigeonJniCodec.readValue(arg_list)! as Int32List, + ); + return _PigeonJniCodec.writeValue(response); + } + + @override + JLongArray echoInt64List(JLongArray arg_list) { + final Int64List response = dartApi.echoInt64List( + _PigeonJniCodec.readValue(arg_list)! as Int64List, + ); + return _PigeonJniCodec.writeValue(response); + } + + @override + JDoubleArray echoFloat64List(JDoubleArray arg_list) { + final Float64List response = dartApi.echoFloat64List( + _PigeonJniCodec.readValue(arg_list)! as Float64List, + ); + return _PigeonJniCodec.writeValue(response); + } + + @override + JList echoList(JList arg_list) { + final List response = dartApi.echoList( + (_PigeonJniCodec.readValue(arg_list)! as List).cast(), + ); + return _PigeonJniCodec.writeValue>(response); + } + + @override + JList echoEnumList( + JList arg_enumList, + ) { + final List response = dartApi.echoEnumList( + (_PigeonJniCodec.readValue(arg_enumList)! as List).cast(), + ); + return _PigeonJniCodec.writeValue>(response); + } + + @override + JList echoClassList( + JList arg_classList, + ) { + final List response = dartApi.echoClassList( + (_PigeonJniCodec.readValue(arg_classList)! as List) + .cast(), + ); + return _PigeonJniCodec.writeValue>(response); + } + + @override + JList echoNonNullEnumList( + JList arg_enumList, + ) { + final List response = dartApi.echoNonNullEnumList( + (_PigeonJniCodec.readValue(arg_enumList)! as List).cast(), + ); + return _PigeonJniCodec.writeValue>(response); + } + + @override + JList echoNonNullClassList( + JList arg_classList, + ) { + final List response = dartApi.echoNonNullClassList( + (_PigeonJniCodec.readValue(arg_classList)! as List) + .cast(), + ); + return _PigeonJniCodec.writeValue>(response); + } + + @override + JMap echoMap(JMap arg_map) { + final Map response = dartApi.echoMap( + (_PigeonJniCodec.readValue(arg_map)! as Map).cast(), + ); + return _PigeonJniCodec.writeValue>(response); + } + + @override + JMap echoStringMap(JMap arg_stringMap) { + final Map response = dartApi.echoStringMap( + (_PigeonJniCodec.readValue(arg_stringMap)! as Map).cast(), + ); + return _PigeonJniCodec.writeValue>(response); + } + + @override + JMap echoIntMap(JMap arg_intMap) { + final Map response = dartApi.echoIntMap( + (_PigeonJniCodec.readValue(arg_intMap)! as Map).cast(), + ); + return _PigeonJniCodec.writeValue>(response); + } + + @override + JMap echoEnumMap( + JMap arg_enumMap, + ) { + final Map response = dartApi.echoEnumMap( + (_PigeonJniCodec.readValue(arg_enumMap)! as Map) + .cast(), + ); + return _PigeonJniCodec.writeValue< + JMap + >(response); + } + + @override + JMap echoClassMap( + JMap arg_classMap, + ) { + final Map response = dartApi.echoClassMap( + (_PigeonJniCodec.readValue(arg_classMap)! as Map) + .cast(), + ); + return _PigeonJniCodec.writeValue>( + response, + ); + } + + @override + JMap echoNonNullStringMap(JMap arg_stringMap) { + final Map response = dartApi.echoNonNullStringMap( + (_PigeonJniCodec.readValue(arg_stringMap)! as Map).cast(), + ); + return _PigeonJniCodec.writeValue>(response); + } + + @override + JMap echoNonNullIntMap(JMap arg_intMap) { + final Map response = dartApi.echoNonNullIntMap( + (_PigeonJniCodec.readValue(arg_intMap)! as Map).cast(), + ); + return _PigeonJniCodec.writeValue>(response); + } + + @override + JMap echoNonNullEnumMap( + JMap arg_enumMap, + ) { + final Map response = dartApi.echoNonNullEnumMap( + (_PigeonJniCodec.readValue(arg_enumMap)! as Map) + .cast(), + ); + return _PigeonJniCodec.writeValue< + JMap + >(response); + } + + @override + JMap echoNonNullClassMap( + JMap arg_classMap, + ) { + final Map response = dartApi.echoNonNullClassMap( + (_PigeonJniCodec.readValue(arg_classMap)! as Map) + .cast(), + ); + return _PigeonJniCodec.writeValue>( + response, + ); + } + + @override + jni_bridge.NativeInteropAnEnum echoEnum(jni_bridge.NativeInteropAnEnum arg_anEnum) { + final NativeInteropAnEnum response = dartApi.echoEnum( + _PigeonInternalNativeInteropAnEnumNativeInterop.fromJni(arg_anEnum)!, + ); + return response.toJni(); + } + + @override + jni_bridge.NativeInteropAnotherEnum echoNativeInteropAnotherEnum( + jni_bridge.NativeInteropAnotherEnum arg_anotherEnum, + ) { + final NativeInteropAnotherEnum response = dartApi.echoNativeInteropAnotherEnum( + _PigeonInternalNativeInteropAnotherEnumNativeInterop.fromJni(arg_anotherEnum)!, + ); + return response.toJni(); + } + + @override + JBoolean? echoNullableBool(JBoolean? arg_aBool) { + final bool? response = dartApi.echoNullableBool(arg_aBool?.toDartBool(releaseOriginal: true)); + return _PigeonJniCodec.writeValue(response); + } + + @override + JLong? echoNullableInt(JLong? arg_anInt) { + final int? response = dartApi.echoNullableInt(arg_anInt?.toDartInt(releaseOriginal: true)); + return _PigeonJniCodec.writeValue(response); + } + + @override + JDouble? echoNullableDouble(JDouble? arg_aDouble) { + final double? response = dartApi.echoNullableDouble( + arg_aDouble?.toDartDouble(releaseOriginal: true), + ); + return _PigeonJniCodec.writeValue(response); + } + + @override + JString? echoNullableString(JString? arg_aString) { + final String? response = dartApi.echoNullableString( + arg_aString?.toDartString(releaseOriginal: true), + ); + return _PigeonJniCodec.writeValue(response); + } + + @override + JByteArray? echoNullableUint8List(JByteArray? arg_list) { + final Uint8List? response = dartApi.echoNullableUint8List( + _PigeonJniCodec.readValue(arg_list) as Uint8List?, + ); + return _PigeonJniCodec.writeValue(response); + } + + @override + JIntArray? echoNullableInt32List(JIntArray? arg_list) { + final Int32List? response = dartApi.echoNullableInt32List( + _PigeonJniCodec.readValue(arg_list) as Int32List?, + ); + return _PigeonJniCodec.writeValue(response); + } + + @override + JLongArray? echoNullableInt64List(JLongArray? arg_list) { + final Int64List? response = dartApi.echoNullableInt64List( + _PigeonJniCodec.readValue(arg_list) as Int64List?, + ); + return _PigeonJniCodec.writeValue(response); + } + + @override + JDoubleArray? echoNullableFloat64List(JDoubleArray? arg_list) { + final Float64List? response = dartApi.echoNullableFloat64List( + _PigeonJniCodec.readValue(arg_list) as Float64List?, + ); + return _PigeonJniCodec.writeValue(response); + } + + @override + JList? echoNullableList(JList? arg_list) { + final List? response = dartApi.echoNullableList( + (_PigeonJniCodec.readValue(arg_list) as List?)?.cast(), + ); + return _PigeonJniCodec.writeValue?>(response); + } + + @override + JList? echoNullableEnumList( + JList? arg_enumList, + ) { + final List? response = dartApi.echoNullableEnumList( + (_PigeonJniCodec.readValue(arg_enumList) as List?)?.cast(), + ); + return _PigeonJniCodec.writeValue?>(response); + } + + @override + JList? echoNullableClassList( + JList? arg_classList, + ) { + final List? response = dartApi.echoNullableClassList( + (_PigeonJniCodec.readValue(arg_classList) as List?) + ?.cast(), + ); + return _PigeonJniCodec.writeValue?>(response); + } + + @override + JList? echoNullableNonNullEnumList( + JList? arg_enumList, + ) { + final List? response = dartApi.echoNullableNonNullEnumList( + (_PigeonJniCodec.readValue(arg_enumList) as List?)?.cast(), + ); + return _PigeonJniCodec.writeValue?>(response); + } + + @override + JList? echoNullableNonNullClassList( + JList? arg_classList, + ) { + final List? response = dartApi.echoNullableNonNullClassList( + (_PigeonJniCodec.readValue(arg_classList) as List?) + ?.cast(), + ); + return _PigeonJniCodec.writeValue?>(response); + } + + @override + JMap? echoNullableMap(JMap? arg_map) { + final Map? response = dartApi.echoNullableMap( + (_PigeonJniCodec.readValue(arg_map) as Map?)?.cast(), + ); + return _PigeonJniCodec.writeValue?>(response); + } + + @override + JMap? echoNullableStringMap(JMap? arg_stringMap) { + final Map? response = dartApi.echoNullableStringMap( + (_PigeonJniCodec.readValue(arg_stringMap) as Map?) + ?.cast(), + ); + return _PigeonJniCodec.writeValue?>(response); + } + + @override + JMap? echoNullableIntMap(JMap? arg_intMap) { + final Map? response = dartApi.echoNullableIntMap( + (_PigeonJniCodec.readValue(arg_intMap) as Map?)?.cast(), + ); + return _PigeonJniCodec.writeValue?>(response); + } + + @override + JMap? echoNullableEnumMap( + JMap? arg_enumMap, + ) { + final Map? response = dartApi.echoNullableEnumMap( + (_PigeonJniCodec.readValue(arg_enumMap) as Map?) + ?.cast(), + ); + return _PigeonJniCodec.writeValue< + JMap? + >(response); + } + + @override + JMap? echoNullableClassMap( + JMap? arg_classMap, + ) { + final Map? response = dartApi.echoNullableClassMap( + (_PigeonJniCodec.readValue(arg_classMap) as Map?) + ?.cast(), + ); + return _PigeonJniCodec.writeValue?>( + response, + ); + } + + @override + JMap? echoNullableNonNullStringMap(JMap? arg_stringMap) { + final Map? response = dartApi.echoNullableNonNullStringMap( + (_PigeonJniCodec.readValue(arg_stringMap) as Map?)?.cast(), + ); + return _PigeonJniCodec.writeValue?>(response); + } + + @override + JMap? echoNullableNonNullIntMap(JMap? arg_intMap) { + final Map? response = dartApi.echoNullableNonNullIntMap( + (_PigeonJniCodec.readValue(arg_intMap) as Map?)?.cast(), + ); + return _PigeonJniCodec.writeValue?>(response); + } + + @override + JMap? echoNullableNonNullEnumMap( + JMap? arg_enumMap, + ) { + final Map? response = dartApi + .echoNullableNonNullEnumMap( + (_PigeonJniCodec.readValue(arg_enumMap) as Map?) + ?.cast(), + ); + return _PigeonJniCodec.writeValue< + JMap? + >(response); + } + + @override + JMap? echoNullableNonNullClassMap( + JMap? arg_classMap, + ) { + final Map? response = dartApi.echoNullableNonNullClassMap( + (_PigeonJniCodec.readValue(arg_classMap) as Map?) + ?.cast(), + ); + return _PigeonJniCodec.writeValue?>( + response, + ); + } + + @override + jni_bridge.NativeInteropAnEnum? echoNullableEnum(jni_bridge.NativeInteropAnEnum? arg_anEnum) { + final NativeInteropAnEnum? response = dartApi.echoNullableEnum( + _PigeonInternalNativeInteropAnEnumNativeInterop.fromJni(arg_anEnum), + ); + return response?.toJni(); + } + + @override + jni_bridge.NativeInteropAnotherEnum? echoAnotherNullableEnum( + jni_bridge.NativeInteropAnotherEnum? arg_anotherEnum, + ) { + final NativeInteropAnotherEnum? response = dartApi.echoAnotherNullableEnum( + _PigeonInternalNativeInteropAnotherEnumNativeInterop.fromJni(arg_anotherEnum), + ); + return response?.toJni(); + } + + @override + Future noopAsync() { + return dartApi.noopAsync().then((response) { + return _PigeonJniCodec._kotlinUnit; + }); + } + + @override + Future throwFlutterErrorAsync() { + return dartApi.throwFlutterErrorAsync().then((response) { + return _PigeonJniCodec.writeValue(response); + }); + } + + @override + Future echoAsyncNativeInteropAllTypes( + jni_bridge.NativeInteropAllTypes arg_everything, + ) { + return dartApi + .echoAsyncNativeInteropAllTypes( + _PigeonInternalNativeInteropAllTypesNativeInterop.fromJni(arg_everything)!, + ) + .then((response) { + return response.toJni(); + }); + } + + @override + Future echoAsyncNullableNativeInteropAllNullableTypes( + jni_bridge.NativeInteropAllNullableTypes? arg_everything, + ) { + return dartApi + .echoAsyncNullableNativeInteropAllNullableTypes( + _PigeonInternalNativeInteropAllNullableTypesNativeInterop.fromJni(arg_everything), + ) + .then((response) { + return response?.toJni(); + }); + } + + @override + Future + echoAsyncNullableNativeInteropAllNullableTypesWithoutRecursion( + jni_bridge.NativeInteropAllNullableTypesWithoutRecursion? arg_everything, + ) { + return dartApi + .echoAsyncNullableNativeInteropAllNullableTypesWithoutRecursion( + _PigeonInternalNativeInteropAllNullableTypesWithoutRecursionNativeInterop.fromJni( + arg_everything, + ), + ) + .then((response) { + return response?.toJni(); + }); + } + + @override + Future echoAsyncBool(bool arg_aBool) { + return dartApi.echoAsyncBool(arg_aBool).then((response) { + return _PigeonJniCodec.writeValue(response); + }); + } + + @override + Future echoAsyncInt(int arg_anInt) { + return dartApi.echoAsyncInt(arg_anInt).then((response) { + return _PigeonJniCodec.writeValue(response); + }); + } + + @override + Future echoAsyncDouble(double arg_aDouble) { + return dartApi.echoAsyncDouble(arg_aDouble).then((response) { + return _PigeonJniCodec.writeValue(response); + }); + } + + @override + Future echoAsyncString(JString arg_aString) { + return dartApi.echoAsyncString(arg_aString.toDartString(releaseOriginal: true)).then(( + response, + ) { + return _PigeonJniCodec.writeValue(response); + }); + } + + @override + Future echoAsyncUint8List(JByteArray arg_list) { + return dartApi.echoAsyncUint8List(_PigeonJniCodec.readValue(arg_list)! as Uint8List).then(( + response, + ) { + return _PigeonJniCodec.writeValue(response); + }); + } + + @override + Future echoAsyncInt32List(JIntArray arg_list) { + return dartApi.echoAsyncInt32List(_PigeonJniCodec.readValue(arg_list)! as Int32List).then(( + response, + ) { + return _PigeonJniCodec.writeValue(response); + }); + } + + @override + Future echoAsyncInt64List(JLongArray arg_list) { + return dartApi.echoAsyncInt64List(_PigeonJniCodec.readValue(arg_list)! as Int64List).then(( + response, + ) { + return _PigeonJniCodec.writeValue(response); + }); + } + + @override + Future echoAsyncFloat64List(JDoubleArray arg_list) { + return dartApi.echoAsyncFloat64List(_PigeonJniCodec.readValue(arg_list)! as Float64List).then(( + response, + ) { + return _PigeonJniCodec.writeValue(response); + }); + } + + @override + Future echoAsyncObject(JObject arg_anObject) { + return dartApi.echoAsyncObject(_PigeonJniCodec.readValue(arg_anObject)!).then((response) { + return _PigeonJniCodec.writeValue(response); + }); + } + + @override + Future> echoAsyncList(JList arg_list) { + return dartApi + .echoAsyncList((_PigeonJniCodec.readValue(arg_list)! as List).cast()) + .then((response) { + return _PigeonJniCodec.writeValue>(response); + }); + } + + @override + Future> echoAsyncEnumList( + JList arg_enumList, + ) { + return dartApi + .echoAsyncEnumList( + (_PigeonJniCodec.readValue(arg_enumList)! as List).cast(), + ) + .then((response) { + return _PigeonJniCodec.writeValue>(response); + }); + } + + @override + Future> echoAsyncClassList( + JList arg_classList, + ) { + return dartApi + .echoAsyncClassList( + (_PigeonJniCodec.readValue(arg_classList)! as List) + .cast(), + ) + .then((response) { + return _PigeonJniCodec.writeValue>( + response, + ); + }); + } + + @override + Future> echoAsyncNonNullEnumList( + JList arg_enumList, + ) { + return dartApi + .echoAsyncNonNullEnumList( + (_PigeonJniCodec.readValue(arg_enumList)! as List).cast(), + ) + .then((response) { + return _PigeonJniCodec.writeValue>(response); + }); + } + + @override + Future> echoAsyncNonNullClassList( + JList arg_classList, + ) { + return dartApi + .echoAsyncNonNullClassList( + (_PigeonJniCodec.readValue(arg_classList)! as List) + .cast(), + ) + .then((response) { + return _PigeonJniCodec.writeValue>( + response, + ); + }); + } + + @override + Future> echoAsyncMap(JMap arg_map) { + return dartApi + .echoAsyncMap( + (_PigeonJniCodec.readValue(arg_map)! as Map).cast(), + ) + .then((response) { + return _PigeonJniCodec.writeValue>(response); + }); + } + + @override + Future> echoAsyncStringMap(JMap arg_stringMap) { + return dartApi + .echoAsyncStringMap( + (_PigeonJniCodec.readValue(arg_stringMap)! as Map) + .cast(), + ) + .then((response) { + return _PigeonJniCodec.writeValue>(response); + }); + } + + @override + Future> echoAsyncIntMap(JMap arg_intMap) { + return dartApi + .echoAsyncIntMap( + (_PigeonJniCodec.readValue(arg_intMap)! as Map).cast(), + ) + .then((response) { + return _PigeonJniCodec.writeValue>(response); + }); + } + + @override + Future> echoAsyncEnumMap( + JMap arg_enumMap, + ) { + return dartApi + .echoAsyncEnumMap( + (_PigeonJniCodec.readValue(arg_enumMap)! as Map) + .cast(), + ) + .then((response) { + return _PigeonJniCodec.writeValue< + JMap + >(response); + }); + } + + @override + Future> echoAsyncClassMap( + JMap arg_classMap, + ) { + return dartApi + .echoAsyncClassMap( + (_PigeonJniCodec.readValue(arg_classMap)! as Map) + .cast(), + ) + .then((response) { + return _PigeonJniCodec.writeValue< + JMap + >(response); + }); + } + + @override + Future echoAsyncEnum(jni_bridge.NativeInteropAnEnum arg_anEnum) { + return dartApi + .echoAsyncEnum(_PigeonInternalNativeInteropAnEnumNativeInterop.fromJni(arg_anEnum)!) + .then((response) { + return response.toJni(); + }); + } + + @override + Future echoAnotherAsyncEnum( + jni_bridge.NativeInteropAnotherEnum arg_anotherEnum, + ) { + return dartApi + .echoAnotherAsyncEnum( + _PigeonInternalNativeInteropAnotherEnumNativeInterop.fromJni(arg_anotherEnum)!, + ) + .then((response) { + return response.toJni(); + }); + } + + @override + Future echoAsyncNullableBool(JBoolean? arg_aBool) { + return dartApi.echoAsyncNullableBool(arg_aBool?.toDartBool(releaseOriginal: true)).then(( + response, + ) { + return _PigeonJniCodec.writeValue(response); + }); + } + + @override + Future echoAsyncNullableInt(JLong? arg_anInt) { + return dartApi.echoAsyncNullableInt(arg_anInt?.toDartInt(releaseOriginal: true)).then(( + response, + ) { + return _PigeonJniCodec.writeValue(response); + }); + } + + @override + Future echoAsyncNullableDouble(JDouble? arg_aDouble) { + return dartApi.echoAsyncNullableDouble(arg_aDouble?.toDartDouble(releaseOriginal: true)).then(( + response, + ) { + return _PigeonJniCodec.writeValue(response); + }); + } + + @override + Future echoAsyncNullableString(JString? arg_aString) { + return dartApi.echoAsyncNullableString(arg_aString?.toDartString(releaseOriginal: true)).then(( + response, + ) { + return _PigeonJniCodec.writeValue(response); + }); + } + + @override + Future echoAsyncNullableUint8List(JByteArray? arg_list) { + return dartApi + .echoAsyncNullableUint8List(_PigeonJniCodec.readValue(arg_list) as Uint8List?) + .then((response) { + return _PigeonJniCodec.writeValue(response); + }); + } + + @override + Future echoAsyncNullableInt32List(JIntArray? arg_list) { + return dartApi + .echoAsyncNullableInt32List(_PigeonJniCodec.readValue(arg_list) as Int32List?) + .then((response) { + return _PigeonJniCodec.writeValue(response); + }); + } + + @override + Future echoAsyncNullableInt64List(JLongArray? arg_list) { + return dartApi + .echoAsyncNullableInt64List(_PigeonJniCodec.readValue(arg_list) as Int64List?) + .then((response) { + return _PigeonJniCodec.writeValue(response); + }); + } + + @override + Future echoAsyncNullableFloat64List(JDoubleArray? arg_list) { + return dartApi + .echoAsyncNullableFloat64List(_PigeonJniCodec.readValue(arg_list) as Float64List?) + .then((response) { + return _PigeonJniCodec.writeValue(response); + }); + } + + @override + Future echoAsyncNullableObject(JObject? arg_anObject) { + return dartApi.echoAsyncNullableObject(_PigeonJniCodec.readValue(arg_anObject)).then(( + response, + ) { + return _PigeonJniCodec.writeValue(response); + }); + } + + @override + Future?> echoAsyncNullableList(JList? arg_list) { + return dartApi + .echoAsyncNullableList( + (_PigeonJniCodec.readValue(arg_list) as List?)?.cast(), + ) + .then((response) { + return _PigeonJniCodec.writeValue?>(response); + }); + } + + @override + Future?> echoAsyncNullableEnumList( + JList? arg_enumList, + ) { + return dartApi + .echoAsyncNullableEnumList( + (_PigeonJniCodec.readValue(arg_enumList) as List?)?.cast(), + ) + .then((response) { + return _PigeonJniCodec.writeValue?>(response); + }); + } + + @override + Future?> echoAsyncNullableClassList( + JList? arg_classList, + ) { + return dartApi + .echoAsyncNullableClassList( + (_PigeonJniCodec.readValue(arg_classList) as List?) + ?.cast(), + ) + .then((response) { + return _PigeonJniCodec.writeValue?>( + response, + ); + }); + } + + @override + Future?> echoAsyncNullableNonNullEnumList( + JList? arg_enumList, + ) { + return dartApi + .echoAsyncNullableNonNullEnumList( + (_PigeonJniCodec.readValue(arg_enumList) as List?)?.cast(), + ) + .then((response) { + return _PigeonJniCodec.writeValue?>(response); + }); + } + + @override + Future?> echoAsyncNullableNonNullClassList( + JList? arg_classList, + ) { + return dartApi + .echoAsyncNullableNonNullClassList( + (_PigeonJniCodec.readValue(arg_classList) as List?) + ?.cast(), + ) + .then((response) { + return _PigeonJniCodec.writeValue?>( + response, + ); + }); + } + + @override + Future?> echoAsyncNullableMap(JMap? arg_map) { + return dartApi + .echoAsyncNullableMap( + (_PigeonJniCodec.readValue(arg_map) as Map?)?.cast(), + ) + .then((response) { + return _PigeonJniCodec.writeValue?>(response); + }); + } + + @override + Future?> echoAsyncNullableStringMap( + JMap? arg_stringMap, + ) { + return dartApi + .echoAsyncNullableStringMap( + (_PigeonJniCodec.readValue(arg_stringMap) as Map?) + ?.cast(), + ) + .then((response) { + return _PigeonJniCodec.writeValue?>(response); + }); + } + + @override + Future?> echoAsyncNullableIntMap(JMap? arg_intMap) { + return dartApi + .echoAsyncNullableIntMap( + (_PigeonJniCodec.readValue(arg_intMap) as Map?)?.cast(), + ) + .then((response) { + return _PigeonJniCodec.writeValue?>(response); + }); + } + + @override + Future?> + echoAsyncNullableEnumMap( + JMap? arg_enumMap, + ) { + return dartApi + .echoAsyncNullableEnumMap( + (_PigeonJniCodec.readValue(arg_enumMap) as Map?) + ?.cast(), + ) + .then((response) { + return _PigeonJniCodec.writeValue< + JMap? + >(response); + }); + } + + @override + Future?> echoAsyncNullableClassMap( + JMap? arg_classMap, + ) { + return dartApi + .echoAsyncNullableClassMap( + (_PigeonJniCodec.readValue(arg_classMap) as Map?) + ?.cast(), + ) + .then((response) { + return _PigeonJniCodec.writeValue< + JMap? + >(response); + }); + } + + @override + Future echoAsyncNullableEnum( + jni_bridge.NativeInteropAnEnum? arg_anEnum, + ) { + return dartApi + .echoAsyncNullableEnum(_PigeonInternalNativeInteropAnEnumNativeInterop.fromJni(arg_anEnum)) + .then((response) { + return response?.toJni(); + }); + } + + @override + Future echoAnotherAsyncNullableEnum( + jni_bridge.NativeInteropAnotherEnum? arg_anotherEnum, + ) { + return dartApi + .echoAnotherAsyncNullableEnum( + _PigeonInternalNativeInteropAnotherEnumNativeInterop.fromJni(arg_anotherEnum), + ) + .then((response) { + return response?.toJni(); + }); + } +} + +NativeInteropFlutterIntegrationCoreApi pigeon_register_NativeInteropFlutterIntegrationCoreApi( + NativeInteropFlutterIntegrationCoreApi api, { + String name = defaultInstanceName, +}) => _NativeInteropFlutterIntegrationCoreApiRegistrar(api).register(name: name); + +NativeInteropReservedNamesHostApiForNativeInterop? +pigeon_getInstance_NativeInteropReservedNamesHostApi({String channelName = defaultInstanceName}) => + _NativeInteropReservedNamesHostApiForNativeInterop.getInstance(channelName: channelName); + +class _NativeInteropReservedNamesHostApiForNativeInterop + implements NativeInteropReservedNamesHostApiForNativeInterop { + _NativeInteropReservedNamesHostApiForNativeInterop._withRegistrar({ + jni_bridge.NativeInteropReservedNamesHostApiRegistrar? jniApi, + ffi_bridge.NativeInteropReservedNamesHostApiSetup? ffiApi, + }) : _jniApi = jniApi, + _ffiApi = ffiApi; + + /// Returns instance of NativeInteropReservedNamesHostApiForNativeInterop with specified [channelName] if one has been registered. + static NativeInteropReservedNamesHostApiForNativeInterop? getInstance({ + String channelName = defaultInstanceName, + }) { + final NativeInteropReservedNamesHostApiForNativeInterop res; + if (Platform.isAndroid) { + final jni_bridge.NativeInteropReservedNamesHostApiRegistrar? link = + jni_bridge.NativeInteropReservedNamesHostApiRegistrar().getInstance( + channelName.toJString(), + ); + if (link == null) { + _throwNoInstanceError(channelName); + } + res = _NativeInteropReservedNamesHostApiForNativeInterop._withRegistrar(jniApi: link); + } else if (Platform.isIOS || Platform.isMacOS) { + final ffi_bridge.NativeInteropReservedNamesHostApiSetup? link = ffi_bridge + .NativeInteropReservedNamesHostApiSetup.getInstanceWithName(NSString(channelName)); + if (link == null) { + _throwNoInstanceError(channelName); + } + res = _NativeInteropReservedNamesHostApiForNativeInterop._withRegistrar(ffiApi: link); + } else { + throw UnsupportedError( + 'Native Interop is not supported on this platform. Use NativeInteropReservedNamesHostApi instead.', + ); + } + return res; + } + + late final jni_bridge.NativeInteropReservedNamesHostApiRegistrar? _jniApi; + late final ffi_bridge.NativeInteropReservedNamesHostApiSetup? _ffiApi; + + @override + String release(String value) { + try { + if (_jniApi != null) { + final JString pigeonVar_res = _jniApi.release$1(_PigeonJniCodec.writeValue(value)); + final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSString? pigeonVar_res = _ffiApi.releaseWithValue( + _PigeonFfiCodec.writeValue(value), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final String pigeonVar_dartTypeRes = pigeonVar_res!.toDartString(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + int use(int value) { + try { + if (_jniApi != null) { + return _jniApi.use$1(value); + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.useWithValue(value, wrappedError: pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + final int pigeonVar_dartTypeRes = pigeonVar_res!.longValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + String type() { + try { + if (_jniApi != null) { + final JString pigeonVar_res = _jniApi.type$1(); + final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSString? pigeonVar_res = _ffiApi.typeWithWrappedError(pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + final String pigeonVar_dartTypeRes = pigeonVar_res!.toDartString(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + bool isNull() { + try { + if (_jniApi != null) { + return _jniApi.isNull$1; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.isNullWithWrappedError(pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + final bool pigeonVar_dartTypeRes = pigeonVar_res!.boolValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + bool? isNullable() { + try { + if (_jniApi != null) { + final JBoolean? pigeonVar_res = _jniApi.isNullable(); + final bool? pigeonVar_dartTypeRes = pigeonVar_res?.toDartBool(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.isNullableWithWrappedError(pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + final bool? pigeonVar_dartTypeRes = pigeonVar_res?.boolValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + bool isOpen() { + try { + if (_jniApi != null) { + return _jniApi.isOpen; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.isOpenWithWrappedError(pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + final bool pigeonVar_dartTypeRes = pigeonVar_res!.boolValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + String getReference() { + try { + if (_jniApi != null) { + final JString pigeonVar_res = _jniApi.reference$1; + final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSString? pigeonVar_res = _ffiApi.getReferenceWithWrappedError(pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + final String pigeonVar_dartTypeRes = pigeonVar_res!.toDartString(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + void setReference(String value) { + try { + if (_jniApi != null) { + _jniApi.reference$1 = _PigeonJniCodec.writeValue(value); + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + _ffiApi.setReferenceWithValue( + _PigeonFfiCodec.writeValue(value), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + return; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + String getDefault() { + try { + if (_jniApi != null) { + final JString pigeonVar_res = _jniApi.default$; + final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSString? pigeonVar_res = _ffiApi.getDefaultWithWrappedError(pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + final String pigeonVar_dartTypeRes = pigeonVar_res!.toDartString(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + Future getValueAsync() async { + try { + if (_jniApi != null) { + final JString pigeonVar_res = await _jniApi.getValueAsync(); + final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final Completer pigeonVar_completer = Completer(); + _ffiApi.getValueAsyncWithWrappedError( + pigeonVar_error, + completionHandler: ffi_bridge.ObjCBlock_ffiVoid_NSString.listener(( + NSString? pigeonVar_res, + ) { + if (pigeonVar_error.code != null) { + pigeonVar_completer.completeError(_wrapFfiError(pigeonVar_error)); + } else { + pigeonVar_completer.complete(pigeonVar_res!.toDartString()); + } + }), + ); + return await pigeonVar_completer.future; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + NativeInteropReservedNames echoReservedNames(NativeInteropReservedNames names) { + try { + if (_jniApi != null) { + final jni_bridge.NativeInteropReservedNames pigeonVar_res = _jniApi.echoReservedNames( + names.toJni(), + ); + final NativeInteropReservedNames pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropReservedNamesNativeInterop.fromJni(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final ffi_bridge.NativeInteropReservedNamesBridge? pigeonVar_res = _ffiApi + .echoReservedNamesWithNames(names.toFfi(), wrappedError: pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + final NativeInteropReservedNames pigeonVar_dartTypeRes = + _PigeonInternalNativeInteropReservedNamesNativeInterop.fromFfi(pigeonVar_res)!; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + String callFlutterRelease(String value) { + try { + if (_jniApi != null) { + final JString pigeonVar_res = _jniApi.callFlutterRelease( + _PigeonJniCodec.writeValue(value), + ); + final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSString? pigeonVar_res = _ffiApi.callFlutterReleaseWithValue( + _PigeonFfiCodec.writeValue(value), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final String pigeonVar_dartTypeRes = pigeonVar_res!.toDartString(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + String callFlutterType() { + try { + if (_jniApi != null) { + final JString pigeonVar_res = _jniApi.callFlutterType(); + final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSString? pigeonVar_res = _ffiApi.callFlutterTypeWithWrappedError(pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + final String pigeonVar_dartTypeRes = pigeonVar_res!.toDartString(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + String callFlutterImplementIn(String value) { + try { + if (_jniApi != null) { + final JString pigeonVar_res = _jniApi.callFlutterImplementIn( + _PigeonJniCodec.writeValue(value), + ); + final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSString? pigeonVar_res = _ffiApi.callFlutterImplementInValue( + _PigeonFfiCodec.writeValue(value), + wrappedError: pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final String pigeonVar_dartTypeRes = pigeonVar_res!.toDartString(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + bool callFlutterIsNull() { + try { + if (_jniApi != null) { + return _jniApi.callFlutterIsNull(); + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSNumber? pigeonVar_res = _ffiApi.callFlutterIsNullWithWrappedError(pigeonVar_error); + _throwIfFfiError(pigeonVar_error); + final bool pigeonVar_dartTypeRes = pigeonVar_res!.boolValue; + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } + + @override + String callFlutterGetReference() { + try { + if (_jniApi != null) { + final JString pigeonVar_res = _jniApi.callFlutterGetReference(); + final String pigeonVar_dartTypeRes = pigeonVar_res.toDartString(releaseOriginal: true); + return pigeonVar_dartTypeRes; + } else if (_ffiApi != null) { + final pigeonVar_error = ffi_bridge.NativeInteropTestsError(); + final NSString? pigeonVar_res = _ffiApi.callFlutterGetReferenceWithWrappedError( + pigeonVar_error, + ); + _throwIfFfiError(pigeonVar_error); + final String pigeonVar_dartTypeRes = pigeonVar_res!.toDartString(); + return pigeonVar_dartTypeRes; + } else { + throw Exception('No JNI or FFI api available'); + } + } on JThrowable catch (e) { + throw _wrapJniException(e); + } + } +} + +final class _NativeInteropReservedNamesFlutterApiRegistrar + with jni_bridge.$NativeInteropReservedNamesFlutterApi { + _NativeInteropReservedNamesFlutterApiRegistrar(this.dartApi); + + final NativeInteropReservedNamesFlutterApi dartApi; + + NativeInteropReservedNamesFlutterApi register({String name = defaultInstanceName}) { + if (Platform.isAndroid) { + final jni_bridge.NativeInteropReservedNamesFlutterApi impl = + jni_bridge.NativeInteropReservedNamesFlutterApi.implement(this); + jni_bridge.NativeInteropReservedNamesFlutterApiRegistrar().registerInstance( + impl, + name.toJString(), + ); + } + if (Platform.isIOS || Platform.isMacOS) { + final ObjCProtocolBuilder builder = ObjCProtocolBuilder( + debugName: 'NativeInteropReservedNamesFlutterApiBridge', + ); + ffi_bridge.NativeInteropReservedNamesFlutterApiBridge$Builder.releaseWithValue_error_ + .implement(builder, (NSString? arg_value, ffi_bridge.NativeInteropTestsError errorOut) { + try { + final String response = dartApi.release(arg_value!.toDartString()); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge.NativeInteropReservedNamesFlutterApiBridge$Builder.typeWithError_.implement( + builder, + (ffi_bridge.NativeInteropTestsError errorOut) { + try { + final String response = dartApi.type(); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }, + ); + ffi_bridge.NativeInteropReservedNamesFlutterApiBridge$Builder.implementInValue_error_ + .implement(builder, (NSString? arg_value, ffi_bridge.NativeInteropTestsError errorOut) { + try { + final String response = dartApi.implementIn(arg_value!.toDartString()); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + ffi_bridge.NativeInteropReservedNamesFlutterApiBridge$Builder.isNullWithError_.implement( + builder, + (ffi_bridge.NativeInteropTestsError errorOut) { + try { + final bool response = dartApi.isNull(); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }, + ); + ffi_bridge.NativeInteropReservedNamesFlutterApiBridge$Builder.getReferenceWithError_ + .implement(builder, (ffi_bridge.NativeInteropTestsError errorOut) { + try { + final String response = dartApi.getReference(); + return _PigeonFfiCodec.writeValue(response); + } catch (e) { + _reportFfiError(errorOut, e); + return null; + } + }); + builder.addProtocol(ffi_bridge.NativeInteropReservedNamesFlutterApiBridge$Builder.$protocol); + final ffi_bridge.NativeInteropReservedNamesFlutterApiBridge impl = + ffi_bridge.NativeInteropReservedNamesFlutterApiBridge.as(builder.build()); + ffi_bridge.NativeInteropReservedNamesFlutterApiRegistrar.registerInstanceWithApi( + impl, + name: NSString(name), + ); + } + return dartApi; + } + + @override + JString release$1(JString arg_value) { + final String response = dartApi.release(arg_value.toDartString(releaseOriginal: true)); + return _PigeonJniCodec.writeValue(response); + } + + @override + JString type$1() { + final String response = dartApi.type(); + return _PigeonJniCodec.writeValue(response); + } + + @override + JString implementIn$1(JString arg_value) { + final String response = dartApi.implementIn(arg_value.toDartString(releaseOriginal: true)); + return _PigeonJniCodec.writeValue(response); + } + + @override + bool isNull$1() { + final bool response = dartApi.isNull(); + return response; + } + + @override + JString getReference() { + final String response = dartApi.getReference(); + return _PigeonJniCodec.writeValue(response); + } +} + +NativeInteropReservedNamesFlutterApi pigeon_register_NativeInteropReservedNamesFlutterApi( + NativeInteropReservedNamesFlutterApi api, { + String name = defaultInstanceName, +}) => _NativeInteropReservedNamesFlutterApiRegistrar(api).register(name: name); diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/test/native_interop_web_safe_test.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/test/native_interop_web_safe_test.dart new file mode 100644 index 000000000000..aa640858bb29 --- /dev/null +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/test/native_interop_web_safe_test.dart @@ -0,0 +1,56 @@ +// Copyright 2013 The Flutter Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/foundation.dart' show kIsWeb; +import 'package:flutter_test/flutter_test.dart'; +import 'package:shared_test_plugin_code/src/generated/native_interop_tests.gen.dart'; + +class _FakeReservedNamesFlutterApi extends NativeInteropReservedNamesFlutterApi { + @override + String getReference() => 'ref'; + + @override + String implementIn(String value) => value; + + @override + bool isNull() => false; + + @override + String release(String value) => value; + + @override + String type() => 'type'; +} + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + test('native_interop_tests.gen.dart can be imported and used on all platforms including Web', () { + final instance = NativeInteropUnusedClass(); + final Object encoded = instance.encode(); + expect(NativeInteropUnusedClass.decode(encoded), equals(instance)); + expect(NativeInteropAnEnum.values, isNotEmpty); + + NativeInteropReservedNamesFlutterApi.setUp(null); + + if (kIsWeb) { + // On Web, setUp registers binary messenger handlers without invoking native registrars. + NativeInteropReservedNamesFlutterApi.setUp(_FakeReservedNamesFlutterApi()); + NativeInteropReservedNamesFlutterApi.setUp(null); + + expect( + () => NativeInteropReservedNamesHostApi.createWithNativeInteropApi(), + throwsUnsupportedError, + ); + expect( + () => NativeInteropReservedNamesHostApiForNativeInterop.getInstance(), + throwsUnsupportedError, + ); + expect( + () => NativeInteropReservedNamesFlutterApi.implement(_FakeReservedNamesFlutterApi()), + throwsUnsupportedError, + ); + } + }); +} diff --git a/packages/pigeon/pubspec.yaml b/packages/pigeon/pubspec.yaml index 41de72d5b931..fc4aa8a8a1ac 100644 --- a/packages/pigeon/pubspec.yaml +++ b/packages/pigeon/pubspec.yaml @@ -2,7 +2,7 @@ name: pigeon description: Code generator tool to make communication between Flutter and the host platform type-safe and easier. repository: https://github.com/flutter/packages/tree/main/packages/pigeon issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+pigeon%22 -version: 29.0.12 # This must match the version in lib/src/generator_tools.dart +version: 29.0.13 # This must match the version in lib/src/generator_tools.dart environment: sdk: ^3.11.0 diff --git a/packages/pigeon/skills/native-interop-migration/SKILL.md b/packages/pigeon/skills/native-interop-migration/SKILL.md index 17cf14dc9c97..594dd6d775a5 100644 --- a/packages/pigeon/skills/native-interop-migration/SKILL.md +++ b/packages/pigeon/skills/native-interop-migration/SKILL.md @@ -4,7 +4,7 @@ This skill guides AI agents and developers through migrating an existing Flutter plugin package (containing Swift for iOS/macOS and/or Kotlin for Android) from platform-channel-based Pigeon code to direct **Native Interop** (`useFfi: true` for Swift, `useJni: true` for Kotlin). > [!IMPORTANT] -> **Golden Rule for Generated Code**: Generated code files (`.g.dart`, `.g.swift`, `.g.kt`, `.g.jni.dart`, `.g.ffi.dart`) should be produced automatically by Pigeon, FFIgen, or JNIgen without manual edits. If you encounter a code generation error or bug that prevents compilation and cannot be resolved through configuration options: +> **Golden Rule for Generated Code**: Generated code files (`.g.dart`, `.native_interop.g.dart`, `.g.swift`, `.g.kt`, `.g.jni.dart`, `.g.ffi.dart`) should be produced automatically by Pigeon, FFIgen, or JNIgen without manual edits. If you encounter a code generation error or bug that prevents compilation and cannot be resolved through configuration options: > 1. File a detailed bug report describing the generator issue. > 2. **Do not modify generated files without explicit user permission**. You may ask the user if they want you to temporarily alter the generated code to unblock testing, but you must inform them that re-running code generation will overwrite these manual edits. diff --git a/packages/pigeon/test/dart_generator_test.dart b/packages/pigeon/test/dart_generator_test.dart index 46bbd54f57d8..3d4595b33787 100644 --- a/packages/pigeon/test/dart_generator_test.dart +++ b/packages/pigeon/test/dart_generator_test.dart @@ -2086,22 +2086,30 @@ name: foobar classes: [], enums: [], ); + const options = InternalDartOptions( + ignoreLints: false, + useFfi: true, + useJni: true, + dartOut: 'lib/foo.dart', + ); final sink = StringBuffer(); const generator = DartGenerator(); - generator.generate( - const InternalDartOptions( - ignoreLints: false, - useFfi: true, - useJni: true, - dartOut: 'lib/foo.dart', - ), - root, - sink, - dartPackageName: DEFAULT_PACKAGE_NAME, - ); + generator.generate(options, root, sink, dartPackageName: DEFAULT_PACKAGE_NAME); final code = sink.toString(); expect(code, contains('Native Interop is not supported on this platform. Use Api instead.')); + + final nativeInteropSink = StringBuffer(); + generator.generateNativeInterop( + options, + root, + nativeInteropSink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + expect( + nativeInteropSink.toString(), + contains('Native Interop is not supported on this platform. Use Api instead.'), + ); }); test('native interop host api unsupported error - createWithNativeInteropApi', () { @@ -2206,7 +2214,7 @@ name: foobar ); final sink = StringBuffer(); const generator = DartGenerator(); - generator.generate( + generator.generateNativeInterop( const InternalDartOptions(ignoreLints: false, useJni: true, dartOut: 'lib/foo.dart'), root, sink, @@ -2254,7 +2262,7 @@ name: foobar ); final sink = StringBuffer(); const generator = DartGenerator(); - generator.generate( + generator.generateNativeInterop( const InternalDartOptions(ignoreLints: false, useJni: true, dartOut: 'lib/foo.dart'), root, sink, @@ -2270,7 +2278,7 @@ name: foobar test('native interop converts sealed classes through their subclasses', () { final sink = StringBuffer(); const generator = DartGenerator(); - generator.generate( + generator.generateNativeInterop( const InternalDartOptions( ignoreLints: false, useJni: true, @@ -2283,27 +2291,44 @@ name: foobar ); final code = sink.toString(); - expect(code, contains('jni_bridge.Shape toJni();')); + expect(code, contains('jni_bridge.Shape toJni() {')); + expect(code, contains('final Circle child => child.toJni(),')); expect(code, contains('static Shape? fromJni(jni_bridge.Shape? jniClass) {')); expect(code, contains('if (jniClass.isA(jni_bridge.Circle.type)) {')); - expect(code, contains('return Circle.fromJni(jniClass.as(jni_bridge.Circle.type));')); - expect(code, contains('ffi_bridge.ShapeBridge toFfi();')); + expect( + code, + contains( + 'return _PigeonInternalCircleNativeInterop.fromJni(jniClass.as(jni_bridge.Circle.type));', + ), + ); + expect(code, contains('ffi_bridge.ShapeBridge toFfi() {')); + expect(code, contains('final Circle child => child.toFfi(),')); expect(code, contains('static Shape? fromFfi(ffi_bridge.ShapeBridge? ffiClass) {')); expect(code, contains('if (ffi_bridge.CircleBridge.isA(ffiClass)) {')); - expect(code, contains('return Circle.fromFfi(ffi_bridge.CircleBridge.as(ffiClass));')); - expect(code, contains(RegExp(r'@override\s+jni_bridge\.Circle toJni\(\)'))); - expect(code, contains(RegExp(r'@override\s+ffi_bridge\.CircleBridge toFfi\(\)'))); + expect( + code, + contains( + 'return _PigeonInternalCircleNativeInterop.fromFfi(ffi_bridge.CircleBridge.as(ffiClass));', + ), + ); + expect(code, contains('jni_bridge.Circle toJni() {')); + expect(code, contains('ffi_bridge.CircleBridge toFfi() {')); expect( code, contains('final jni_bridge.Shape pigeonVar_res = _jniApi.echoShape(shape.toJni());'), ); - expect(code, contains('final Shape pigeonVar_dartTypeRes = Shape.fromJni(pigeonVar_res)!;')); + expect( + code, + contains( + 'final Shape pigeonVar_dartTypeRes = _PigeonInternalShapeNativeInterop.fromJni(pigeonVar_res)!;', + ), + ); }); test('native interop codecs have no branch for sealed classes', () { final sink = StringBuffer(); const generator = DartGenerator(); - generator.generate( + generator.generateNativeInterop( const InternalDartOptions( ignoreLints: false, useJni: true, @@ -2332,7 +2357,7 @@ name: foobar ); final sink = StringBuffer(); const generator = DartGenerator(); - generator.generate( + generator.generateNativeInterop( const InternalDartOptions(ignoreLints: false, useFfi: true, dartOut: 'lib/foo.dart'), root, sink, @@ -2417,7 +2442,7 @@ name: foobar ); final sink = StringBuffer(); const generator = DartGenerator(); - generator.generate( + generator.generateNativeInterop( const InternalDartOptions(ignoreLints: false, useJni: true, dartOut: 'lib/foo.dart'), root, sink, @@ -2492,7 +2517,7 @@ name: foobar ); final sink = StringBuffer(); const generator = DartGenerator(); - generator.generate( + generator.generateNativeInterop( const InternalDartOptions( ignoreLints: false, useFfi: true, @@ -2631,7 +2656,7 @@ name: foobar ); final sink = StringBuffer(); const generator = DartGenerator(); - generator.generate( + generator.generateNativeInterop( const InternalDartOptions( ignoreLints: false, useFfi: true, @@ -2722,7 +2747,7 @@ name: foobar ); final sink = StringBuffer(); const generator = DartGenerator(); - generator.generate( + generator.generateNativeInterop( const InternalDartOptions( ignoreLints: false, useFfi: true, @@ -2744,6 +2769,163 @@ name: foobar expect(code, contains('.goToAsyncWithError_completionHandler_')); expect(code, contains('DataBridge.alloc().initForKey(')); }); + + test( + 'main dart output with native interop is web-safe and conditionally imports native interop file', + () { + expect(getNativeInteropDartPath('lib/src/foo.g.dart'), 'lib/src/foo.native_interop.g.dart'); + expect( + getNativeInteropDartPath('lib/src/foo.gen.dart'), + 'lib/src/foo.native_interop.gen.dart', + ); + expect(getNativeInteropDartPath('lib/src/foo.dart'), 'lib/src/foo.native_interop.dart'); + + const string = TypeDeclaration(baseName: 'String', isNullable: false); + final root = Root( + apis: [ + AstHostApi( + name: 'Api', + methods: [ + Method( + name: 'echo', + location: ApiLocation.host, + parameters: [Parameter(name: 'value', type: string)], + returnType: string, + ), + ], + ), + AstFlutterApi( + name: 'Callbacks', + methods: [ + Method( + name: 'onEvent', + location: ApiLocation.flutter, + parameters: [Parameter(name: 'value', type: string)], + returnType: const TypeDeclaration.voidDeclaration(), + ), + ], + ), + ], + classes: [ + Class( + name: 'Data', + fields: [NamedType(name: 'value', type: string)], + ), + ], + enums: [ + Enum( + name: 'MyEnum', + members: [EnumMember(name: 'one')], + ), + ], + ); + const options = InternalDartOptions( + ignoreLints: false, + useFfi: true, + useJni: true, + ffiErrorClassName: 'PigeonError', + jniErrorClassName: 'PigeonError', + dartOut: 'lib/foo.g.dart', + ); + final sink = StringBuffer(); + const generator = DartGenerator(); + generator.generate(options, root, sink, dartPackageName: DEFAULT_PACKAGE_NAME); + final code = sink.toString(); + + expect(code, isNot(contains("import 'dart:ffi'"))); + expect(code, isNot(contains("import 'dart:io'"))); + expect(code, isNot(contains("import 'package:ffi/ffi.dart'"))); + expect(code, isNot(contains("import 'package:jni/jni.dart'"))); + expect(code, isNot(contains("import 'package:objective_c/objective_c.dart'"))); + expect(code, isNot(contains('ffi_bridge'))); + expect(code, isNot(contains('jni_bridge'))); + expect(code, isNot(contains('toJni'))); + expect(code, isNot(contains('toFfi'))); + expect( + code, + contains( + "import './foo.g.dart'\n" + " if (dart.library.ffi) './foo.native_interop.g.dart'\n" + ' as pigeon_native;', + ), + ); + expect(code, contains("import 'package:flutter/foundation.dart' show kIsWeb;")); + expect(code, contains('if (!kIsWeb) {')); + expect(code, contains('if (!kIsWeb && api != null) {')); + expect( + code, + contains( + "import 'package:meta/meta.dart' show immutable, internal, protected, visibleForTesting;", + ), + ); + expect(code, contains('@internal\nApiForNativeInterop? pigeon_getInstance_Api({')); + expect(code, contains('pigeon_native.pigeon_getInstance_Api(channelName: channelName)')); + expect(code, contains('@internal\nCallbacks pigeon_register_Callbacks(')); + expect(code, contains('final class CallbacksRegistrar')); + expect(code, contains('pigeon_native.pigeon_register_Callbacks(api, name: name)')); + + final nativeInteropSink = StringBuffer(); + generator.generateNativeInterop( + options, + root, + nativeInteropSink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final nativeInteropCode = nativeInteropSink.toString(); + expect(nativeInteropCode, contains("import './foo.g.dart';")); + expect(nativeInteropCode, contains('extension _PigeonInternalDataNativeInterop on Data')); + expect(nativeInteropCode, contains('extension _PigeonInternalMyEnumNativeInterop on MyEnum')); + expect( + nativeInteropCode, + contains('class _ApiForNativeInterop implements ApiForNativeInterop'), + ); + expect(nativeInteropCode, contains('final class _CallbacksRegistrar')); + expect(nativeInteropCode, contains('_CallbacksRegistrar(this.dartApi);')); + expect(nativeInteropCode, contains('final Callbacks dartApi;')); + expect(nativeInteropCode, isNot(contains('if (dartApi != null)'))); + + // Verify single-platform import isolation in generateNativeInterop. + final jniOnlySink = StringBuffer(); + generator.generateNativeInterop( + const InternalDartOptions( + ignoreLints: false, + useJni: true, + jniErrorClassName: 'PigeonError', + dartOut: 'lib/foo.g.dart', + ), + root, + jniOnlySink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final jniOnlyCode = jniOnlySink.toString(); + expect(jniOnlyCode, contains("import 'package:jni/jni.dart';")); + expect(jniOnlyCode, contains("import './foo.g.jni.dart' as jni_bridge;")); + expect(jniOnlyCode, isNot(contains("import 'dart:ffi';"))); + expect(jniOnlyCode, isNot(contains("import 'package:ffi/ffi.dart';"))); + expect(jniOnlyCode, isNot(contains("import 'package:objective_c/objective_c.dart';"))); + expect(jniOnlyCode, isNot(contains('ffi_bridge'))); + + final ffiOnlySink = StringBuffer(); + generator.generateNativeInterop( + const InternalDartOptions( + ignoreLints: false, + useFfi: true, + ffiErrorClassName: 'PigeonError', + dartOut: 'lib/foo.g.dart', + ), + root, + ffiOnlySink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final ffiOnlyCode = ffiOnlySink.toString(); + expect(ffiOnlyCode, contains("import 'dart:ffi';")); + expect(ffiOnlyCode, contains("import 'package:ffi/ffi.dart';")); + expect(ffiOnlyCode, contains("import 'package:objective_c/objective_c.dart';")); + expect(ffiOnlyCode, contains("import './foo.g.ffi.dart' as ffi_bridge;")); + expect(ffiOnlyCode, isNot(contains("import 'package:jni/jni.dart';"))); + expect(ffiOnlyCode, isNot(contains('jni_bridge'))); + }, + ); } /// Builds a root with a sealed class `Shape`, its subclasses `Circle` (one diff --git a/packages/pigeon/test/pigeon_lib_test.dart b/packages/pigeon/test/pigeon_lib_test.dart index a6bfa97e9392..a6b591fd356f 100644 --- a/packages/pigeon/test/pigeon_lib_test.dart +++ b/packages/pigeon/test/pigeon_lib_test.dart @@ -3274,4 +3274,66 @@ const String myConst = 'hello ${1 + 2}'; expect(configPath, equals('example/tool/pigeon/messages_ffigen_config.dart')); }); }); + + test( + 'DartGeneratorAdapter writes .native_interop.g.dart companion file when native interop is enabled', + () { + final Directory dir = Directory.systemTemp.createTempSync(); + try { + final String dartOutPath = path.join(dir.path, 'messages.g.dart'); + final String nativeInteropPath = path.join(dir.path, 'messages.native_interop.g.dart'); + final InternalPigeonOptions options = InternalPigeonOptions.fromPigeonOptions( + PigeonOptions( + dartOut: dartOutPath, + swiftOut: path.join(dir.path, 'Messages.swift'), + swiftOptions: const SwiftOptions(useFfi: true), + dartPackageName: 'test_package', + ), + ); + const adapter = DartGeneratorAdapter(); + final sink = StringBuffer(); + adapter.generate( + sink, + options, + Root(apis: [], classes: [], enums: []), + FileType.na, + ); + + expect( + sink.toString(), + contains( + "import './messages.g.dart'\n" + " if (dart.library.ffi) './messages.native_interop.g.dart'\n" + ' as pigeon_native;', + ), + ); + final companionFile = File(nativeInteropPath); + expect(companionFile.existsSync(), isTrue); + expect(companionFile.readAsStringSync(), contains('class _PigeonFfiCodec')); + + // Verify validate rejects 'stdout' and empty dartOut when native interop is enabled. + final emptyRoot = Root(apis: [], classes: [], enums: []); + expect( + adapter.validate( + InternalPigeonOptions.fromPigeonOptions( + const PigeonOptions(dartOut: 'stdout', swiftOptions: SwiftOptions(useFfi: true)), + ), + emptyRoot, + ), + isNotEmpty, + ); + expect( + adapter.validate( + InternalPigeonOptions.fromPigeonOptions( + const PigeonOptions(dartOut: '', swiftOptions: SwiftOptions(useFfi: true)), + ), + emptyRoot, + ), + isNotEmpty, + ); + } finally { + dir.deleteSync(recursive: true); + } + }, + ); }