animation static method

SingleAnimationPainter animation(
  1. String animationName, {
  2. Fit fit = RiveDefaults.fit,
  3. Alignment alignment = RiveDefaults.alignment,
})

Creates a new SingleAnimationPainter instance.

  • animationName is the name of the animation to play.
  • fit determines how the artboard is scaled to fit its container.
  • alignment determines how the artboard is positioned within its container.

Implementation

static SingleAnimationPainter animation(
  String animationName, {
  Fit fit = RiveDefaults.fit,
  Alignment alignment = RiveDefaults.alignment,
}) =>
    SingleAnimationPainter(
      animationName,
      fit: fit,
      alignment: alignment,
    );