A resource that can be read into the program.

WARNING: This API is experimental, and it may be changed or removed in future releases

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.

Properties

uri Uri
read-only

The location uri of this resource.

Constructors

Resource(String uri)
const

Creates a resource object with the given uri as location.

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.