ScalableImageWidget class abstract

A widget for displaying a ScalableImage. The image can be automatically scaled by the widget, and fit into the available area with a BoxFit and an Alignment.

Note that rendering a scalable image can be time-consuming if the underlying scene is complex. Notably, GPU performance can be a bottleneck. If animations are played over an unchanging ScalableImage, wrapping the ScalableImageWidget in Flutter's RepaintBoundary might result in significantly better performance.

Inheritance

Constructors

ScalableImageWidget({Key? key, required ScalableImage si, BoxFit fit = BoxFit.contain, Alignment alignment = Alignment.center, bool clip = true, double scale = 1, Color? background, bool isComplex = false})
Create a widget to display a pre-loaded ScalableImage. This is the preferred constructor, because the widget can display the SI immediately. It does, however, place responsibility for any asynchronous loading on the caller.
factory
ScalableImageWidget.fromSISource({Key? key, required ScalableImageSource si, BoxFit fit = BoxFit.contain, Alignment alignment = Alignment.center, bool clip = true, double scale = 1, Color? currentColor, Color? background, bool reload = false, bool isComplex = false, ScalableImageCache? cache, Widget onLoading(BuildContext)?, Widget onError(BuildContext)?, Widget switcher(BuildContext, Widget child)?})
Create a widget to load and then render a ScalableImage. In a production application, pre-loading the ScalableImage and using the default constructor is usually preferable, because the asynchronous loading that is necessary with an asynchronous source might cause a momentary flash. If the widget is frequently rebuilt, it is generally recommended to provide a cache with an appropriate lifetime and size.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
isComplex bool
Whether the underlying ScalableImage's painting is complex enough to benefit from caching. This is forwarded to CustomPaint -- see CustomPaint.isComplex.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<StatefulWidget>
Creates the mutable state for this widget at a given location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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