Skip to content
pubscout

watcher

1.2.1, released 10 months ago by tools.dart.dev

Monitors file system changes and notifies when files are added, removed, or modified.

$ flutter pub add watcher
Source repository

What it does

A file system watcher that monitors the contents of directories. It sends notifications when files have been added, removed, or modified across multiple platforms.

AI-written summary of version 1.2.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to monitor directory contents for additions, deletions, or modifications.
  • Building developer tools or local file-processing utilities that react to file changes.

Skip it when

  • You only need a one-time file picker interface instead of background observation.

Strengths

  • Cross-platform support for Android, iOS, Windows, macOS, and Linux.
  • Handles OS-specific quirks such as Windows buffer exhaustion and symlink loops.

Weaknesses

  • May hit system watcher limits on Linux depending on configuration.
  • Polling watchers may have limitations with low-resolution timestamps.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
2

No special setup or permissions documented.

import 'package:watcher/watcher.dart';

var watcher = DirectoryWatcher('path/to/directory');
watcher.events.listen((event) {
  print(event);
});

Alternatives

Packages that do the same job and could replace watcher.

Works with

Packages commonly used together with watcher: ones it builds on, ones built on it, and its own family.