UriData class - dart:core library (original) (raw)
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, extracting individual parts of the URI, as well as building the URI text from structured parts.
Constructors
UriData.fromBytes(List<int> bytes, {String mimeType = "application/octet-stream", Map<String, String>? parameters, bool 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
The charset parameter of the media type.
no setter
The content part of the data URI, as its actual representation.
no setter
The hash code for this object.
no setterinherited
Whether the data is Base64 encoded or not.
no setter
The MIME type of the data URI.
no setter
parameters → Map<String, String>
A map representing the parameters of the media type.
no setter
A representation of the runtime type of the object.
no setterinherited
The Uri that this UriData
is giving access to.
no setter
Methods
The content part of the data URI as bytes.
contentAsString({Encoding? encoding})→ String
Creates a string from the content of the data URI.
isCharset(String charset)→ bool
Checks whether the charset parameter of the mime type is charset
.
isEncoding(Encoding encoding)→ bool
Whether the charset parameter represents encoding
.
isMimeType(String mimeType)→ bool
Whether the UriData.mimeType is equal to mimeType
.
noSuchMethod(Invocation invocation)→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
A string representation of this object.
override
Operators
operator ==(Object other)→ bool
The equality operator.
inherited
Static Methods
Parses a string as a data
URI.