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( PageController _pageController = PageController(
initialPage: playerHelper.queueIndex, 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -238,6 +254,22 @@ class _PlayerScreenVerticalState extends State<PlayerScreenVertical> {
PageController _pageController = PageController( PageController _pageController = PageController(
initialPage: playerHelper.queueIndex, 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

View File

@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at # Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 0.5.4+1 version: 0.5.5+1
environment: environment:
sdk: ">=2.8.0 <3.0.0" sdk: ">=2.8.0 <3.0.0"