RiveAnimation.direct constructor

const RiveAnimation.direct(
  1. RiveFile file, {
  2. String? artboard,
  3. List<String> animations = const [],
  4. List<String> stateMachines = const [],
  5. BoxFit? fit,
  6. Alignment? alignment,
  7. Widget? placeHolder,
  8. bool antialiasing = true,
  9. bool useArtboardSize = false,
  10. Rect? clipRect,
  11. List<RiveAnimationController> controllers = const [],
  12. OnInitCallback? onInit,
  13. Key? key,
  14. RiveHitTestBehavior behavior = RiveHitTestBehavior.opaque,
})

Creates a new RiveAnimation from a direct RiveFile object

Example:

final riveFile = await RiveFile.asset('assets/truck.riv');
...
return RiveAnimation.direct(riveFile);

Implementation

const RiveAnimation.direct(
  RiveFile this.file, {
  this.artboard,
  this.animations = const [],
  this.stateMachines = const [],
  this.fit,
  this.alignment,
  this.placeHolder,
  this.antialiasing = true,
  this.useArtboardSize = false,
  this.clipRect,
  this.controllers = const [],
  this.onInit,
  Key? key,
  this.behavior = RiveHitTestBehavior.opaque,
})  : name = null,
      headers = null,
      objectGenerator = null,
      src = _Source.direct,
      super(key: key);