From 94af3c35e879d14445eae247744e5f3900ad5d83 Mon Sep 17 00:00:00 2001 From: Chaphasilor Date: Sun, 10 Nov 2024 14:39:45 +0100 Subject: [PATCH] use SliverFixedExtentList on album screen --- lib/components/AlbumScreen/album_screen_content.dart | 5 ++++- lib/components/AlbumScreen/track_list_tile.dart | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/components/AlbumScreen/album_screen_content.dart b/lib/components/AlbumScreen/album_screen_content.dart index 78566df8..b751b7bd 100644 --- a/lib/components/AlbumScreen/album_screen_content.dart +++ b/lib/components/AlbumScreen/album_screen_content.dart @@ -175,7 +175,10 @@ class _SongsSliverListState extends State { ), ); } - 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 diff --git a/lib/components/AlbumScreen/track_list_tile.dart b/lib/components/AlbumScreen/track_list_tile.dart index 8b4bbf1b..7bb297c6 100644 --- a/lib/components/AlbumScreen/track_list_tile.dart +++ b/lib/components/AlbumScreen/track_list_tile.dart @@ -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) { @@ -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),