setup static method

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

Implementation

static void setup(NERtcDeviceEventSink? api,
    {BinaryMessenger? binaryMessenger}) {
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcDeviceEventSink.onAudioDeviceChanged', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcDeviceEventSink.onAudioDeviceChanged was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_selected = (args[0] as int?);
        assert(arg_selected != null,
            'Argument for dev.flutter.pigeon.NERtcDeviceEventSink.onAudioDeviceChanged was null, expected non-null int.');
        api.onAudioDeviceChanged(arg_selected!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcDeviceEventSink.onAudioDeviceStateChange',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcDeviceEventSink.onAudioDeviceStateChange was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_deviceType = (args[0] as int?);
        assert(arg_deviceType != null,
            'Argument for dev.flutter.pigeon.NERtcDeviceEventSink.onAudioDeviceStateChange was null, expected non-null int.');
        final int? arg_deviceState = (args[1] as int?);
        assert(arg_deviceState != null,
            'Argument for dev.flutter.pigeon.NERtcDeviceEventSink.onAudioDeviceStateChange was null, expected non-null int.');
        api.onAudioDeviceStateChange(arg_deviceType!, arg_deviceState!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcDeviceEventSink.onVideoDeviceStateChange',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcDeviceEventSink.onVideoDeviceStateChange was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_deviceType = (args[0] as int?);
        assert(arg_deviceType != null,
            'Argument for dev.flutter.pigeon.NERtcDeviceEventSink.onVideoDeviceStateChange was null, expected non-null int.');
        final int? arg_deviceState = (args[1] as int?);
        assert(arg_deviceState != null,
            'Argument for dev.flutter.pigeon.NERtcDeviceEventSink.onVideoDeviceStateChange was null, expected non-null int.');
        api.onVideoDeviceStateChange(arg_deviceType!, arg_deviceState!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcDeviceEventSink.onCameraFocusChanged', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcDeviceEventSink.onCameraFocusChanged was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final CGPoint? arg_focusPoint = (args[0] as CGPoint?);
        assert(arg_focusPoint != null,
            'Argument for dev.flutter.pigeon.NERtcDeviceEventSink.onCameraFocusChanged was null, expected non-null CGPoint.');
        api.onCameraFocusChanged(arg_focusPoint!);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.NERtcDeviceEventSink.onCameraExposureChanged',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.NERtcDeviceEventSink.onCameraExposureChanged was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final CGPoint? arg_exposurePoint = (args[0] as CGPoint?);
        assert(arg_exposurePoint != null,
            'Argument for dev.flutter.pigeon.NERtcDeviceEventSink.onCameraExposureChanged was null, expected non-null CGPoint.');
        api.onCameraExposureChanged(arg_exposurePoint!);
        return;
      });
    }
  }
}