SvgAssetLoader class

A BytesLoader that decodes and parses an SVG asset in an isolate and creates a vector_graphics binary representation.

Inheritance

Constructors

SvgAssetLoader(String assetName, {String? packageName, AssetBundle? assetBundle, SvgTheme? theme, ColorMapper? colorMapper})
See class doc.
const

Properties

assetBundle AssetBundle?
The asset bundle to use, or DefaultAssetBundle if null.
final
assetName String
The name of the asset, e.g. foo.svg.
final
colorMapper ColorMapper?
The ColorMapper used to transform colors from the SVG, if any.
finalinherited
hashCode int
The hash code for this object.
no setteroverride
packageName String?
The package containing the asset.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
theme SvgTheme?
The theme to determine currentColor and font sizing attributes.
finalinherited

Methods

cacheKey(BuildContext? context) SvgCacheKey
Create an object that can be used to uniquely identify this asset and loader combination.
override
getTheme(BuildContext? context) SvgTheme
Returns the svg theme.
inherited
loadBytes(BuildContext? context) Future<ByteData>
This method intentionally avoids using await to avoid unnecessary event loop turns. This is meant to to help tests in particular.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prepareMessage(BuildContext? context) Future<ByteData?>
Will be called
override
provideSvg(ByteData? message) String
Will be called in compute with the result of prepareMessage.
override
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override