notify method

Future<void> notify(
  1. NotifyOptions options
)

Notifies about changes in the watched directory at observedPath in recursive mode. If the file system is mounted with supportsNotifyTag, then tag must be provided, and all changes since the last notification always reported, even if the system was shutdown. The last tag can be obtained with getAll.

To use, the file_system_provider.notify manifest option must be set to true.

Value of tag can be any string which is unique per call, so it's possible to identify the last registered notification. Eg. if the providing extension starts after a reboot, and the last registered notification's tag is equal to "123", then it should call notify for all changes which happened since the change tagged as "123". It cannot be an empty string.

Not all providers are able to provide a tag, but if the file system has a changelog, then the tag can be eg. a change number, or a revision number.

Note that if a parent directory is removed, then all descendant entries are also removed, and if they are watched, then the API must be notified about the fact. Also, if a directory is renamed, then all descendant entries are in fact removed, as there is no entry under their original paths anymore.

In case of an error, runtime.lastError will be set will a corresponding error code.

Implementation

Future<void> notify(NotifyOptions options) async {
  await promiseToFuture<void>(
      $js.chrome.fileSystemProvider.notify(options.toJS));
}