Flutter-Buddies / tic_tac_no

Complex variants of tic-tac-toe game
MIT License
19 stars 10 forks source link

+1 animations triggering on all inner grid rebuilds #23

Closed Zambrella closed 3 years ago

Zambrella commented 3 years ago

This is happening because the animation controller.forward() is set in the build method (which is obviously bad). However, I cannot think of where else to 'listen' to the change in winning state of an inner grid in a way that only triggers once.

slovnicki commented 3 years ago

@Zambrella here's a solution: https://github.com/Flutter-Buddies/tic_tac_no/commit/4b537e6418d8668f1e2bd6987f9ffc0a54defe65