UriData class
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
Constructors
- UriData.fromBytes(List<int> bytes, { mimeType: "application/octet-stream", Map<String, String> parameters, percentEncoded: false }) factory
-
Creates a
data:
URI containing an encoding ofbytes
. - UriData.fromString(String content, { String mimeType, Encoding encoding, Map<String, String> parameters, bool base64: false }) factory
-
Creates a
data:
URI containing thecontent
string. - UriData.fromUri(Uri uri) factory
-
Creates a
DataUri
from a Uri which must havedata
as Uri.scheme.
Properties
- charset → String read-only
-
The charset parameter of the media type.
- contentText → String read-only
-
The content part of the data URI, as its actual representation.
- isBase64 → bool read-only
-
Whether the data is Base64 encoded or not.
- mimeType → String read-only
-
The MIME type of the data URI.
- parameters → Map<String, String> read-only
-
A map representing the parameters of the media type.
- uri → Uri read-only
-
The
Uri
that thisUriData
is giving access to. - hashCode → int read-only, inherited
-
The hash code for this object.
- runtimeType → Type read-only, inherited
-
A representation of the runtime type of the object.
Operators
- operator ==(
other) → bool inherited -
The equality operator.
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.
- toString(
) → String -
Returns a string representation of this object.
- noSuchMethod(
Invocation invocation) → dynamic inherited -
Invoked when a non-existent method or property is accessed.
© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-core/UriData-class.html