From ef09224e84ea0b8d0755755f4d8ef89e6802f173 Mon Sep 17 00:00:00 2001 From: Valeri Gokadze Date: Thu, 30 May 2024 09:58:16 +0400 Subject: [PATCH] Improve: Improved shuffle and repeat buttons on now playing page --- lib/screens/now_playing_page.dart | 80 +++++++++++++++++++------------ 1 file changed, 50 insertions(+), 30 deletions(-) diff --git a/lib/screens/now_playing_page.dart b/lib/screens/now_playing_page.dart index 8b7dd5f6a..34e7d2b13 100644 --- a/lib/screens/now_playing_page.dart +++ b/lib/screens/now_playing_page.dart @@ -286,22 +286,31 @@ class NowPlayingPage extends StatelessWidget { ValueListenableBuilder( valueListenable: shuffleNotifier, builder: (_, value, __) { - return IconButton.filled( - icon: Icon( - value - ? FluentIcons.arrow_shuffle_24_filled - : FluentIcons.arrow_shuffle_off_24_filled, - color: _secondaryColor, - ), - iconSize: iconSize, - onPressed: () { - audioHandler.setShuffleMode( - value - ? AudioServiceShuffleMode.none - : AudioServiceShuffleMode.all, - ); - }, - ); + return value + ? IconButton.filled( + icon: Icon( + FluentIcons.arrow_shuffle_24_filled, + color: _secondaryColor, + ), + iconSize: iconSize, + onPressed: () { + audioHandler.setShuffleMode( + AudioServiceShuffleMode.none, + ); + }, + ) + : IconButton.filledTonal( + icon: Icon( + FluentIcons.arrow_shuffle_off_24_filled, + color: _primaryColor, + ), + iconSize: iconSize, + onPressed: () { + audioHandler.setShuffleMode( + AudioServiceShuffleMode.all, + ); + }, + ); }, ), Row( @@ -346,20 +355,31 @@ class NowPlayingPage extends StatelessWidget { ValueListenableBuilder( valueListenable: repeatNotifier, builder: (_, value, __) { - return IconButton.filled( - icon: Icon( - value - ? FluentIcons.arrow_repeat_1_24_filled - : FluentIcons.arrow_repeat_all_off_24_filled, - color: _secondaryColor, - ), - iconSize: iconSize, - onPressed: () => audioHandler.setRepeatMode( - value - ? AudioServiceRepeatMode.none - : AudioServiceRepeatMode.all, - ), - ); + return value + ? IconButton.filled( + icon: Icon( + FluentIcons.arrow_repeat_1_24_filled, + color: _secondaryColor, + ), + iconSize: iconSize, + onPressed: () { + audioHandler.setRepeatMode( + AudioServiceRepeatMode.none, + ); + }, + ) + : IconButton.filledTonal( + icon: Icon( + FluentIcons.arrow_repeat_all_off_24_filled, + color: _primaryColor, + ), + iconSize: iconSize, + onPressed: () { + audioHandler.setRepeatMode( + AudioServiceRepeatMode.all, + ); + }, + ); }, ), ],