Skip to content

Commit

Permalink
feat(PlayerView): shortcut button for opening lyrics #273
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Oct 24, 2022
1 parent 6b6907a commit 1d4847a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/components/Player/PlayerActions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ import 'package:spotube/utils/type_conversion_utils.dart';
class PlayerActions extends HookConsumerWidget {
final MainAxisAlignment mainAxisAlignment;
final bool floatingQueue;
final List<Widget>? extraActions;
PlayerActions({
this.mainAxisAlignment = MainAxisAlignment.center,
this.floatingQueue = true,
this.extraActions,
Key? key,
}) : super(key: key);
final logger = getLogger(PlayerActions);
Expand Down Expand Up @@ -90,6 +92,7 @@ class PlayerActions extends HookConsumerWidget {
: null,
),
if (playback.track != null) TrackHeartButton(track: playback.track!),
...(extraActions ?? [])
],
);
}
Expand Down
10 changes: 10 additions & 0 deletions lib/components/Player/PlayerView.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
],
Expand Down

0 comments on commit 1d4847a

Please sign in to comment.