Log directory stats if dirSize is > 10MB
Signed-off-by: Neeraj Gupta <254676+ua741@users.noreply.github.com>
This commit is contained in:
parent
aa7220862b
commit
09f8cb3bdb
1 changed files with 19 additions and 0 deletions
|
@ -79,6 +79,14 @@ class _AppStorageViewerState extends State<AppStorageViewer> {
|
|||
allowCacheClear: true,
|
||||
),
|
||||
]);
|
||||
final List<String> directoryStatePath = [
|
||||
appDocumentsDirectory.path,
|
||||
appSupportDirectory.path,
|
||||
appTemporaryDirectory.path,
|
||||
];
|
||||
if (!Platform.isAndroid) {
|
||||
directoryStatePath.add(iosTempDirectoryPath);
|
||||
}
|
||||
if (internalUser) {
|
||||
paths.addAll([
|
||||
PathStorageItem.name(appDocumentsDirectory.path, "Documents"),
|
||||
|
@ -89,11 +97,22 @@ class _AppStorageViewerState extends State<AppStorageViewer> {
|
|||
paths.add(PathStorageItem.name(iosTempDirectoryPath, "/tmp"));
|
||||
}
|
||||
}
|
||||
prettyStringDirectoryStats(directoryStatePath).ignore();
|
||||
if (mounted) {
|
||||
setState(() => {});
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> prettyStringDirectoryStats(List<String> paths) async {
|
||||
for (var path in paths) {
|
||||
final DirectoryStat state = await getDirectorySize(Directory(path));
|
||||
final content = prettyPrintDirectoryStat(state, path);
|
||||
if (content.isNotEmpty) {
|
||||
debugPrint(content);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
debugPrint("$runtimeType building");
|
||||
|
|
Loading…
Add table
Reference in a new issue