The method 'ControlledAnimation' isn't defined for the type 'LogoState'

Issue

Widget _buildAnimatedLogo() {
    return ControlledAnimation( //<-- The method 'ControlledAnimation' isn't defined for the type 'LogoState'
      duration: widget.logoAnimationTween.duration,
      tween: widget.logoAnimationTween,
      builder: (context, animation) {
        return Transform.rotate(
          angle: animation["rotation"],
          child: Padding(
            padding: const EdgeInsets.only(
              bottom: 10,
            ),
            child: Container(
              width: animation["size"],
              height: animation["size"],
              child: Image.asset(
                "assets/images/logo.png",
                fit: BoxFit.fitHeight,
              ),
            ),
          ),
        );
      },
    );
  }

I am using simple_animations: ^3.0.1, not sure if I am using the wrong class "ControlledAnimation"

Solution

You migrated to a newer version.

Change that with ControlledAnimation -> PlayAnimation.

Check the official example

Answered By – Shreyash Jain

Answer Checked By – Senaida (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *