reworked developer tools with diagnostics, storage viewers and release-capable debug overlays
This commit is contained in:
1 parent
0f6c388940
commit
e6f74ca6fe
18 files changed
+1330
-239
No files matched your search
@@ -5,6 +5,8 @@ import 'dart:io';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
||||
import '../utils/directory_size.dart';
|
||||
|
||||
/// One cached response: the raw JSON payload and when it was stored.
|
||||
class CacheEntry {
|
||||
final String json;
|
||||
@@ -140,18 +142,7 @@ class CacheStore {
|
||||
}
|
||||
|
||||
/// Total size of all entries in bytes.
|
||||
Future<int> totalSize() async {
|
||||
try {
|
||||
final dir = await _directory();
|
||||
var sum = 0;
|
||||
await for (final entity in dir.list()) {
|
||||
if (entity is File) sum += await entity.length();
|
||||
}
|
||||
return sum;
|
||||
} on Object {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Future<int> totalSize() async => directorySize(await _directory());
|
||||
|
||||
/// Parses the stored file format; public for tests.
|
||||
static CacheEntry? parse(String raw) {
|
||||
|
||||
Reference in new issue
Block a user