savePhoto method

Future<void> savePhoto(
  1. String filename, {
  2. int autofocusSeconds = 3,
  3. PhotoQuality quality = PhotoQuality.medium,
  4. AutoFocusType autofocusType = AutoFocusType.average,
})

Saves a photo to a file.

Args: filename (String): The name of the file to save the photo. autofocusSeconds (int): The number of seconds to autofocus. Defaults to 3. quality (PhotoQuality): The quality of the photo. Defaults to PhotoQuality.medium. autofocusType (AutoFocusType): The type of autofocus. Defaults to AutoFocusType.average.

Implementation

Future<void> savePhoto(
  String filename, {
  int autofocusSeconds = 3,
  PhotoQuality quality = PhotoQuality.medium,
  AutoFocusType autofocusType = AutoFocusType.average,
}) async {
  final imageBuffer = await takePhoto(
    autofocusSeconds: autofocusSeconds,
    quality: quality,
    autofocusType: autofocusType,
  );

  final file = File(filename);
  await file.writeAsBytes(imageBuffer);
}