factory FileWatcher()

in lib/src/file_watcher.dart [31:43]


  factory FileWatcher(String file, {Duration? pollingDelay}) {
    var customWatcher =
        createCustomFileWatcher(file, pollingDelay: pollingDelay);
    if (customWatcher != null) return customWatcher;

    // [File.watch] doesn't work on Windows, but
    // [FileSystemEntity.isWatchSupported] is still true because directory
    // watching does work.
    if (FileSystemEntity.isWatchSupported && !Platform.isWindows) {
      return NativeFileWatcher(file);
    }
    return PollingFileWatcher(file, pollingDelay: pollingDelay);
  }