UriData classfinal
A way to access the structure of adata: URI.
Data URIs are non-hierarchical URIs that can contain any binary data.They are defined byRFC 2397.
This class allows parsing the URI text, extracting individual parts of theURI, as well as building the URI text from structured parts.
Constructors
- UriData.fromBytes(List<
int> bytes, {StringmimeType ="application/octet-stream",Map<String,String> ?parameters,boolpercentEncoded =false}) - Creates a
data:URI containing an encoding ofbytes.factory - UriData.fromString(Stringcontent, {String?mimeType,Encoding?encoding,Map<
String,String> ?parameters,boolbase64 =false}) - Creates a
data:URI containing thecontentstring.factory - UriData.fromUri(Uriuri)
- Creates a
DataUrifrom aUri which must havedataasUri.scheme.factory
Properties
- charset→String
- The charset parameter of the media type.no setter
- contentText→String
- The content part of the data URI, as its actual representation.no setter
- hashCode→int
- The hash code for this object.no setterinherited
- isBase64→bool
- Whether the data is Base64 encoded or not.no setter
- mimeType→String
- The MIME type of the data URI.no setter
- parameters→Map<
String,String> - A map representing the parameters of the media type.no setter
- runtimeType→Type
- A representation of the runtime type of the object.no setterinherited
- uri→Uri
- TheUri that this
UriDatais giving access to.no setter
Methods
- contentAsBytes(
)→Uint8List - The content part of the data URI as bytes.
- contentAsString(
{Encoding?encoding})→String - Creates a string from the content of the data URI.
- isCharset(
Stringcharset)→bool - Checks whether the charset parameter of the mime type is
charset. - isEncoding(
Encodingencoding)→bool - Whether the charset parameter represents
encoding. - isMimeType(
StringmimeType)→bool - Whether theUriData.mimeType is equal to
mimeType. - noSuchMethod(
Invocationinvocation)→ dynamic - Invoked when a nonexistent method or property is accessed.inherited
- toString(
)→String - A string representation of this object.override
Operators
- operator ==(
Objectother)→bool - The equality operator.inherited