fromAvdHttpUrl static method
Get a ScalableImage by parsing an AVD XML file from a http:, https: or data: URL.
currentColor
, if set, will set the currentColor value of the
ScalableImage instance returned. Note, however, that if the same
image is used with more than one currentColor
value, it's best to
not set it here, and instead set it in the widget, e.g. with the
currentColor
parameter of ScalableImageWidget.fromSISource.
See also ScalableImage.currentColor.
If compact
is true, the internal representation will occupy
significantly less memory, at the expense of rendering time. It will
occupy perhaps an order of magnitude less memory, but render perhaps
around 3x slower. If bigFloats
is true, the compact representation
will use 8 byte double-precision float values, rather than 4 byte
single-precision values.
If warnF
is non-null, it will be called if the AVD asset contains
unrecognized tags and/or tag attributes. If it is null, the default
behavior is to print warnings.
httpHeaders
will be added to the HTTP GET request.
defaultEncoding
specifies the character encoding to use if the
content-type header of the HTTP response does not indicate an encoding.
RVC 2916 specifies latin1 for HTTP, but current browser practice defaults
to UTF8.
Implementation
static ScalableImageSource fromAvdHttpUrl(Uri url,
{Color? currentColor,
bool compact = false,
bool bigFloats = false,
@Deprecated("[warn] has been superseded by [warnF].")
bool warn = true,
void Function(String)? warnF,
Map<String, String>? httpHeaders,
Encoding defaultEncoding = utf8}) =>
_AvdHttpSource(url,
compact: compact,
bigFloats: bigFloats,
warn: warn,
warnF: warnF,
httpHeaders: httpHeaders,
defaultEncoding: defaultEncoding);