setupCamera method

Future<bool> setupCamera(
  1. List<PigeonSensor?> arg_sensors,
  2. String arg_aspectRatio,
  3. double arg_zoom,
  4. bool arg_mirrorFrontCamera,
  5. bool arg_enablePhysicalButton,
  6. String arg_flashMode,
  7. String arg_captureMode,
  8. bool arg_enableImageStream,
  9. ExifPreferences arg_exifPreferences,
  10. VideoOptions? arg_videoOptions,
)

Implementation

Future<bool> setupCamera(
    List<PigeonSensor?> arg_sensors,
    String arg_aspectRatio,
    double arg_zoom,
    bool arg_mirrorFrontCamera,
    bool arg_enablePhysicalButton,
    String arg_flashMode,
    String arg_captureMode,
    bool arg_enableImageStream,
    ExifPreferences arg_exifPreferences,
    VideoOptions? arg_videoOptions) async {
  final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
      'dev.flutter.pigeon.CameraInterface.setupCamera', codec,
      binaryMessenger: _binaryMessenger);
  final List<Object?>? replyList = await channel.send(<Object?>[
    arg_sensors,
    arg_aspectRatio,
    arg_zoom,
    arg_mirrorFrontCamera,
    arg_enablePhysicalButton,
    arg_flashMode,
    arg_captureMode,
    arg_enableImageStream,
    arg_exifPreferences,
    arg_videoOptions
  ]) as List<Object?>?;
  if (replyList == null) {
    throw PlatformException(
      code: 'channel-error',
      message: 'Unable to establish connection on channel.',
    );
  } else if (replyList.length > 1) {
    throw PlatformException(
      code: replyList[0]! as String,
      message: replyList[1] as String?,
      details: replyList[2],
    );
  } else if (replyList[0] == null) {
    throw PlatformException(
      code: 'null-error',
      message: 'Host platform returned null value for non-null return value.',
    );
  } else {
    return (replyList[0] as bool?)!;
  }
}