getFilesStream function

Stream<String>? getFilesStream()

A convenience transformation of the stream to a Stream<String>.

If the link is not valid as a URI or URI reference, a FormatException is thrown.

Refer to getLinksStream about error/exception details.

If the app was stared by a link intent or user activity the stream will not emit that initial uri - query either the getInitialFile instead.

Implementation

Stream<String>? getFilesStream() {
  return getStream()?.transform<String>(
    new StreamTransformer<String, String>.fromHandlers(
      handleData: (String? link, EventSink<String?> sink) {
        if (link == null) {
          sink.add(null);
        } else {
          sink.add(Uri.parse(link).path);
        }
      },
    ),
  );
}