findLyricIndexByDuration method
Implementation
int findLyricIndexByDuration(Duration curDuration, List<Lyric> lyrics) {
for (int i = 0; i < lyrics.length; i++) {
if (curDuration >= lyrics[i].startTime! &&
curDuration <= lyrics[i].endTime!) {
return i;
}
}
return 0;
}