setup static method

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

Implementation

static void setup(TakePhotoFlutterApi? api, {BinaryMessenger? binaryMessenger}) {
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.dh_native_photo.TakePhotoFlutterApi.onTakeCardPhoto', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
        'Argument for dev.flutter.pigeon.dh_native_photo.TakePhotoFlutterApi.onTakeCardPhoto was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final bool? arg_isBack = (args[0] as bool?);
        assert(arg_isBack != null,
            'Argument for dev.flutter.pigeon.dh_native_photo.TakePhotoFlutterApi.onTakeCardPhoto was null, expected non-null bool.');
        final Uint8List? arg_data = (args[1] as Uint8List?);
        api.onTakeCardPhoto(arg_isBack!, arg_data);
        return;
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.dh_native_photo.TakePhotoFlutterApi.onTakeSelfPhoto', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
        'Argument for dev.flutter.pigeon.dh_native_photo.TakePhotoFlutterApi.onTakeSelfPhoto was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final bool? arg_isHand = (args[0] as bool?);
        assert(arg_isHand != null,
            'Argument for dev.flutter.pigeon.dh_native_photo.TakePhotoFlutterApi.onTakeSelfPhoto was null, expected non-null bool.');
        final Uint8List? arg_data = (args[1] as Uint8List?);
        api.onTakeSelfPhoto(arg_isHand!, arg_data);
        return;
      });
    }
  }
}