TomDirectoryWatches class

Watches root and the directories below it that descend admits, reporting the absolute path of every change on stream.

descend is asked with the directory's path relative to root (/ separators), once when its watch would be added; the browser answers it from its last walk, so a folder the walk does not enter — .git, a gitignored build folder — is not watched either. Links are not followed: the tree does not follow a link that leaves its root, and a watch that did would see changes the tree never shows.

A watch on the root that fails ends the stream with the error, which a tree reads as "this folder cannot be watched". A watch on a directory below it that fails — it went away, or it cannot be read — is dropped and the rest keep running.

Constructors

TomDirectoryWatches(String root, {required bool descend(String relativeDirectory), Stream<FileSystemEvent> watchDirectory(String directory)?})

Properties

descend → bool Function(String relativeDirectory)
final
hashCode → int
The hash code for this object.
no setterinherited
root → String
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
started → Future<void>
Completes once the directories present when the stream was listened to are all watched — before that, a change in one of them may be missed.
no setter
stream → Stream<String>
The absolute path of each change, once a listener is attached.
no setter
watchedCount → int
How many directories are watched now.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited