RiveAnimation.direct constructor
const
RiveAnimation.direct(
- RiveFile file, {
- String? artboard,
- List<
String> animations = const [], - List<
String> stateMachines = const [], - BoxFit? fit,
- Alignment? alignment,
- Widget? placeHolder,
- bool antialiasing = true,
- bool useArtboardSize = false,
- Rect? clipRect,
- List<
RiveAnimationController> controllers = const [], - OnInitCallback? onInit,
- Key? key,
- 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);