getTextStreamAsUri static method

Stream<Uri> getTextStreamAsUri()

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

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

Refer to getTextStream about error/exception details.

If the app was started by a share intent or user activity the stream will not emit that initial uri - query either the getInitialTextAsUri instead.

Implementation

static Stream<Uri> getTextStreamAsUri() {
  return getTextStream().transform<Uri>(
    new StreamTransformer<String, Uri>.fromHandlers(
      handleData: (String data, EventSink<Uri> sink) {
        sink.add(Uri.parse(data));
      },
    ),
  );
}