Skip to content

Instantly share code, notes, and snippets.

@MarcinusX MarcinusX/main.dart Secret
Created Jan 14, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.