SpineWidget.fromMemory constructor
Constructs a new SpineWidget using a custom file loading function.
This is the most flexible loading method that allows loading skeleton data from any source (memory, custom storage, network with caching, etc.).
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.fromMemory(
this._atlasFile,
this._skeletonFile,
this._loadFile,
this._controller, {
BoxFit? fit,
Alignment? alignment,
BoundsProvider? boundsProvider,
bool? sizedByBounds,
super.key,
}) : _assetType = _AssetType.memory,
_bundle = null,
_fit = fit ?? BoxFit.contain,
_alignment = alignment ?? Alignment.center,
_boundsProvider = boundsProvider ?? const SetupPoseBounds(),
_sizedByBounds = sizedByBounds ?? false,
_drawable = null;