claude refactorings, flutter best practices, platform dependent changes, general cleanup
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import 'dart:async';
|
||||
|
||||
/// App-wide pub/sub channel for cache invalidations. Producers (e.g. webdav
|
||||
/// move/delete handlers) call [notifyListFiles] after they have dropped the
|
||||
/// cached listing for a folder so that any [_FilesView] currently sitting on
|
||||
/// that folder — possibly in the background, beneath a child route — can
|
||||
/// refresh itself instead of showing the stale snapshot it loaded earlier.
|
||||
class CacheInvalidationBus {
|
||||
CacheInvalidationBus._();
|
||||
|
||||
static final StreamController<String> _listFiles = StreamController<String>.broadcast();
|
||||
|
||||
/// Emits the invalidated `pathString` (in `FilesBloc` format: relative,
|
||||
/// no leading or trailing slash; root is '/').
|
||||
static Stream<String> get listFilesStream => _listFiles.stream;
|
||||
|
||||
static void notifyListFiles(String pathString) {
|
||||
_listFiles.add(pathString);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user