feat(PlayerView): shortcut button for opening lyrics #273

This commit is contained in:
Kingkor Roy Tirtho 2022-10-24 18:09:24 +06:00
parent 6b6907af3f
commit 1d4847ab0a
2 changed files with 13 additions and 0 deletions

View File

@ -14,9 +14,11 @@ import 'package:spotube/utils/type_conversion_utils.dart';
class PlayerActions extends HookConsumerWidget { class PlayerActions extends HookConsumerWidget {
final MainAxisAlignment mainAxisAlignment; final MainAxisAlignment mainAxisAlignment;
final bool floatingQueue; final bool floatingQueue;
final List<Widget>? extraActions;
PlayerActions({ PlayerActions({
this.mainAxisAlignment = MainAxisAlignment.center, this.mainAxisAlignment = MainAxisAlignment.center,
this.floatingQueue = true, this.floatingQueue = true,
this.extraActions,
Key? key, Key? key,
}) : super(key: key); }) : super(key: key);
final logger = getLogger(PlayerActions); final logger = getLogger(PlayerActions);
@ -90,6 +92,7 @@ class PlayerActions extends HookConsumerWidget {
: null, : null,
), ),
if (playback.track != null) TrackHeartButton(track: playback.track!), if (playback.track != null) TrackHeartButton(track: playback.track!),
...(extraActions ?? [])
], ],
); );
} }

View File

@ -161,6 +161,16 @@ class PlayerView extends HookConsumerWidget {
PlayerActions( PlayerActions(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
floatingQueue: false, floatingQueue: false,
extraActions: [
IconButton(
tooltip: "Open Lyrics",
icon: const Icon(Icons.lyrics_rounded),
onPressed: () {
GoRouter.of(context).pop();
GoRouter.of(context).go('/lyrics');
},
)
],
), ),
PlayerControls(iconColor: paletteColor.bodyTextColor), PlayerControls(iconColor: paletteColor.bodyTextColor),
], ],