Flutter AnimatedContainer vs AnimationController

588

Solution 1

AnimatedContainer is used for getting things done fast and for simple uses because it uses implicit animations to animate the change in its properties like a change in color or size (width,height) So it makes the animation for you and you don't need to worry or write boilerplate

However, AnimationController is used when you need more control on the animation you want to create and when the animation is complex in this case you will need to do an explicit animation( i.e. using a controller and animation object explicitly and not implicitly as in case of AnimatedContainer) now I could provide you with an example code but it would be better if you check this series of videos from official flutter team that explains the difference and when to use each one

Solution 2

its like comparing TextFormField and TextEditingController

they are not the same, they cannot be used to achieve the same goal

Share:
588
Ruan
Author by

Ruan

Updated on December 02, 2022

Comments

  • Ruan
    Ruan over 1 year

    I can't find the difference between the two, and why you would want to use one above the other.

    The way I see it, both of them pretty much does the same thing.

    Why and where would you use one above the other?