diff --git a/lib/ui/player/mini_player.dart b/lib/ui/player/mini_player.dart index 13402f51..7021c873 100644 --- a/lib/ui/player/mini_player.dart +++ b/lib/ui/player/mini_player.dart @@ -60,10 +60,10 @@ class MiniPlayer extends StatelessWidget { .inactiveTrackColor, bufferedBarColor: Theme.of(context) .sliderTheme - .activeTrackColor, + .valueIndicatorColor, progressBarColor: Theme.of(context) .sliderTheme - .valueIndicatorColor, + .activeTrackColor, thumbColor: Theme.of(context).sliderTheme.thumbColor, timeLabelTextStyle: @@ -249,7 +249,8 @@ class MiniPlayer extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ Container( - padding: const EdgeInsets.only(right: 20,left: 10), + padding: const EdgeInsets.only( + right: 20, left: 10), height: 20, width: 180, child: Obx(() { @@ -264,7 +265,8 @@ class MiniPlayer extends StatelessWidget { child: Icon( volume == 0 ? Icons.volume_off - : volume > 0 && volume < 50 + : volume > 0 && + volume < 50 ? Icons.volume_down : Icons.volume_up, size: 20, @@ -274,7 +276,6 @@ class MiniPlayer extends StatelessWidget { child: SliderTheme( data: SliderTheme.of(context) .copyWith( - activeTrackColor: Colors.white, trackHeight: 2, thumbShape: const RoundSliderThumbShape( @@ -285,9 +286,12 @@ class MiniPlayer extends StatelessWidget { overlayRadius: 10.0), ), child: Slider( - value: playerController.volume.value/100, + value: playerController + .volume.value / + 100, onChanged: (value) { - playerController.setVolume((value*100).toInt()); + playerController.setVolume( + (value * 100).toInt()); }, ), ), diff --git a/lib/ui/player/player.dart b/lib/ui/player/player.dart index 60925e4f..05e7fd2f 100644 --- a/lib/ui/player/player.dart +++ b/lib/ui/player/player.dart @@ -439,9 +439,9 @@ class Player extends StatelessWidget { baseBarColor: Theme.of(context).sliderTheme.inactiveTrackColor, bufferedBarColor: - Theme.of(context).sliderTheme.activeTrackColor, - progressBarColor: Theme.of(context).sliderTheme.valueIndicatorColor, + progressBarColor: + Theme.of(context).sliderTheme.activeTrackColor, thumbColor: Theme.of(context).sliderTheme.thumbColor, timeLabelTextStyle: Theme.of(context).textTheme.titleMedium, diff --git a/lib/ui/screens/PlaylistNAlbum/playlistnalbum_screen_controller.dart b/lib/ui/screens/PlaylistNAlbum/playlistnalbum_screen_controller.dart index 0cba9a8d..0a424081 100644 --- a/lib/ui/screens/PlaylistNAlbum/playlistnalbum_screen_controller.dart +++ b/lib/ui/screens/PlaylistNAlbum/playlistnalbum_screen_controller.dart @@ -116,10 +116,11 @@ class PlayListNAlbumScreenController extends GetxController { Future fetchSongsfromDatabase(id) async { box = await Hive.openBox(id); - songList.value = box.values + final List songList_ = box.values .map((item) => MediaItemBuilder.fromJson(item)) .whereType() .toList(); + songList.value = id == "LIBRP" ? songList_.reversed.toList() : songList_; isContentFetched.value = true; checkDownloadStatus(); } @@ -312,7 +313,7 @@ class PlayListNAlbumScreenController extends GetxController { songList.removeWhere((song) => song.id == element.id); } - if (!isoffline) await box_.close(); + if (!isoffline) await box_.close(); } List selectedSongs() { diff --git a/lib/ui/utils/theme_controller.dart b/lib/ui/utils/theme_controller.dart index e067c03b..653c47a5 100644 --- a/lib/ui/utils/theme_controller.dart +++ b/lib/ui/utils/theme_controller.dart @@ -91,7 +91,7 @@ class ThemeController extends GetxController { ); final baseTheme = ThemeData( - useMaterial3: false, + useMaterial3: false, primaryColor: primarySwatch![500], colorScheme: ColorScheme.fromSwatch( accentColor: primarySwatch[200], @@ -128,6 +128,15 @@ class ThemeController extends GetxController { letterSpacing: 1, fontWeight: FontWeight.bold), ), + switchTheme: SwitchThemeData( + thumbColor: MaterialStateProperty.resolveWith( + (Set states) { + if (states.contains(MaterialState.selected)) { + return primarySwatch[100]!.withLightness(50); + } + return Colors.white.withOpacity(0.3); + }), + ), indicatorColor: Colors.white, progressIndicatorTheme: ProgressIndicatorThemeData( linearTrackColor: (primarySwatch[300])!.computeLuminance() > 0.3 @@ -146,8 +155,8 @@ class ThemeController extends GetxController { color: primarySwatch[100], fontWeight: FontWeight.bold)), sliderTheme: SliderThemeData( inactiveTrackColor: primarySwatch[300], - activeTrackColor: primarySwatch[400], - valueIndicatorColor: textColor, + activeTrackColor: textColor, + valueIndicatorColor: primarySwatch[400], thumbColor: Colors.white, ) //scaffoldBackgroundColor: primarySwatch[700] @@ -166,7 +175,7 @@ class ThemeController extends GetxController { systemNavigationBarContrastEnforced: true), ); final baseTheme = ThemeData( - useMaterial3: false, + useMaterial3: false, brightness: Brightness.dark, canvasColor: Colors.black, primaryColor: Colors.black, @@ -210,11 +219,20 @@ class ThemeController extends GetxController { //base bar color inactiveTrackColor: Colors.white30, //buffered progress - activeTrackColor: Colors.black38, + activeTrackColor: Colors.white, //progress bar color - valueIndicatorColor: Colors.white, + valueIndicatorColor: Colors.black38, thumbColor: Colors.white, ), + switchTheme: SwitchThemeData( + thumbColor: MaterialStateProperty.resolveWith( + (Set states) { + if (states.contains(MaterialState.selected)) { + return Colors.white.withLightness(50); + } + return Colors.white.withOpacity(0.3); + }), + ), inputDecorationTheme: const InputDecorationTheme( focusColor: Colors.white, focusedBorder: UnderlineInputBorder( @@ -233,7 +251,7 @@ class ThemeController extends GetxController { systemNavigationBarContrastEnforced: false), ); final baseTheme = ThemeData( - useMaterial3: false, + useMaterial3: false, brightness: Brightness.light, canvasColor: Colors.white, colorScheme: ColorScheme.fromSwatch( @@ -273,15 +291,24 @@ class ThemeController extends GetxController { color: Colors.grey[800], fontWeight: FontWeight.bold)), bottomSheetTheme: const BottomSheetThemeData( backgroundColor: Colors.white, modalBarrierColor: Colors.white), - sliderTheme: SliderThemeData( + sliderTheme:SliderThemeData( //base bar color inactiveTrackColor: Colors.black38, //buffered progress - activeTrackColor: Colors.white38, + activeTrackColor: Colors.grey[800], //progress bar color - valueIndicatorColor: Colors.grey[800], + valueIndicatorColor: Colors.white38, thumbColor: Colors.grey[800], ), + switchTheme: SwitchThemeData( + thumbColor: MaterialStateProperty.resolveWith( + (Set states) { + if (states.contains(MaterialState.selected)) { + return Colors.white.withLightness(50); + } + return Colors.grey.withOpacity(0.3); + }), + ), inputDecorationTheme: const InputDecorationTheme( focusColor: Colors.black, focusedBorder: UnderlineInputBorder(