Skip to content

Instantly share code, notes, and snippets.

@MarcinusX
Created January 13, 2019 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarcinusX/33a6253419a79db8edd337ceebdbca6f to your computer and use it in GitHub Desktop.
Save MarcinusX/33a6253419a79db8edd337ceebdbca6f to your computer and use it in GitHub Desktop.
void _onTap(Note note) {
bool areAllPreviousTapped = notes
.sublist(0, note.orderNumber)
.every((n) => n.state == NoteState.tapped);
if (areAllPreviousTapped) {
setState(() {
note.state = NoteState.tapped;
++points;
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment