Core topic
Core classes for creating a ScalableImage
from a stored binary file,
an SVG XML file or an Android Vector Drawable file.
Classes
- ExportedID Core
-
A record of a node whose id was exported. An ExportedID record gives the
bounding rectangle of one instance of the node with the given ID. Multiple
bounding rectangles may be created for the same node, e.g. if that node
is
use
d multiple times in the SVG from which the ScalableImage was created. - ExportedID Core
-
A record of a node whose id was exported. An ExportedID record gives the
bounding rectangle of one instance of the node with the given ID. Multiple
bounding rectangles may be created for the same node, e.g. if that node
is
use
d multiple times in the SVG from which the ScalableImage was created. - ScalableImage Core
- An image-like asset that can be scaled to any size and rendered without losing resolution, typically derived from an SVG file. This class features several static methods to load a ScalableImage from various sources. It provides two in-memory representations: a memory-saving "compact" representation, as well as a faster internal graph structure. Provision is given to set a viewport, and prune away nodes that are outside this viewport. In this way, several smaller "views" onto a larger SI asset can be produced, with maximal resource sharing between the different assets.
- ScalableImage Core
- An image-like asset that can be scaled to any size and rendered without losing resolution, typically derived from an SVG file. This class features several static methods to load a ScalableImage from various sources. It provides two in-memory representations: a memory-saving "compact" representation, as well as a faster internal graph structure. Provision is given to set a viewport, and prune away nodes that are outside this viewport. In this way, several smaller "views" onto a larger SI asset can be produced, with maximal resource sharing between the different assets.
- ScalingTransform Core
-
A coordinate system transformation to fit a
ScalableImage
into a given container, for a given BoxFit and Alignment. This class is offered as a convenience for scaling ScalableImage instances. It also helps converting positions as rendered back into the ScalableImage's coordinate, e.g. when mapping a touch event into the original SVG's coordinate space. - ScalingTransform Core
-
A coordinate system transformation to fit a
ScalableImage
into a given container, for a given BoxFit and Alignment. This class is offered as a convenience for scaling ScalableImage instances. It also helps converting positions as rendered back into the ScalableImage's coordinate, e.g. when mapping a touch event into the original SVG's coordinate space.
Enums
- ImageDisposeBugWorkaround Core
-
As of the initial date of publication of this library, there were several
bugs in the then-current shipped version of Flutter (2.2.2)
involving the
dispose()
method ofImageDescriptor
andImmutableImageBuffer
. The only safe thing to do with this version of Flutter was to refrain from callingdispose()
on these objects. This is non-optimal, since it is a potential memory leak. Even if a future version of Flutter correctly uses finalization to eventually dispose of the native memory backing these objects, large amounts of native memory might be retained for a significant amount of time, until the Dart objects are eventually reclaimed and finalized. - ImageDisposeBugWorkaround Core
-
As of the initial date of publication of this library, there were several
bugs in the then-current shipped version of Flutter (2.2.2)
involving the
dispose()
method ofImageDescriptor
andImmutableImageBuffer
. The only safe thing to do with this version of Flutter was to refrain from callingdispose()
on these objects. This is non-optimal, since it is a potential memory leak. Even if a future version of Flutter correctly uses finalization to eventually dispose of the native memory backing these objects, large amounts of native memory might be retained for a significant amount of time, until the Dart objects are eventually reclaimed and finalized.