From 1d4847ab0a0b18d5bc27257b3db863b995dc5843 Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Mon, 24 Oct 2022 18:09:24 +0600 Subject: [PATCH] feat(PlayerView): shortcut button for opening lyrics #273 --- lib/components/Player/PlayerActions.dart | 3 +++ lib/components/Player/PlayerView.dart | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/lib/components/Player/PlayerActions.dart b/lib/components/Player/PlayerActions.dart index deec48c14..c129b95d1 100644 --- a/lib/components/Player/PlayerActions.dart +++ b/lib/components/Player/PlayerActions.dart @@ -14,9 +14,11 @@ import 'package:spotube/utils/type_conversion_utils.dart'; class PlayerActions extends HookConsumerWidget { final MainAxisAlignment mainAxisAlignment; final bool floatingQueue; + final List? extraActions; PlayerActions({ this.mainAxisAlignment = MainAxisAlignment.center, this.floatingQueue = true, + this.extraActions, Key? key, }) : super(key: key); final logger = getLogger(PlayerActions); @@ -90,6 +92,7 @@ class PlayerActions extends HookConsumerWidget { : null, ), if (playback.track != null) TrackHeartButton(track: playback.track!), + ...(extraActions ?? []) ], ); } diff --git a/lib/components/Player/PlayerView.dart b/lib/components/Player/PlayerView.dart index 391ae4c6c..2622de4b3 100644 --- a/lib/components/Player/PlayerView.dart +++ b/lib/components/Player/PlayerView.dart @@ -161,6 +161,16 @@ class PlayerView extends HookConsumerWidget { PlayerActions( mainAxisAlignment: MainAxisAlignment.spaceEvenly, 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), ],