Skip to content

Commit

Permalink
fix: corrected playlist display logic and border radius handling (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
gokadzev committed Dec 25, 2024
1 parent 34cb4a0 commit f29234c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/screens/library_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ class _LibraryPageState extends State<LibraryPage> {
}

Widget _buildUserPlaylistsSection(Color primaryColor) {
final isUserPlaylistsEmpty =
userPlaylists.isEmpty && userCustomPlaylists.isEmpty;
return Column(
children: [
Row(
Expand Down Expand Up @@ -114,7 +116,9 @@ class _LibraryPageState extends State<LibraryPage> {
onPressed: () =>
NavigationManager.router.go('/library/userSongs/offline'),
cubeIcon: FluentIcons.cellular_off_24_filled,
borderRadius: commonCustomBarRadiusLast,
borderRadius: isUserPlaylistsEmpty
? commonCustomBarRadiusLast
: BorderRadius.zero,
),
],
),
Expand Down Expand Up @@ -171,14 +175,17 @@ class _LibraryPageState extends State<LibraryPage> {
}

Widget _buildPlaylistListView(BuildContext context, List playlists) {
final _length = playlists.length + 3;
return ListView.builder(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemCount: playlists.length,
padding: commonListViewBottmomPadding,
itemBuilder: (BuildContext context, index) {
final playlist = playlists[index];
final borderRadius = getItemBorderRadius(index, playlists.length);
final _index = index +
3; // as we have three more automatically generated playlists
final borderRadius = getItemBorderRadius(_index, _length);
return PlaylistBar(
key: ValueKey(playlist['ytid']),
playlist['title'],
Expand Down

0 comments on commit f29234c

Please sign in to comment.