Question #292MediumFlutter Basics

in dispose in flutter stateful widget example the animation controller is called before the super.dispose() or after the super.dispose() ? and why ?

#flutter#widget#state

Answer

Overview

In Flutter, when you dispose of an

text
AnimationController
in a StatefulWidget, you must call
text
dispose()
on the controller BEFORE
text
super.dispose()
. This is the correct order and here's why.