Resource class

A resource that can be read into the program.

A resource that can be read into the program.

A resource is data that can be located using a URI and read into the program at runtime. The URI may use the package scheme to read resources provided along with package sources.

Constructors

Resource ( String uri )
const
Creates a resource object with the given uri as location.

Instance Properties

uri Uri
read-only

Instance Methods

openRead ( ) → Stream<List<int>>
Read the resource content as a stream of bytes.
readAsBytes ( ) → Future<List<int>>
Read the resource content.
readAsString ( {Encoding encoding} ) → Future<String>
Read the resource content as a string.