Closed Zhoucheng133 closed 2 weeks ago
打开会黑屏一下,因为用的window_manager依赖,可以根据这个链接的Hidden at launch方法去除开屏的黑块
谢谢 pr。看起来没什么问题,可以马上合并。
另外 issue 是误操作连接上了吗?我不认为这个 pr 与 #79 相关。
pubspec 那个文件都是 flutter pub add 的时候修改的,我完全没注意过这个问题。后面我再看看。
和关联的那个无关 打#没注意链接上了:(
感觉 contains 是不必要的,按照审查要求改一下就好🤔。
不对,使用原来的:
var lrcTimeString = line.substring(
line.indexOf("[") + 1,
line.indexOf("]"),
)
如果没有],那么后面那个是-1,substring不能用负数作为参数,而且必须大于等于line.indexOf("[") + 1
不对,使用原来的:
var lrcTimeString = line.substring( line.indexOf("[") + 1, line.indexOf("]"), )
如果没有],那么后面那个是-1,substring不能用负数作为参数,而且必须大于等于line.indexOf("[") + 1
这样改就好
final left = line.indexOf("[");
final right = line.indexOf("]");
if (left == -1 || right == -1) return null;
var lrcTimeString = line.substring(
left + 1,
right
);
这样也可以吧:D 另外把fromLrcText返回值改为Lrc?来返回null以通过其它方式获取歌词
这样也可以吧:D 另外把fromLrcText返回值改为Lrc?来返回null以通过其它方式获取歌词
这个可以。另外通过其他方式获取歌词是指什么
fromLrcText这个不加?
怎么返回null哇
你在lyric_service中在调用Lrc.fromAudioPath(nowPlaying)
的时候,若返回值为null,在本地歌词优先的情况下会从getMostMatchedLyric
这个方法中获取歌词(应该是在线歌词?),如果getMostMatchedLyric(nowPlaying)
和Lrc.fromAudioPath(nowPlaying)
都为null,那么lyricNullable
在vertical_lyric_view里为空(也就是都没有获取到歌词),根据下面的判定则显示无歌词界面
if(本地歌词优先){
if(本地歌词结果为空){
if(网络歌词结果为空){
显示无歌词
}else{
显示网络歌词
}
}else{
显示本地歌词
}
}else{
上面顺序反过来
}
fromAudioPath
这个方法本来就是Lrc?
,你把内层的Lrc.fromLrcText
也改成Lrc?
不影响结果,只是没有匹配到[]
的时候会返回null罢了
顺便一提调用fromLrcText
没怎么看懂为啥类的内部为啥要<类名>.<方法名>
,直接<方法名>
就可以了
是这种意思🧐没问题。另外多写类名应该是我顺手写了。先不改吧(
还有一个部署遇到的问题:在
pubspec.yaml
中最好修改一下:不然新获取的版本不符合会报错