Skip to content

Instantly share code, notes, and snippets.

@MarcinusX
Created January 13, 2019 07:50
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/6cb524656872906d8cd3b16ee73a4bef to your computer and use it in GitHub Desktop.
Save MarcinusX/6cb524656872906d8cd3b16ee73a4bef to your computer and use it in GitHub Desktop.
class _MainPageState extends State<MainPage> with SingleTickerProviderStateMixin {
...
void _onTap(Note note) {
setState(() {
note.state = NoteState.tapped; //<--set note state to tapped
});
}
_drawLine(int lineNumber) {
return Expanded(
child: Line(
lineNumber: lineNumber,
currentNotes: notes.sublist(currentNoteIndex, currentNoteIndex + 5),
onTileTap: _onTap, //<--specify onTap callback
animation: animationController,
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment