-
-
Save MarcinusX/aceec4d12fa5779f575aef2feab54b90 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class _MainPageState extends State<MainPage> with SingleTickerProviderStateMixin { | |
... | |
void _restart() { | |
setState(() { | |
hasStarted = false; | |
isPlaying = true; | |
notes = initNotes(); | |
points = 0; | |
currentNoteIndex = 0; | |
}); | |
animationController.reset(); | |
} | |
void _showFinishDialog() { | |
showDialog( | |
... | |
).then((_) => _restart()); //<-- restart game when dialog is closed | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment