dispose() method is in wrong position

dispose() method should be in between the initState() & didUpdateWidget() method.
Is this a convention or something like that ?
I used your package day_night_switcher for an app. https://pub.dev/packages/day_night_switcher
But when you double click on the switch, the app shift from light-to-dark and then dark-to-light continuously.
The animation controller is not disposed accurately.
This is the URL of the app: https://md-siam.github.io/puzzle_hack/
I've never encountered this problem before. Do you have a code snippet or something like that ?

The switch is turning On & Off by itself, like a loop.
Complete project URL: https://github.com/md-siam/flutter_puzzle_hack
Place dispose() method after initState()
It's just an order in the code, it doesn't have any effect while in use. But you can try it if you want by forking the project :wink:
ok