Using AnimatedWidget
Separating our animation from widgets with the help of the AnimatedBuilder widget is incredibly easy and can bring up may benefits, as we have seen. Flutter offers another interesting alternative that does the same thing as the AnimatedBuilder widget with a simpler syntax.
This is common when dealing with a well-structured framework such as Flutter; there is typically more than one way of doing something, and it does not mean that there are significant differences between one way or another. AnimatedWidget and AnimatedBuilder are great examples of this. Both aim to separate the animation part from the widget building part.
While the AnimatedBuilder widget delegates the creation of the widget to a builder method, AnimatedWidget ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access