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