captureAndSave method
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);
}