VectorGraphic class
A widget that displays a VectorGraphicsCodec
encoded asset.
This widget will ask the loader to load the bytes whenever its dependencies change or it is configured with a new loader. A loader may or may not choose to cache its responses, potentially resulting in multiple disk or network accesses for the same bytes.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- VectorGraphic
Constructors
-
VectorGraphic({Key? key, required BytesLoader loader, double? width, double? height, BoxFit fit = BoxFit.contain, AlignmentGeometry alignment = Alignment.center, String? semanticsLabel, bool excludeFromSemantics = false, Clip clipBehavior = Clip.hardEdge, WidgetBuilder? placeholderBuilder, VectorGraphicsErrorWidget? errorBuilder, ColorFilter? colorFilter, Animation<
double> ? opacity, bool clipViewbox = true, bool matchTextDirection = false}) -
A widget that displays a vector graphics created via a
VectorGraphicsCodec
.const
Properties
- alignment → AlignmentGeometry
-
How to align the picture within its parent widget.
final
- clipBehavior → Clip
-
The content will be clipped (or not) according to this option.
final
- clipViewbox → bool
-
Whether the graphic should be clipped to its viewbox.
final
- colorFilter → ColorFilter?
-
If provided, a color filter to apply to the vector graphic when painting.
final
- errorBuilder → VectorGraphicsErrorWidget?
-
A callback that fires if some exception happens during data acquisition or decoding.
final
- excludeFromSemantics → bool
-
Whether to exclude this picture from semantics.
final
- fit → BoxFit
-
How to inscribe the picture into the space allocated during layout.
The default is BoxFit.contain.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
If specified, the height to use for the vector graphic. If unspecified,
the vector graphic will take the height of its parent.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- loader → BytesLoader
-
A delegate for fetching the raw bytes of the vector graphic.
final
- matchTextDirection → bool
-
If true, will horizontally flip the picture in TextDirection.rtl contexts.
final
-
opacity
→ Animation<
double> ? -
If non-null, the value from the Animation is multiplied with the opacity
of each vector graphic pixel before painting onto the canvas.
final
- placeholderBuilder → WidgetBuilder?
-
The placeholder to use while fetching, decoding, and parsing the vector_graphics data.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticsLabel → String?
-
The Semantics label for this picture.
final
- strategy → RenderingStrategy
-
The rendering strategy used by the vector graphic.
final
- width → double?
-
If specified, the width to use for the vector graphic. If unspecified,
the vector graphic will take the width of its parent.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< VectorGraphic> -
Creates the mutable state for this widget at a given location in the tree.
override
-
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