Skip to content

Instantly share code, notes, and snippets.

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

Embed
What would you like to do?
class _MainPageState extends State<MainPage> with SingleTickerProviderStateMixin {
...
@override
void initState() {
...
animationController.addStatusListener((status) {
if (status == AnimationStatus.completed) {
if (currentNoteIndex == notes.length - 5) { //<--update end treshold
//song finished
}
...
}
_drawLine(int lineNumber) {
return Expanded(
child: Line(
lineNumber: lineNumber,
currentNotes: notes.sublist(currentNoteIndex, currentNoteIndex + 5), //<-- pass 5 notes
animation: animationController, //<-- pass animationController
),
);
}
}
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.