dispatch_source_watcher

Creator: coderz1093

Last updated:

0 purchases

dispatch_source_watcher Image
dispatch_source_watcher Images

Languages

Categories

Add to Cart

Description:

dispatch source watcher

DispatchSourceWatcher #
A package that provides (limited) file system monitoring using the DispatchSource API on iOS.
Features #
Listen to file system events iOS. This plugin is meant to bridge a gap that currently exists in the standard library, where watching file system changes on iOS is not currently supported (see flutter issue 99456)
Usage #
Create a watcher for the desired path
final watcher = DispatchSourceWatcher(path: '/tmp/dir1');
copied to clipboard
The watcher provides a (broadcast) stream that can be listened to:
final subscription = watcher.stream.listen((event) {
print("receive event on path ${event.path}");
});
copied to clipboard
To stop listening to changes cancel the subscription:
subscription.cancel();
copied to clipboard
Limitations #
The data provided by the notifications in this package is not very granular. In particular, when watching a directory, the events triggered when the directory hierarchy is modified do not contain the path of the file that was modified within that hierarchy - the path in the event is the path of the directory being watched.
Requires iOS 10.0+

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.