DayNightSwitcher icon indicating copy to clipboard operation
DayNightSwitcher copied to clipboard

dispose() method is in wrong position

Open md-siam opened this issue 3 years ago • 7 comments

code

dispose() method should be in between the initState() & didUpdateWidget() method.

md-siam avatar Mar 23 '22 10:03 md-siam

Is this a convention or something like that ?

Skyost avatar Mar 25 '22 17:03 Skyost

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/

md-siam avatar Mar 26 '22 14:03 md-siam

I've never encountered this problem before. Do you have a code snippet or something like that ?

Skyost avatar Apr 03 '22 13:04 Skyost

ezgif com-gif-maker

The switch is turning On & Off by itself, like a loop.

Complete project URL: https://github.com/md-siam/flutter_puzzle_hack

md-siam avatar Apr 03 '22 21:04 md-siam

Place dispose() method after initState()

md-siam avatar Apr 10 '22 23:04 md-siam

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:

Skyost avatar Apr 11 '22 14:04 Skyost

ok

md-siam avatar Apr 12 '22 18:04 md-siam