deleteFolder static method
Удаление папки
Implementation
static Future<void> deleteFolder({int errorCount = 0}) async {
try {
final tempDir = await tempFolder;
final dir = Directory(tempDir);
if (await dir.exists()) {
await dir.delete(recursive: true);
}
} catch (e) {
if (errorCount > 10) {
rethrow;
}
await Future.delayed(const Duration(milliseconds: 100));
await deleteFolder(errorCount: errorCount + 1);
}
}