SpineWidget.fromHttp constructor

const SpineWidget.fromHttp(
  1. String? _atlasFile,
  2. String? _skeletonFile,
  3. SpineWidgetController _controller, {
  4. BoxFit? fit,
  5. Alignment? alignment,
  6. BoundsProvider? boundsProvider,
  7. bool? sizedByBounds,
  8. 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.

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.fromHttp(this._atlasFile, this._skeletonFile, this._controller,
    {BoxFit? fit, Alignment? alignment, BoundsProvider? boundsProvider, bool? sizedByBounds, super.key})
    : _assetType = _AssetType.http,
      _bundle = null,
      _fit = fit ?? BoxFit.contain,
      _alignment = alignment ?? Alignment.center,
      _boundsProvider = boundsProvider ?? const SetupPoseBounds(),
      _sizedByBounds = sizedByBounds ?? false,
      _drawable = null;