Album art not updating fix - 0.5.5

This commit is contained in:
exttex 2020-10-14 22:20:06 +02:00
parent 480800857e
commit 11d93482ff
2 changed files with 33 additions and 1 deletions

View file

@ -74,6 +74,22 @@ class _PlayerScreenHorizontalState extends State<PlayerScreenHorizontal> {
PageController _pageController = PageController(
initialPage: playerHelper.queueIndex,
);
StreamSubscription _currentItemSub;
@override
void initState() {
_currentItemSub = AudioService.currentMediaItemStream.listen((event) {
_pageController.animateToPage(playerHelper.queueIndex, duration: Duration(milliseconds: 300), curve: Curves.easeInOut);
});
super.initState();
}
@override
void dispose() {
if (_currentItemSub != null)
_currentItemSub.cancel();
super.dispose();
}
@override
Widget build(BuildContext context) {
@ -238,6 +254,22 @@ class _PlayerScreenVerticalState extends State<PlayerScreenVertical> {
PageController _pageController = PageController(
initialPage: playerHelper.queueIndex,
);
StreamSubscription _currentItemSub;
@override
void initState() {
_currentItemSub = AudioService.currentMediaItemStream.listen((event) {
_pageController.animateToPage(playerHelper.queueIndex, duration: Duration(milliseconds: 300), curve: Curves.easeInOut);
});
super.initState();
}
@override
void dispose() {
if (_currentItemSub != null)
_currentItemSub.cancel();
super.dispose();
}
@override
Widget build(BuildContext context) {