notifyWatchers static method

void notifyWatchers(
  1. WatchEvent event
)

Notify all active watchers of event if their FakeWatcher#path matches. The path will also be adjusted to remove the path.

Implementation

static void notifyWatchers(WatchEvent event) {
  for (var watcher in watchers) {
    if (event.path.startsWith(watcher.path)) {
      watcher._eventsController.add(WatchEvent(event.type, event.path));
    }
  }
}