saveToPrivateDir method
Implementation
Future<File> saveToPrivateDir(String subDir, {bool autoName = true}) async {
final String fileName;
if (autoName) {
final ext = extension.isNotEmpty ? '.$extension' : '';
final uuid = Uuid().v4();
fileName = '$uuid$ext';
} else {
fileName = filename;
}
final file = File('lib/src/storage/private/$subDir/$fileName');
if (!await file.parent.exists()) {
await file.parent.create(recursive: true);
}
final bytes = await _cachedBytes;
await file.writeAsBytes(bytes);
return file;
}