SpineWidget.fromDrawable constructor
const
SpineWidget.fromDrawable(
- SkeletonDrawable? _drawable,
- SpineWidgetController _controller, {
- BoxFit? fit,
- Alignment? alignment,
- BoundsProvider? boundsProvider,
- bool? sizedByBounds,
- Key? key,
Constructs a new SpineWidget from a SkeletonDrawable.
After initialization is complete, the provided _controller
is invoked as per the SpineWidgetController semantics, to allow
modifying how the skeleton inside the widget is animated and rendered.
The skeleton is fitted and aligned inside the widget as per the fit
and alignment
arguments. For this purpose, the skeleton
bounds must be computed via a BoundsProvider. By default, BoxFit.contain, Alignment.center, and a SetupPoseBounds provider
are used.
The widget can optionally by sized by the bounds provided by the BoundsProvider by passing true
for sizedByBounds
.
Implementation
const SpineWidget.fromDrawable(this._drawable, this._controller,
{BoxFit? fit, Alignment? alignment, BoundsProvider? boundsProvider, bool? sizedByBounds, super.key})
: _assetType = _AssetType.drawable,
_bundle = null,
_fit = fit ?? BoxFit.contain,
_alignment = alignment ?? Alignment.center,
_boundsProvider = boundsProvider ?? const SetupPoseBounds(),
_sizedByBounds = sizedByBounds ?? false,
_skeletonFile = null,
_atlasFile = null;