improve code

This commit is contained in:
nyne
2024-10-02 16:45:25 +08:00
parent 63aa4ee8b0
commit 20dfbf5125
3 changed files with 17 additions and 3 deletions

View File

@@ -12,6 +12,14 @@ extension FSExt on FileSystemEntity {
}
}
Future<void> deleteIgnoreError() async {
try {
await delete();
} catch (e) {
// ignore
}
}
int get size {
if (this is File) {
return (this as File).lengthSync();