takePhoto static method

Future<bool> takePhoto(
  1. CaptureRequest captureRequest
)

Implementation

static Future<bool> takePhoto(CaptureRequest captureRequest) async {
  final request = captureRequest.when(
    single: (single) => {
      single.sensor.toPigeon(): single.file?.path,
    },
    multiple: (multiple) => multiple.fileBySensor.map((key, value) {
      return MapEntry(key.toPigeon(), value?.path);
    }),
  );

  return CameraInterface().takePhoto(
    request.keys.toList(),
    request.values.toList(),
  );
}