captureAndSave method

Future<String?> captureAndSave(
  1. String directory, {
  2. String? fileName,
  3. double? pixelRatio,
  4. Duration delay = const Duration(milliseconds: 20),
})

Captures image and saves to given path

Implementation

Future<String?> captureAndSave(
  String directory, {
  String? fileName,
  double? pixelRatio,
  Duration delay = const Duration(milliseconds: 20),
}) async {
  Uint8List? content = await capture(
    pixelRatio: pixelRatio,
    delay: delay,
  );
  PlatformFileManager fileManager = PlatformFileManager();

  return fileManager.saveFile(content!, directory, name: fileName);
}