setup static method

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

Implementation

static void setup(NERtcLiveStreamEventSink? api,
    {BinaryMessenger? binaryMessenger}) {
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcLiveStreamEventSink.onUpdateLiveStreamTask',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcLiveStreamEventSink.onUpdateLiveStreamTask was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final String? arg_taskId = (args[0] as String?);
        assert(arg_taskId != null,
            'Argument for dev.flutter.pigeon.NERtcLiveStreamEventSink.onUpdateLiveStreamTask was null, expected non-null String.');
        final int? arg_errCode = (args[1] as int?);
        assert(arg_errCode != null,
            'Argument for dev.flutter.pigeon.NERtcLiveStreamEventSink.onUpdateLiveStreamTask was null, expected non-null int.');
        api.onUpdateLiveStreamTask(arg_taskId!, arg_errCode!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcLiveStreamEventSink.onAddLiveStreamTask',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcLiveStreamEventSink.onAddLiveStreamTask was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final String? arg_taskId = (args[0] as String?);
        assert(arg_taskId != null,
            'Argument for dev.flutter.pigeon.NERtcLiveStreamEventSink.onAddLiveStreamTask was null, expected non-null String.');
        final int? arg_errCode = (args[1] as int?);
        assert(arg_errCode != null,
            'Argument for dev.flutter.pigeon.NERtcLiveStreamEventSink.onAddLiveStreamTask was null, expected non-null int.');
        api.onAddLiveStreamTask(arg_taskId!, arg_errCode!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcLiveStreamEventSink.onDeleteLiveStreamTask',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcLiveStreamEventSink.onDeleteLiveStreamTask was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final String? arg_taskId = (args[0] as String?);
        assert(arg_taskId != null,
            'Argument for dev.flutter.pigeon.NERtcLiveStreamEventSink.onDeleteLiveStreamTask was null, expected non-null String.');
        final int? arg_errCode = (args[1] as int?);
        assert(arg_errCode != null,
            'Argument for dev.flutter.pigeon.NERtcLiveStreamEventSink.onDeleteLiveStreamTask was null, expected non-null int.');
        api.onDeleteLiveStreamTask(arg_taskId!, arg_errCode!);
        return;
      });
    }
  }
}