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 defines everything needed with relation to the animation and we simply need to override its build() method to reflect animation updates...