setup static method

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

Implementation

static void setup(NERtcChannelEventSink? api,
    {BinaryMessenger? binaryMessenger}) {
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onJoinChannel', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onJoinChannel was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_result = (args[0] as int?);
        assert(arg_result != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onJoinChannel was null, expected non-null int.');
        final int? arg_channelId = (args[1] as int?);
        assert(arg_channelId != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onJoinChannel was null, expected non-null int.');
        final int? arg_elapsed = (args[2] as int?);
        assert(arg_elapsed != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onJoinChannel was null, expected non-null int.');
        final int? arg_uid = (args[3] as int?);
        assert(arg_uid != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onJoinChannel was null, expected non-null int.');
        api.onJoinChannel(
            arg_result!, arg_channelId!, arg_elapsed!, arg_uid!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onLeaveChannel', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onLeaveChannel was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_result = (args[0] as int?);
        assert(arg_result != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onLeaveChannel was null, expected non-null int.');
        api.onLeaveChannel(arg_result!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onUserJoined', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserJoined was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final UserJoinedEvent? arg_event = (args[0] as UserJoinedEvent?);
        assert(arg_event != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserJoined was null, expected non-null UserJoinedEvent.');
        api.onUserJoined(arg_event!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onUserLeave', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserLeave was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final UserLeaveEvent? arg_event = (args[0] as UserLeaveEvent?);
        assert(arg_event != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserLeave was null, expected non-null UserLeaveEvent.');
        api.onUserLeave(arg_event!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onUserAudioStart', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserAudioStart was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_uid = (args[0] as int?);
        assert(arg_uid != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserAudioStart was null, expected non-null int.');
        api.onUserAudioStart(arg_uid!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onUserSubStreamAudioStart',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserSubStreamAudioStart was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_uid = (args[0] as int?);
        assert(arg_uid != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserSubStreamAudioStart was null, expected non-null int.');
        api.onUserSubStreamAudioStart(arg_uid!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onUserAudioStop', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserAudioStop was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_uid = (args[0] as int?);
        assert(arg_uid != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserAudioStop was null, expected non-null int.');
        api.onUserAudioStop(arg_uid!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onUserSubStreamAudioStop',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserSubStreamAudioStop was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_uid = (args[0] as int?);
        assert(arg_uid != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserSubStreamAudioStop was null, expected non-null int.');
        api.onUserSubStreamAudioStop(arg_uid!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onUserVideoStart', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserVideoStart was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_uid = (args[0] as int?);
        assert(arg_uid != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserVideoStart was null, expected non-null int.');
        final int? arg_maxProfile = (args[1] as int?);
        assert(arg_maxProfile != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserVideoStart was null, expected non-null int.');
        api.onUserVideoStart(arg_uid!, arg_maxProfile!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onUserVideoStop', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserVideoStop was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_uid = (args[0] as int?);
        assert(arg_uid != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserVideoStop was null, expected non-null int.');
        api.onUserVideoStop(arg_uid!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onDisconnect', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onDisconnect was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_reason = (args[0] as int?);
        assert(arg_reason != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onDisconnect was null, expected non-null int.');
        api.onDisconnect(arg_reason!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onUserAudioMute', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserAudioMute was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_uid = (args[0] as int?);
        assert(arg_uid != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserAudioMute was null, expected non-null int.');
        final bool? arg_muted = (args[1] as bool?);
        assert(arg_muted != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserAudioMute was null, expected non-null bool.');
        api.onUserAudioMute(arg_uid!, arg_muted!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onUserVideoMute', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserVideoMute was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final UserVideoMuteEvent? arg_event =
            (args[0] as UserVideoMuteEvent?);
        assert(arg_event != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserVideoMute was null, expected non-null UserVideoMuteEvent.');
        api.onUserVideoMute(arg_event!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onUserSubStreamAudioMute',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserSubStreamAudioMute was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_uid = (args[0] as int?);
        assert(arg_uid != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserSubStreamAudioMute was null, expected non-null int.');
        final bool? arg_muted = (args[1] as bool?);
        assert(arg_muted != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserSubStreamAudioMute was null, expected non-null bool.');
        api.onUserSubStreamAudioMute(arg_uid!, arg_muted!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onFirstAudioDataReceived',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onFirstAudioDataReceived was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_uid = (args[0] as int?);
        assert(arg_uid != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onFirstAudioDataReceived was null, expected non-null int.');
        api.onFirstAudioDataReceived(arg_uid!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onFirstVideoDataReceived',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onFirstVideoDataReceived was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final FirstVideoDataReceivedEvent? arg_event =
            (args[0] as FirstVideoDataReceivedEvent?);
        assert(arg_event != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onFirstVideoDataReceived was null, expected non-null FirstVideoDataReceivedEvent.');
        api.onFirstVideoDataReceived(arg_event!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onFirstAudioFrameDecoded',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onFirstAudioFrameDecoded was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_uid = (args[0] as int?);
        assert(arg_uid != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onFirstAudioFrameDecoded was null, expected non-null int.');
        api.onFirstAudioFrameDecoded(arg_uid!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onFirstVideoFrameDecoded',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onFirstVideoFrameDecoded was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final FirstVideoFrameDecodedEvent? arg_event =
            (args[0] as FirstVideoFrameDecodedEvent?);
        assert(arg_event != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onFirstVideoFrameDecoded was null, expected non-null FirstVideoFrameDecodedEvent.');
        api.onFirstVideoFrameDecoded(arg_event!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onVirtualBackgroundSourceEnabled',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onVirtualBackgroundSourceEnabled was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final VirtualBackgroundSourceEnabledEvent? arg_event =
            (args[0] as VirtualBackgroundSourceEnabledEvent?);
        assert(arg_event != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onVirtualBackgroundSourceEnabled was null, expected non-null VirtualBackgroundSourceEnabledEvent.');
        api.onVirtualBackgroundSourceEnabled(arg_event!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onConnectionTypeChanged',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onConnectionTypeChanged was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_newConnectionType = (args[0] as int?);
        assert(arg_newConnectionType != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onConnectionTypeChanged was null, expected non-null int.');
        api.onConnectionTypeChanged(arg_newConnectionType!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onReconnectingStart', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        // ignore message
        api.onReconnectingStart();
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onReJoinChannel', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onReJoinChannel was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_result = (args[0] as int?);
        assert(arg_result != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onReJoinChannel was null, expected non-null int.');
        final int? arg_channelId = (args[1] as int?);
        assert(arg_channelId != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onReJoinChannel was null, expected non-null int.');
        api.onReJoinChannel(arg_result!, arg_channelId!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onConnectionStateChanged',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onConnectionStateChanged was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_state = (args[0] as int?);
        assert(arg_state != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onConnectionStateChanged was null, expected non-null int.');
        final int? arg_reason = (args[1] as int?);
        assert(arg_reason != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onConnectionStateChanged was null, expected non-null int.');
        api.onConnectionStateChanged(arg_state!, arg_reason!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onLocalAudioVolumeIndication',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onLocalAudioVolumeIndication was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_volume = (args[0] as int?);
        assert(arg_volume != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onLocalAudioVolumeIndication was null, expected non-null int.');
        final bool? arg_vadFlag = (args[1] as bool?);
        assert(arg_vadFlag != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onLocalAudioVolumeIndication was null, expected non-null bool.');
        api.onLocalAudioVolumeIndication(arg_volume!, arg_vadFlag!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onRemoteAudioVolumeIndication',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onRemoteAudioVolumeIndication was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final RemoteAudioVolumeIndicationEvent? arg_event =
            (args[0] as RemoteAudioVolumeIndicationEvent?);
        assert(arg_event != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onRemoteAudioVolumeIndication was null, expected non-null RemoteAudioVolumeIndicationEvent.');
        api.onRemoteAudioVolumeIndication(arg_event!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onLiveStreamState', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onLiveStreamState 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.NERtcChannelEventSink.onLiveStreamState was null, expected non-null String.');
        final String? arg_pushUrl = (args[1] as String?);
        assert(arg_pushUrl != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onLiveStreamState was null, expected non-null String.');
        final int? arg_liveState = (args[2] as int?);
        assert(arg_liveState != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onLiveStreamState was null, expected non-null int.');
        api.onLiveStreamState(arg_taskId!, arg_pushUrl!, arg_liveState!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onClientRoleChange', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onClientRoleChange was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_oldRole = (args[0] as int?);
        assert(arg_oldRole != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onClientRoleChange was null, expected non-null int.');
        final int? arg_newRole = (args[1] as int?);
        assert(arg_newRole != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onClientRoleChange was null, expected non-null int.');
        api.onClientRoleChange(arg_oldRole!, arg_newRole!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onError', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onError was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_code = (args[0] as int?);
        assert(arg_code != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onError was null, expected non-null int.');
        api.onError(arg_code!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onWarning', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onWarning was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_code = (args[0] as int?);
        assert(arg_code != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onWarning was null, expected non-null int.');
        api.onWarning(arg_code!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onUserSubStreamVideoStart',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserSubStreamVideoStart was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_uid = (args[0] as int?);
        assert(arg_uid != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserSubStreamVideoStart was null, expected non-null int.');
        final int? arg_maxProfile = (args[1] as int?);
        assert(arg_maxProfile != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserSubStreamVideoStart was null, expected non-null int.');
        api.onUserSubStreamVideoStart(arg_uid!, arg_maxProfile!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onUserSubStreamVideoStop',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserSubStreamVideoStop was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_uid = (args[0] as int?);
        assert(arg_uid != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUserSubStreamVideoStop was null, expected non-null int.');
        api.onUserSubStreamVideoStop(arg_uid!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onAudioHasHowling', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        // ignore message
        api.onAudioHasHowling();
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onRecvSEIMsg', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onRecvSEIMsg was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_userID = (args[0] as int?);
        assert(arg_userID != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onRecvSEIMsg was null, expected non-null int.');
        final String? arg_seiMsg = (args[1] as String?);
        assert(arg_seiMsg != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onRecvSEIMsg was null, expected non-null String.');
        api.onRecvSEIMsg(arg_userID!, arg_seiMsg!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onAudioRecording', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onAudioRecording was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_code = (args[0] as int?);
        assert(arg_code != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onAudioRecording was null, expected non-null int.');
        final String? arg_filePath = (args[1] as String?);
        assert(arg_filePath != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onAudioRecording was null, expected non-null String.');
        api.onAudioRecording(arg_code!, arg_filePath!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onMediaRightChange', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onMediaRightChange was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final bool? arg_isAudioBannedByServer = (args[0] as bool?);
        assert(arg_isAudioBannedByServer != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onMediaRightChange was null, expected non-null bool.');
        final bool? arg_isVideoBannedByServer = (args[1] as bool?);
        assert(arg_isVideoBannedByServer != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onMediaRightChange was null, expected non-null bool.');
        api.onMediaRightChange(
            arg_isAudioBannedByServer!, arg_isVideoBannedByServer!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onMediaRelayStatesChange',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onMediaRelayStatesChange was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_state = (args[0] as int?);
        assert(arg_state != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onMediaRelayStatesChange was null, expected non-null int.');
        final String? arg_channelName = (args[1] as String?);
        assert(arg_channelName != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onMediaRelayStatesChange was null, expected non-null String.');
        api.onMediaRelayStatesChange(arg_state!, arg_channelName!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onMediaRelayReceiveEvent',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onMediaRelayReceiveEvent was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_event = (args[0] as int?);
        assert(arg_event != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onMediaRelayReceiveEvent was null, expected non-null int.');
        final int? arg_code = (args[1] as int?);
        assert(arg_code != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onMediaRelayReceiveEvent was null, expected non-null int.');
        final String? arg_channelName = (args[2] as String?);
        assert(arg_channelName != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onMediaRelayReceiveEvent was null, expected non-null String.');
        api.onMediaRelayReceiveEvent(arg_event!, arg_code!, arg_channelName!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onLocalPublishFallbackToAudioOnly',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onLocalPublishFallbackToAudioOnly was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final bool? arg_isFallback = (args[0] as bool?);
        assert(arg_isFallback != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onLocalPublishFallbackToAudioOnly was null, expected non-null bool.');
        final int? arg_streamType = (args[1] as int?);
        assert(arg_streamType != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onLocalPublishFallbackToAudioOnly was null, expected non-null int.');
        api.onLocalPublishFallbackToAudioOnly(
            arg_isFallback!, arg_streamType!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onRemoteSubscribeFallbackToAudioOnly',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onRemoteSubscribeFallbackToAudioOnly was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_uid = (args[0] as int?);
        assert(arg_uid != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onRemoteSubscribeFallbackToAudioOnly was null, expected non-null int.');
        final bool? arg_isFallback = (args[1] as bool?);
        assert(arg_isFallback != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onRemoteSubscribeFallbackToAudioOnly was null, expected non-null bool.');
        final int? arg_streamType = (args[2] as int?);
        assert(arg_streamType != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onRemoteSubscribeFallbackToAudioOnly was null, expected non-null int.');
        api.onRemoteSubscribeFallbackToAudioOnly(
            arg_uid!, arg_isFallback!, arg_streamType!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onLocalVideoWatermarkState',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onLocalVideoWatermarkState was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_videoStreamType = (args[0] as int?);
        assert(arg_videoStreamType != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onLocalVideoWatermarkState was null, expected non-null int.');
        final int? arg_state = (args[1] as int?);
        assert(arg_state != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onLocalVideoWatermarkState was null, expected non-null int.');
        api.onLocalVideoWatermarkState(arg_videoStreamType!, arg_state!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onLastmileQuality', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onLastmileQuality was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_quality = (args[0] as int?);
        assert(arg_quality != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onLastmileQuality was null, expected non-null int.');
        api.onLastmileQuality(arg_quality!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onLastmileProbeResult',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onLastmileProbeResult was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final NERtcLastmileProbeResult? arg_result =
            (args[0] as NERtcLastmileProbeResult?);
        assert(arg_result != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onLastmileProbeResult was null, expected non-null NERtcLastmileProbeResult.');
        api.onLastmileProbeResult(arg_result!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onTakeSnapshotResult',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onTakeSnapshotResult was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_code = (args[0] as int?);
        assert(arg_code != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onTakeSnapshotResult was null, expected non-null int.');
        final String? arg_path = (args[1] as String?);
        assert(arg_path != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onTakeSnapshotResult was null, expected non-null String.');
        api.onTakeSnapshotResult(arg_code!, arg_path!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onPermissionKeyWillExpire',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        // ignore message
        api.onPermissionKeyWillExpire();
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcChannelEventSink.onUpdatePermissionKey',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUpdatePermissionKey was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final String? arg_key = (args[0] as String?);
        assert(arg_key != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUpdatePermissionKey was null, expected non-null String.');
        final int? arg_error = (args[1] as int?);
        assert(arg_error != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUpdatePermissionKey was null, expected non-null int.');
        final int? arg_timeout = (args[2] as int?);
        assert(arg_timeout != null,
            'Argument for dev.flutter.pigeon.NERtcChannelEventSink.onUpdatePermissionKey was null, expected non-null int.');
        api.onUpdatePermissionKey(arg_key!, arg_error!, arg_timeout!);
        return;
      });
    }
  }
}