Skip to content

Commit

Permalink
Scrollbar error fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Komodo5197 committed Mar 16, 2024
1 parent 5f58b03 commit d8a24c7
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 67 deletions.
126 changes: 62 additions & 64 deletions lib/components/AlbumScreen/album_screen_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,73 +61,71 @@ class _AlbumScreenContentState extends State<AlbumScreenContent> {
}
}

return Scrollbar(
child: CustomScrollView(
slivers: [
SliverAppBar(
title: Text(widget.parent.name ??
AppLocalizations.of(context)!.unknownName),
// 125 + 64 is the total height of the widget we use as a
// FlexibleSpaceBar. We add the toolbar height since the widget
// should appear below the appbar.
// TODO: This height is affected by platform density.
expandedHeight: kToolbarHeight + 125 + 80,
collapsedHeight: kToolbarHeight + 125 + 80,
pinned: true,
flexibleSpace: AlbumScreenContentFlexibleSpaceBar(
parentItem: widget.parent,
isPlaylist: widget.parent.type == "Playlist",
items: widget.queueChildren,
),
actions: [
if (widget.parent.type == "Playlist" &&
!FinampSettingsHelper.finampSettings.isOffline)
PlaylistNameEditButton(playlist: widget.parent),
FavoriteButton(item: widget.parent),
DownloadButton(
item: DownloadStub.fromItem(
type: DownloadItemType.collection, item: widget.parent),
children: widget.displayChildren.length)
],
return CustomScrollView(
slivers: [
SliverAppBar(
title: Text(
widget.parent.name ?? AppLocalizations.of(context)!.unknownName),
// 125 + 64 is the total height of the widget we use as a
// FlexibleSpaceBar. We add the toolbar height since the widget
// should appear below the appbar.
// TODO: This height is affected by platform density.
expandedHeight: kToolbarHeight + 125 + 80,
collapsedHeight: kToolbarHeight + 125 + 80,
pinned: true,
flexibleSpace: AlbumScreenContentFlexibleSpaceBar(
parentItem: widget.parent,
isPlaylist: widget.parent.type == "Playlist",
items: widget.queueChildren,
),
if (widget.displayChildren.length > 1 &&
childrenPerDisc.length >
1) // show headers only for multi disc albums
for (var childrenOfThisDisc in childrenPerDisc)
SliverStickyHeader(
header: Container(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 16.0,
),
color: Theme.of(context).colorScheme.surfaceVariant,
child: Text(
AppLocalizations.of(context)!
.discNumber(childrenOfThisDisc[0].parentIndexNumber!),
style: const TextStyle(fontSize: 20.0),
),
actions: [
if (widget.parent.type == "Playlist" &&
!FinampSettingsHelper.finampSettings.isOffline)
PlaylistNameEditButton(playlist: widget.parent),
FavoriteButton(item: widget.parent),
DownloadButton(
item: DownloadStub.fromItem(
type: DownloadItemType.collection, item: widget.parent),
children: widget.displayChildren.length)
],
),
if (widget.displayChildren.length > 1 &&
childrenPerDisc.length >
1) // show headers only for multi disc albums
for (var childrenOfThisDisc in childrenPerDisc)
SliverStickyHeader(
header: Container(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 16.0,
),
sliver: SongsSliverList(
childrenForList: childrenOfThisDisc,
childrenForQueue: Future.value(widget.queueChildren),
parent: widget.parent,
onRemoveFromList: onDelete,
color: Theme.of(context).colorScheme.surfaceVariant,
child: Text(
AppLocalizations.of(context)!
.discNumber(childrenOfThisDisc[0].parentIndexNumber!),
style: const TextStyle(fontSize: 20.0),
),
)
else if (widget.displayChildren.isNotEmpty)
SongsSliverList(
childrenForList: widget.displayChildren,
childrenForQueue: Future.value(widget.queueChildren),
parent: widget.parent,
onRemoveFromList: onDelete,
),
SliverToBoxAdapter(
child: Container(
height: MediaQuery.paddingOf(context).bottom,
),
)
],
),
),
sliver: SongsSliverList(
childrenForList: childrenOfThisDisc,
childrenForQueue: Future.value(widget.queueChildren),
parent: widget.parent,
onRemoveFromList: onDelete,
),
)
else if (widget.displayChildren.isNotEmpty)
SongsSliverList(
childrenForList: widget.displayChildren,
childrenForQueue: Future.value(widget.queueChildren),
parent: widget.parent,
onRemoveFromList: onDelete,
),
SliverToBoxAdapter(
child: Container(
height: MediaQuery.paddingOf(context).bottom,
),
)
],
);
}
}
Expand Down
5 changes: 2 additions & 3 deletions lib/components/ArtistScreen/artist_screen_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ class _ArtistScreenContentState extends State<ArtistScreenContent> {
return sortedsongs;
});

return Scrollbar(
child: CustomScrollView(slivers: <Widget>[
return CustomScrollView(slivers: <Widget>[
SliverAppBar(
title: Text(widget.parent.name ??
AppLocalizations.of(context)!.unknownName),
Expand Down Expand Up @@ -185,7 +184,7 @@ class _ArtistScreenContentState extends State<ArtistScreenContent> {
height: MediaQuery.paddingOf(context).bottom,
),
)
]));
]);
});
}
}

0 comments on commit d8a24c7

Please sign in to comment.