simplified code across the app and consolidated duplicated helpers

This commit is contained in:
2026-09-27 17:29:54 +02:00
parent 3e856d0b1c
commit ee1240f71a
155 changed files with 1772 additions and 2546 deletions
+7 -8
View File
@@ -21,16 +21,15 @@ class FileClipboard extends ChangeNotifier {
List<CacheableFile> get files => List.unmodifiable(_files);
bool get isEmpty => _files.isEmpty;
void cut(List<CacheableFile> files) {
if (files.isEmpty) return;
_operation = FileClipboardOperation.cut;
_files = List.of(files);
notifyListeners();
}
void cut(List<CacheableFile> files) =>
_set(FileClipboardOperation.cut, files);
void copy(List<CacheableFile> files) {
void copy(List<CacheableFile> files) =>
_set(FileClipboardOperation.copy, files);
void _set(FileClipboardOperation operation, List<CacheableFile> files) {
if (files.isEmpty) return;
_operation = FileClipboardOperation.copy;
_operation = operation;
_files = List.of(files);
notifyListeners();
}