fix lyrics text not centered
This commit is contained in:
parent
1738c1bf00
commit
aaacd150a5
|
|
@ -136,9 +136,8 @@ class _LyricsWidgetState extends State<LyricsWidget>
|
||||||
//Lyric height, screen height, appbar height
|
//Lyric height, screen height, appbar height
|
||||||
final actualHeight =
|
final actualHeight =
|
||||||
height + (_showTranslation ? additionalTranslationHeight : 0.0);
|
height + (_showTranslation ? additionalTranslationHeight : 0.0);
|
||||||
// _currentIndex + 1 because there's also the initial one
|
// _currentIndex + 1 because there's also the initial one (though we need to sum half)
|
||||||
final minScroll = actualHeight * (_currentIndex + 1);
|
var scrollTo = actualHeight * (_currentIndex + 1);
|
||||||
double scrollTo = minScroll + height / 2;
|
|
||||||
|
|
||||||
if (scrollTo < 0.0) scrollTo = 0.0;
|
if (scrollTo < 0.0) scrollTo = 0.0;
|
||||||
if (scrollTo > _controller.position.maxScrollExtent) {
|
if (scrollTo > _controller.position.maxScrollExtent) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue