Skip to content

Commit f29234c

Browse files
committed
fix: corrected playlist display logic and border radius handling (#478)
1 parent 34cb4a0 commit f29234c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/screens/library_page.dart

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ class _LibraryPageState extends State<LibraryPage> {
7878
}
7979

8080
Widget _buildUserPlaylistsSection(Color primaryColor) {
81+
final isUserPlaylistsEmpty =
82+
userPlaylists.isEmpty && userCustomPlaylists.isEmpty;
8183
return Column(
8284
children: [
8385
Row(
@@ -114,7 +116,9 @@ class _LibraryPageState extends State<LibraryPage> {
114116
onPressed: () =>
115117
NavigationManager.router.go('/library/userSongs/offline'),
116118
cubeIcon: FluentIcons.cellular_off_24_filled,
117-
borderRadius: commonCustomBarRadiusLast,
119+
borderRadius: isUserPlaylistsEmpty
120+
? commonCustomBarRadiusLast
121+
: BorderRadius.zero,
118122
),
119123
],
120124
),
@@ -171,14 +175,17 @@ class _LibraryPageState extends State<LibraryPage> {
171175
}
172176

173177
Widget _buildPlaylistListView(BuildContext context, List playlists) {
178+
final _length = playlists.length + 3;
174179
return ListView.builder(
175180
shrinkWrap: true,
176181
physics: const NeverScrollableScrollPhysics(),
177182
itemCount: playlists.length,
178183
padding: commonListViewBottmomPadding,
179184
itemBuilder: (BuildContext context, index) {
180185
final playlist = playlists[index];
181-
final borderRadius = getItemBorderRadius(index, playlists.length);
186+
final _index = index +
187+
3; // as we have three more automatically generated playlists
188+
final borderRadius = getItemBorderRadius(_index, _length);
182189
return PlaylistBar(
183190
key: ValueKey(playlist['ytid']),
184191
playlist['title'],

0 commit comments

Comments
 (0)