PhysicalFilesWatcher constructor

PhysicalFilesWatcher(
  1. String root,
  2. bool useEventBasedWatcher, {
  3. Duration pollingInterval = const Duration(seconds: 4),
})

Creates a new PhysicalFilesWatcher for the specified root directory.

root - The root directory to watch useEventBasedWatcher - If true, uses event-based file watching. If false, uses polling. pollingInterval - The interval at which to poll for changes.

Implementation

PhysicalFilesWatcher(
  String root,
  bool useEventBasedWatcher, {
  Duration pollingInterval = const Duration(seconds: 4),
})  : _root = root,
      _usePolling = !useEventBasedWatcher,
      _pollingInterval = pollingInterval {
  if (useEventBasedWatcher) {
    _initializeEventWatcher();
  }
}