From 0964c4b74d1645524af2db3bdf860b2cac7d88c5 Mon Sep 17 00:00:00 2001 From: Sheikh Haziq Date: Wed, 10 Jul 2024 10:19:24 +0530 Subject: [PATCH] minor bug fixes --- lib/screens/browse_screen/browse_screen.dart | 1 + lib/screens/main_screen/player_screen.dart | 8 +++----- lib/screens/ytmusic_screen/youtube_history.dart | 10 +++++++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/screens/browse_screen/browse_screen.dart b/lib/screens/browse_screen/browse_screen.dart index 776fab0..5481fdd 100644 --- a/lib/screens/browse_screen/browse_screen.dart +++ b/lib/screens/browse_screen/browse_screen.dart @@ -103,6 +103,7 @@ class _BrowseScreenState extends State { return AdaptiveScaffold( appBar: AdaptiveAppBar( title: header['title'] != null ? Text(header['title']) : null, + centerTitle: true, ), body: initialLoading ? const Center(child: AdaptiveProgressRing()) diff --git a/lib/screens/main_screen/player_screen.dart b/lib/screens/main_screen/player_screen.dart index 59d3356..9d6ac86 100644 --- a/lib/screens/main_screen/player_screen.dart +++ b/lib/screens/main_screen/player_screen.dart @@ -601,11 +601,9 @@ class NameAndControls extends StatelessWidget { ? AdaptiveIcons.repeat_all : AdaptiveIcons.repeat_one, size: 30, - color: - value == LoopMode.one || value == LoopMode.all - ? (AdaptiveTheme.of(context).primaryColor) - .withOpacity(0.5) - : null, + color: value == LoopMode.off + ? Colors.white.withOpacity(0.3) + : null, ), ); }), diff --git a/lib/screens/ytmusic_screen/youtube_history.dart b/lib/screens/ytmusic_screen/youtube_history.dart index 8659b6c..2951502 100644 --- a/lib/screens/ytmusic_screen/youtube_history.dart +++ b/lib/screens/ytmusic_screen/youtube_history.dart @@ -85,10 +85,13 @@ class _YoutubeHistoryState extends State { padding: const EdgeInsets.symmetric( horizontal: 8, vertical: 8), child: Column( - children: sections.map((history) { + children: sections.indexed.map((section) { + int index = section.$1; + Map history = section.$2; return Column( children: [ - if (history['title'] != null) + if (history['title'] != null && + history['contents'].isNotEmpty) AdaptiveListTile( title: Text( history['title']!, @@ -119,7 +122,8 @@ class _YoutubeHistoryState extends State { ); if (deleted) { setState(() { - history.remove(item); + sections[index]['contents'] + .remove(item); }); } if (context.mounted) {