RiveComponent constructor

RiveComponent({
  1. required Artboard artboard,
  2. bool antialiasing = true,
  3. BoxFit fit = BoxFit.contain,
  4. Alignment alignment = Alignment.center,
  5. Vector2? position,
  6. Vector2? size,
  7. Vector2? scale,
  8. double? angle = 0.0,
  9. Anchor? anchor = Anchor.topLeft,
  10. Iterable<Component>? children,
  11. int? priority,
  12. ComponentKey? key,
})

Implementation

RiveComponent({
  required this.artboard,
  bool antialiasing = true,
  BoxFit fit = BoxFit.contain,
  Alignment alignment = Alignment.center,

  // position component arguments
  super.position,

  /// The logical size of the component.
  /// Default value is ArtboardSize
  Vector2? size,
  super.scale,
  super.angle = 0.0,
  super.anchor = Anchor.topLeft,
  super.children,
  super.priority,
  super.key,
})  : _renderer = RiveArtboardRenderer(
        antialiasing: antialiasing,
        fit: fit,
        alignment: alignment,
        artboard: artboard,
      ),
      super(size: size ?? Vector2(artboard.width, artboard.height)) {
  void updateRenderSize() {
    _renderSize = this.size.toSize();
  }

  this.size.addListener(updateRenderSize);
  updateRenderSize();
}