A way to access the structure of a data: URI.

Data URIs are non-hierarchical URIs that can contain any binary data. They are defined by RFC 2397.

This class allows parsing the URI text and extracting individual parts of the URI, as well as building the URI text from structured parts.

Static Methods

parse(String uri) UriData

Parses a string as a data URI.

Constructors

UriData.fromBytes(List<int> bytes, {mimeType: "application/octet-stream", Map<String, String> parameters, percentEncoded: false})

Creates a data: URI containing an encoding of bytes.

factory
UriData.fromString(String content, {String mimeType, Encoding encoding, Map<String, String> parameters, bool base64: false})

Creates a data: URI containing the content string.

factory
UriData.fromUri(Uri uri)

Creates a DataUri from a Uri which must have data as Uri.scheme.

factory

Properties

charset String

The charset parameter of the media type.

read-only
contentText String

The content part of the data URI, as its actual representation.

read-only
hashCode int

获取对象的哈希值。

read-only, inherited
isBase64 bool

Whether the data is Base64 encoded or not.

read-only
mimeType String

The MIME type of the data URI.

read-only
parameters Map<String, String>

A map representing the parameters of the media type.

read-only
runtimeType Type

表示对象的运行时类型。

read-only, inherited
uri Uri

The Uri that this UriData is giving access to.

read-only

Operators

operator ==(other) bool

相等操作符。

inherited

Methods

contentAsBytes() List<int>

The content part of the data URI as bytes.

contentAsString({Encoding encoding}) String

Returns a string created from the content of the data URI.

noSuchMethod(Invocation invocation) → dynamic

当一个不存在的函数或成员变量被访问时,该函数被调用。

inherited
toString() String

返回一个用来表示对象的字符串。