SpineWidget class
A StatefulWidget to display a Spine skeleton. The skeleton can be loaded from an asset bundle (SpineWidget.fromAsset, local files SpineWidget.fromFile, URLs SpineWidget.fromHttp, or a pre-loaded SkeletonDrawable (SpineWidget.fromDrawable).
The skeleton displayed by a SpineWidget
can be controlled via a SpineWidgetController.
The size of the widget can be derived from the bounds provided by a BoundsProvider. If the widget is not sized by the bounds computed by the BoundsProvider, the widget will use the computed bounds to fit the skeleton inside the widget's dimensions.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- SpineWidget
Constructors
- SpineWidget.fromAsset(String? _atlasFile, String? _skeletonFile, SpineWidgetController _controller, {AssetBundle? bundle, BoxFit? fit, Alignment? alignment, BoundsProvider? boundsProvider, bool? sizedByBounds, Key? key})
-
Constructs a new SpineWidget from files in the root bundle or the optionally specified
bundle
. The_atlasFile
specifies the.atlas
file to be loaded for the images used to render the skeleton. The_skeletonFile
specifies either a Skeleton.json
or.skel
file containing the skeleton data. - SpineWidget.fromDrawable(SkeletonDrawable? _drawable, SpineWidgetController _controller, {BoxFit? fit, Alignment? alignment, BoundsProvider? boundsProvider, bool? sizedByBounds, Key? key})
-
Constructs a new SpineWidget from a SkeletonDrawable.
const
- SpineWidget.fromFile(String? _atlasFile, String? _skeletonFile, SpineWidgetController _controller, {BoxFit? fit, Alignment? alignment, BoundsProvider? boundsProvider, bool? sizedByBounds, Key? key})
-
Constructs a new SpineWidget from files. The
_atlasFile
specifies the.atlas
file to be loaded for the images used to render the skeleton. The_skeletonFile
specifies either a Skeleton.json
or.skel
file containing the skeleton data.const - SpineWidget.fromHttp(String? _atlasFile, String? _skeletonFile, SpineWidgetController _controller, {BoxFit? fit, Alignment? alignment, BoundsProvider? boundsProvider, bool? sizedByBounds, Key? key})
-
Constructs a new SpineWidget from HTTP URLs. The
_atlasFile
specifies the.atlas
file to be loaded for the images used to render the skeleton. The_skeletonFile
specifies either a Skeleton.json
or.skel
file containing the skeleton data.const
Properties
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< SpineWidget> -
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, int wrapWidth = 65}) → 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