Skip to content

Commit

Permalink
修复部分歌词缺少最后一行的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhoucheng133 committed Nov 15, 2024
1 parent e2fcf01 commit f91e9c5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/pages/playing.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import 'package:netplayer_mobile/variables/ls_var.dart';
import 'package:netplayer_mobile/variables/player_var.dart';
import 'package:netplayer_mobile/variables/user_var.dart';
import 'package:scroll_to_index/scroll_to_index.dart';
import 'package:shared_preferences/shared_preferences.dart';

class Playing extends StatefulWidget {
const Playing({super.key});
Expand Down Expand Up @@ -69,8 +70,12 @@ class _PlayingState extends State<Playing> {
bool flag=false;
try {
flag=p.playProgress.value>=p.lyric[index]['time'] && p.playProgress<p.lyric[index+1]['time'];
} catch (e) {
flag=false;
} catch (_) {
if(p.lyric.length==index+1 && p.playProgress.value>=p.lyric[index]['time']){
flag=true;
}else{
flag=false;
}
}
return flag;
}
Expand Down

0 comments on commit f91e9c5

Please sign in to comment.