pigeon_setUpMessageHandlers static method
void
pigeon_setUpMessageHandlers({
- bool pigeon_clearHandlers = false,
- BinaryMessenger? pigeon_binaryMessenger,
- PigeonInstanceManager? pigeon_instanceManager,
- GeographicBounds pigeon_newInstance()?,
Implementation
static void pigeon_setUpMessageHandlers({
bool pigeon_clearHandlers = false,
BinaryMessenger? pigeon_binaryMessenger,
PigeonInstanceManager? pigeon_instanceManager,
GeographicBounds Function(
double lowerLeftLatitude,
double lowerLeftLongitude,
double upperRightLatitude,
double upperRightLongitude,
)? pigeon_newInstance,
}) {
final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec =
_PigeonInternalProxyApiBaseCodec(
pigeon_instanceManager ?? PigeonInstanceManager.instance);
final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger;
{
final BasicMessageChannel<
Object?> pigeonVar_channel = BasicMessageChannel<
Object?>(
'dev.flutter.pigeon.geocoding_android.GeographicBounds.pigeon_newInstance',
pigeonChannelCodec,
binaryMessenger: binaryMessenger);
if (pigeon_clearHandlers) {
pigeonVar_channel.setMessageHandler(null);
} else {
pigeonVar_channel.setMessageHandler((Object? message) async {
assert(message != null,
'Argument for dev.flutter.pigeon.geocoding_android.GeographicBounds.pigeon_newInstance was null.');
final List<Object?> args = (message as List<Object?>?)!;
final int? arg_pigeon_instanceIdentifier = (args[0] as int?);
assert(arg_pigeon_instanceIdentifier != null,
'Argument for dev.flutter.pigeon.geocoding_android.GeographicBounds.pigeon_newInstance was null, expected non-null int.');
final double? arg_lowerLeftLatitude = (args[1] as double?);
assert(arg_lowerLeftLatitude != null,
'Argument for dev.flutter.pigeon.geocoding_android.GeographicBounds.pigeon_newInstance was null, expected non-null double.');
final double? arg_lowerLeftLongitude = (args[2] as double?);
assert(arg_lowerLeftLongitude != null,
'Argument for dev.flutter.pigeon.geocoding_android.GeographicBounds.pigeon_newInstance was null, expected non-null double.');
final double? arg_upperRightLatitude = (args[3] as double?);
assert(arg_upperRightLatitude != null,
'Argument for dev.flutter.pigeon.geocoding_android.GeographicBounds.pigeon_newInstance was null, expected non-null double.');
final double? arg_upperRightLongitude = (args[4] as double?);
assert(arg_upperRightLongitude != null,
'Argument for dev.flutter.pigeon.geocoding_android.GeographicBounds.pigeon_newInstance was null, expected non-null double.');
try {
(pigeon_instanceManager ?? PigeonInstanceManager.instance)
.addHostCreatedInstance(
pigeon_newInstance?.call(
arg_lowerLeftLatitude!,
arg_lowerLeftLongitude!,
arg_upperRightLatitude!,
arg_upperRightLongitude!) ??
GeographicBounds.pigeon_detached(
pigeon_binaryMessenger: pigeon_binaryMessenger,
pigeon_instanceManager: pigeon_instanceManager,
lowerLeftLatitude: arg_lowerLeftLatitude!,
lowerLeftLongitude: arg_lowerLeftLongitude!,
upperRightLatitude: arg_upperRightLatitude!,
upperRightLongitude: arg_upperRightLongitude!,
),
arg_pigeon_instanceIdentifier!,
);
return wrapResponse(empty: true);
} on PlatformException catch (e) {
return wrapResponse(error: e);
} catch (e) {
return wrapResponse(
error: PlatformException(code: 'error', message: e.toString()));
}
});
}
}
}