mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-16 22:24:04 +08:00
* mod: pgc episode title * opt: ColorScheme.of * mod: mpv api version * opt: log handler * opt: ext
17 lines
428 B
Dart
17 lines
428 B
Dart
import 'dart:io' show FileSystemEntity, Directory;
|
|
|
|
extension FileSystemEntityExt on FileSystemEntity {
|
|
Future<void> tryDel({bool recursive = false}) =>
|
|
delete(recursive: recursive).catchError((_) => this);
|
|
}
|
|
|
|
extension DirectoryExt on Directory {
|
|
Future<bool> lengthGte(int length) async {
|
|
int count = 0;
|
|
await for (final _ in list()) {
|
|
if (++count == length) return true;
|
|
}
|
|
return false;
|
|
}
|
|
}
|