Skip to content

Commit

Permalink
fix: content going below bottom player or nav bar
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Mar 11, 2023
1 parent a0b3771 commit 1bdce9f
Show file tree
Hide file tree
Showing 11 changed files with 606 additions and 577 deletions.
8 changes: 3 additions & 5 deletions lib/components/library/user_albums.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,9 @@ class UserAlbums extends HookConsumerWidget {
},
child: SingleChildScrollView(
physics: const AlwaysScrollableScrollPhysics(),
child: Material(
type: MaterialType.transparency,
color: Theme.of(context).scaffoldBackgroundColor,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: SafeArea(
child: Column(
children: [
TextField(
Expand Down
51 changes: 27 additions & 24 deletions lib/components/library/user_artists.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,31 +84,34 @@ class UserArtists extends HookConsumerWidget {
onRefresh: () async {
await artistQuery.refreshAll();
},
child: GridView.builder(
itemCount: filteredArtists.length,
physics: const AlwaysScrollableScrollPhysics(),
gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: 200,
mainAxisExtent: 250,
crossAxisSpacing: 20,
mainAxisSpacing: 20,
child: SafeArea(
child: GridView.builder(
itemCount: filteredArtists.length,
physics: const AlwaysScrollableScrollPhysics(),
gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: 200,
mainAxisExtent: 250,
crossAxisSpacing: 20,
mainAxisSpacing: 20,
),
padding: const EdgeInsets.all(10),
itemBuilder: (context, index) {
return HookBuilder(builder: (context) {
if (index == artistQuery.pages.length - 1 &&
hasNextPage) {
return Waypoint(
controller: useScrollController(),
isGrid: true,
onTouchEdge: () {
artistQuery.fetchNext();
},
child: ArtistCard(filteredArtists[index]),
);
}
return ArtistCard(filteredArtists[index]);
});
},
),
padding: const EdgeInsets.all(10),
itemBuilder: (context, index) {
return HookBuilder(builder: (context) {
if (index == artistQuery.pages.length - 1 && hasNextPage) {
return Waypoint(
controller: useScrollController(),
isGrid: true,
onTouchEdge: () {
artistQuery.fetchNext();
},
child: ArtistCard(filteredArtists[index]),
);
}
return ArtistCard(filteredArtists[index]);
});
},
),
),
);
Expand Down
58 changes: 30 additions & 28 deletions lib/components/library/user_downloads.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,38 +44,40 @@ class UserDownloads extends HookConsumerWidget {
),
),
Expanded(
child: ListView.builder(
itemCount: downloader.inQueue.length,
itemBuilder: (context, index) {
final track = downloader.inQueue.elementAt(index);
return ListTile(
title: Text(track.name ?? ''),
leading: Padding(
padding: const EdgeInsets.symmetric(horizontal: 5),
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: UniversalImage(
height: 40,
width: 40,
path: TypeConversionUtils.image_X_UrlString(
track.album?.images,
placeholder: ImagePlaceholder.albumArt,
child: SafeArea(
child: ListView.builder(
itemCount: downloader.inQueue.length,
itemBuilder: (context, index) {
final track = downloader.inQueue.elementAt(index);
return ListTile(
title: Text(track.name ?? ''),
leading: Padding(
padding: const EdgeInsets.symmetric(horizontal: 5),
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: UniversalImage(
height: 40,
width: 40,
path: TypeConversionUtils.image_X_UrlString(
track.album?.images,
placeholder: ImagePlaceholder.albumArt,
),
),
),
),
),
trailing: const SizedBox(
width: 30,
height: 30,
child: CircularProgressIndicator(),
),
subtitle: Text(
TypeConversionUtils.artists_X_String(
track.artists ?? <Artist>[],
trailing: const SizedBox(
width: 30,
height: 30,
child: CircularProgressIndicator(),
),
),
);
},
subtitle: Text(
TypeConversionUtils.artists_X_String(
track.artists ?? <Artist>[],
),
),
);
},
),
),
),
],
Expand Down
7 changes: 3 additions & 4 deletions lib/components/library/user_playlists.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,9 @@ class UserPlaylists extends HookConsumerWidget {
onRefresh: playlistsQuery.refresh,
child: SingleChildScrollView(
physics: const AlwaysScrollableScrollPhysics(),
child: Material(
type: MaterialType.transparency,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: SafeArea(
child: Column(
children: [
TextField(
Expand Down
8 changes: 6 additions & 2 deletions lib/components/shared/track_table/tracks_table_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,12 @@ class TracksTableView extends HookConsumerWidget {
];

if (isSliver) {
return SliverList(delegate: SliverChildListDelegate(children));
return SliverSafeArea(
sliver: SliverList(delegate: SliverChildListDelegate(children)),
);
}
return ListView(children: children);
return SafeArea(
child: ListView(children: children),
);
}
}
Loading

0 comments on commit 1bdce9f

Please sign in to comment.