Wrap the widget using the controller in a StatefulWidget class so that you can initialise the controller there and use dispose