addController method Null safety

bool addController(
  1. RiveAnimationController controller
)

Add an animation controller to this artboard. Playing will be scheduled if it's already playing.

Implementation

bool addController(RiveAnimationController controller) {
  if (_animationControllers.contains(controller) ||
      !controller.init(context)) {
    return false;
  }
  controller.isActiveChanged.addListener(_onControllerPlayingChanged);
  _animationControllers.add(controller);
  if (controller.isActive) {
    context.markNeedsAdvance();
  }
  return true;
}