dispose like initState and build is part of a stateful widget's lifecycle. It's called automatically by Flutter when the widget & its state are about to be destroyed.
dispose method used to release the memory allocated to variables when state object is removed.