Skip to content

Commit

Permalink
use SliverFixedExtentList on album screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaphasilor committed Nov 10, 2024
1 parent b2022e4 commit 94af3c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/components/AlbumScreen/album_screen_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ class _SongsSliverListState extends State<SongsSliverList> {
),
);
}
return SliverList(
return SliverFixedExtentList(
itemExtent: TrackListItemTile.defaultTileHeight +
TrackListItemTile.defaultTitleGap,
// return SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
// When user selects song from disc other than first, index number is
Expand Down
3 changes: 2 additions & 1 deletion lib/components/AlbumScreen/track_list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,7 @@ class TrackListItemTile extends StatelessWidget {
final void Function() onTap;

static const double defaultTileHeight = 60.0;
static const double defaultTitleGap = 10.0;

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -641,7 +642,7 @@ class TrackListItemTile extends StatelessWidget {
vertical: 0.5,
),
minVerticalPadding: 0.0,
horizontalTitleGap: 10.0,
horizontalTitleGap: defaultTitleGap,
contentPadding:
const EdgeInsets.symmetric(vertical: 0.0, horizontal: 0.0),
// tileColor: Theme.of(context).colorScheme.primary.withOpacity(0.5),
Expand Down

0 comments on commit 94af3c3

Please sign in to comment.