FileLoader.fromAsset constructor

FileLoader.fromAsset(
  1. String asset, {
  2. required Factory riveFactory,
})

A class that loads a Rive file from an asset, URL, or file.

To be used with RiveWidgetBuilder.

  • The riveFactory parameter is the Rive factory to use to decode the Rive file, and determines the desired renderer to use.

This class caches the loaded file, and returns the same file instance for subsequent calls to file.

  • The asset parameter is the asset to load the Rive file from.

Implementation

FileLoader.fromAsset(String asset, {required this.riveFactory})
    : _asset = asset,
      _providedFile = null,
      _url = null;