RiveAnimation.asset constructor
const
RiveAnimation.asset(
- String asset, {
- 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,
- RiveHitTestBehavior behavior = RiveHitTestBehavior.opaque,
- ObjectGenerator? objectGenerator,
- Key? key,
Creates a new RiveAnimation from an asset bundle.
Example:
return RiveAnimation.asset('assets/truck.riv');
Implementation
const RiveAnimation.asset(
String asset, {
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,
this.behavior = RiveHitTestBehavior.opaque,
this.objectGenerator,
Key? key,
}) : name = asset,
file = null,
headers = null,
src = _Source.asset,
super(key: key);