getUriFilesStream function

Stream<Uri>? getUriFilesStream()

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

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 getInitialUri instead.

Implementation

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