setup static method

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

Implementation

static void setup(NERtcAudioEffectEventSink? api,
    {BinaryMessenger? binaryMessenger}) {
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcAudioEffectEventSink.onAudioEffectFinished',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcAudioEffectEventSink.onAudioEffectFinished was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_effectId = (args[0] as int?);
        assert(arg_effectId != null,
            'Argument for dev.flutter.pigeon.NERtcAudioEffectEventSink.onAudioEffectFinished was null, expected non-null int.');
        api.onAudioEffectFinished(arg_effectId!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcAudioEffectEventSink.onAudioEffectTimestampUpdate',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcAudioEffectEventSink.onAudioEffectTimestampUpdate was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_id = (args[0] as int?);
        assert(arg_id != null,
            'Argument for dev.flutter.pigeon.NERtcAudioEffectEventSink.onAudioEffectTimestampUpdate was null, expected non-null int.');
        final int? arg_timestampMs = (args[1] as int?);
        assert(arg_timestampMs != null,
            'Argument for dev.flutter.pigeon.NERtcAudioEffectEventSink.onAudioEffectTimestampUpdate was null, expected non-null int.');
        api.onAudioEffectTimestampUpdate(arg_id!, arg_timestampMs!);
        return;
      });
    }
  }
}