setUp static method

void setUp(
  1. OnSnapshotStyleListener? api, {
  2. BinaryMessenger? binaryMessenger,
  3. String messageChannelSuffix = '',
})

Implementation

static void setUp(
  OnSnapshotStyleListener? api, {
  BinaryMessenger? binaryMessenger,
  String messageChannelSuffix = '',
}) {
  messageChannelSuffix =
      messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
  {
    final BasicMessageChannel<
        Object?> pigeonVar_channel = BasicMessageChannel<
            Object?>(
        'dev.flutter.pigeon.mapbox_maps_flutter.OnSnapshotStyleListener.onDidFinishLoadingStyle$messageChannelSuffix',
        pigeonChannelCodec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      pigeonVar_channel.setMessageHandler(null);
    } else {
      pigeonVar_channel.setMessageHandler((Object? message) async {
        try {
          api.onDidFinishLoadingStyle();
          return wrapResponse(empty: true);
        } on PlatformException catch (e) {
          return wrapResponse(error: e);
        } catch (e) {
          return wrapResponse(
              error: PlatformException(code: 'error', message: e.toString()));
        }
      });
    }
  }
  {
    final BasicMessageChannel<
        Object?> pigeonVar_channel = BasicMessageChannel<
            Object?>(
        'dev.flutter.pigeon.mapbox_maps_flutter.OnSnapshotStyleListener.onDidFullyLoadStyle$messageChannelSuffix',
        pigeonChannelCodec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      pigeonVar_channel.setMessageHandler(null);
    } else {
      pigeonVar_channel.setMessageHandler((Object? message) async {
        try {
          api.onDidFullyLoadStyle();
          return wrapResponse(empty: true);
        } on PlatformException catch (e) {
          return wrapResponse(error: e);
        } catch (e) {
          return wrapResponse(
              error: PlatformException(code: 'error', message: e.toString()));
        }
      });
    }
  }
  {
    final BasicMessageChannel<
        Object?> pigeonVar_channel = BasicMessageChannel<
            Object?>(
        'dev.flutter.pigeon.mapbox_maps_flutter.OnSnapshotStyleListener.onDidFailLoadingStyle$messageChannelSuffix',
        pigeonChannelCodec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      pigeonVar_channel.setMessageHandler(null);
    } else {
      pigeonVar_channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.mapbox_maps_flutter.OnSnapshotStyleListener.onDidFailLoadingStyle was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final String? arg_message = (args[0] as String?);
        assert(arg_message != null,
            'Argument for dev.flutter.pigeon.mapbox_maps_flutter.OnSnapshotStyleListener.onDidFailLoadingStyle was null, expected non-null String.');
        try {
          api.onDidFailLoadingStyle(arg_message!);
          return wrapResponse(empty: true);
        } on PlatformException catch (e) {
          return wrapResponse(error: e);
        } catch (e) {
          return wrapResponse(
              error: PlatformException(code: 'error', message: e.toString()));
        }
      });
    }
  }
  {
    final BasicMessageChannel<
        Object?> pigeonVar_channel = BasicMessageChannel<
            Object?>(
        'dev.flutter.pigeon.mapbox_maps_flutter.OnSnapshotStyleListener.onStyleImageMissing$messageChannelSuffix',
        pigeonChannelCodec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      pigeonVar_channel.setMessageHandler(null);
    } else {
      pigeonVar_channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.mapbox_maps_flutter.OnSnapshotStyleListener.onStyleImageMissing was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final String? arg_imageId = (args[0] as String?);
        assert(arg_imageId != null,
            'Argument for dev.flutter.pigeon.mapbox_maps_flutter.OnSnapshotStyleListener.onStyleImageMissing was null, expected non-null String.');
        try {
          api.onStyleImageMissing(arg_imageId!);
          return wrapResponse(empty: true);
        } on PlatformException catch (e) {
          return wrapResponse(error: e);
        } catch (e) {
          return wrapResponse(
              error: PlatformException(code: 'error', message: e.toString()));
        }
      });
    }
  }
}