getDirSize static method
Implementation
static Future<int> getDirSize(String path, [int size = 0]) async {
final items = Directory(path).listSync(recursive: true, followLinks: true);
for (final item in items) {
if (item is File) {
size += await item.length();
} else if (item is Directory) {
size = await getDirSize(item.absolute.path, size);
}
}
return size;
}