FileLoader.fromFile constructor

FileLoader.fromFile(
  1. File file, {
  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 file parameter is the file to load the Rive file from.

Implementation

FileLoader.fromFile(rive.File file, {required this.riveFactory})
    : _providedFile = file,
      _asset = null,
      _url = null;