setup static method

void setup(
  1. OnCircleAnnotationClickListener? api, {
  2. BinaryMessenger? binaryMessenger,
})

Implementation

static void setup(OnCircleAnnotationClickListener? api,
    {BinaryMessenger? binaryMessenger}) {
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.mapbox_maps_flutter.OnCircleAnnotationClickListener.onCircleAnnotationClick',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.mapbox_maps_flutter.OnCircleAnnotationClickListener.onCircleAnnotationClick was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final CircleAnnotation? arg_annotation =
            (args[0] as CircleAnnotation?);
        assert(arg_annotation != null,
            'Argument for dev.flutter.pigeon.mapbox_maps_flutter.OnCircleAnnotationClickListener.onCircleAnnotationClick was null, expected non-null CircleAnnotation.');
        api.onCircleAnnotationClick(arg_annotation!);
        return;
      });
    }
  }
}