diff --git a/lib/ui/player_screen.dart b/lib/ui/player_screen.dart index 9bf567a..81648a0 100644 --- a/lib/ui/player_screen.dart +++ b/lib/ui/player_screen.dart @@ -337,7 +337,7 @@ class PlayerScreenDesktop extends StatelessWidget { Flexible( child: ConstrainedBox( constraints: BoxConstraints.loose(const Size.square(500)), - child: const BigAlbumArt()), + child: const BigAlbumArt(showLyricsButton: false)), ), Padding( padding: const EdgeInsets.symmetric(horizontal: 24.0), @@ -843,7 +843,8 @@ class PlaybackControls extends StatelessWidget { } class BigAlbumArt extends StatefulWidget { - const BigAlbumArt({super.key}); + final bool showLyricsButton; + const BigAlbumArt({super.key, this.showLyricsButton = true}); @override State createState() => _BigAlbumArtState(); @@ -968,51 +969,52 @@ class _BigAlbumArtState extends State with WidgetsBindingObserver { ), )); }), - StreamBuilder( - initialData: audioHandler.mediaItem.valueOrNull, - stream: audioHandler.mediaItem, - builder: (context, snapshot) { - if (snapshot.data == null) return const SizedBox.shrink(); + if (widget.showLyricsButton) + StreamBuilder( + initialData: audioHandler.mediaItem.valueOrNull, + stream: audioHandler.mediaItem, + builder: (context, snapshot) { + if (snapshot.data == null) return const SizedBox.shrink(); - print(snapshot.data!.extras); - final l = snapshot.data!.extras?['lyrics'] == null - ? null - : Lyrics.fromJson( - jsonDecode(snapshot.data!.extras!['lyrics'])); + print(snapshot.data!.extras); + final l = snapshot.data!.extras?['lyrics'] == null + ? null + : Lyrics.fromJson( + jsonDecode(snapshot.data!.extras!['lyrics'])); - if (l == null || l.id == null || l.id == '0') { - return const SizedBox.shrink(); - } + if (l == null || l.id == null || l.id == '0') { + return const SizedBox.shrink(); + } - return Positioned( - key: const ValueKey('lyrics_button'), - bottom: 16.0, - right: 16.0, - child: Consumer( - builder: (context, provider, child) => Material( - color: Color.lerp( - Theme.of(context).colorScheme.background, - provider.dominantColor, - 0.25), - borderRadius: BorderRadius.circular(16.0), - clipBehavior: Clip.antiAlias, - child: child), - child: InkWell( - onTap: _pushLyrics, - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 12.0, vertical: 4.0), - child: Row(mainAxisSize: MainAxisSize.min, children: [ - const Icon(Icons.subtitles, size: 18.0), - const SizedBox(width: 8.0), - Text('Lyrics'.i18n), - ]), + return Positioned( + key: const ValueKey('lyrics_button'), + bottom: 16.0, + right: 16.0, + child: Consumer( + builder: (context, provider, child) => Material( + color: Color.lerp( + Theme.of(context).colorScheme.background, + provider.dominantColor, + 0.25), + borderRadius: BorderRadius.circular(16.0), + clipBehavior: Clip.antiAlias, + child: child), + child: InkWell( + onTap: _pushLyrics, + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 12.0, vertical: 4.0), + child: Row(mainAxisSize: MainAxisSize.min, children: [ + const Icon(Icons.subtitles, size: 18.0), + const SizedBox(width: 8.0), + Text('Lyrics'.i18n), + ]), + ), ), ), - ), - ); - }, - ), + ); + }, + ), ], ), ); @@ -1257,7 +1259,6 @@ class BottomBarControls extends StatelessWidget { children: [ QualityInfoWidget(textSize: size * 0.75), const Expanded(child: SizedBox()), - IconButton( icon: Icon( Icons.sentiment_very_dissatisfied,