mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-14 08:25:16 +00:00
feat: show album release year (#387) and fix layout of artist's album
This commit is contained in:
parent
623d171d79
commit
6a6ddf6e1f
@ -33,35 +33,36 @@ class ArtistAlbumList extends HookConsumerWidget {
|
||||
? false
|
||||
: (albumsQuery.pages.last.items?.length ?? 0) == 5;
|
||||
|
||||
return SizedBox(
|
||||
height: 300,
|
||||
child: ScrollConfiguration(
|
||||
behavior: ScrollConfiguration.of(context).copyWith(
|
||||
dragDevices: {
|
||||
PointerDeviceKind.touch,
|
||||
PointerDeviceKind.mouse,
|
||||
},
|
||||
),
|
||||
child: Scrollbar(
|
||||
interactive: false,
|
||||
controller: scrollController,
|
||||
child: Waypoint(
|
||||
return Column(
|
||||
children: [
|
||||
ScrollConfiguration(
|
||||
behavior: ScrollConfiguration.of(context).copyWith(
|
||||
dragDevices: {
|
||||
PointerDeviceKind.touch,
|
||||
PointerDeviceKind.mouse,
|
||||
},
|
||||
),
|
||||
child: Scrollbar(
|
||||
interactive: false,
|
||||
controller: scrollController,
|
||||
onTouchEdge: albumsQuery.fetchNext,
|
||||
child: ListView.builder(
|
||||
itemCount: albums.length,
|
||||
child: Waypoint(
|
||||
controller: scrollController,
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemBuilder: (context, index) {
|
||||
if (index == albums.length - 1 && hasNextPage) {
|
||||
return const ShimmerPlaybuttonCard(count: 1);
|
||||
}
|
||||
return AlbumCard(albums[index]);
|
||||
},
|
||||
onTouchEdge: albumsQuery.fetchNext,
|
||||
child: SingleChildScrollView(
|
||||
controller: scrollController,
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
...albums.map((album) => AlbumCard(album)),
|
||||
if (hasNextPage) const ShimmerPlaybuttonCard(count: 1),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
|
||||
import 'package:spotube/collections/assets.gen.dart';
|
||||
import 'package:spotube/collections/spotube_icons.dart';
|
||||
import 'package:spotube/components/album/album_card.dart';
|
||||
import 'package:spotube/components/shared/compact_search.dart';
|
||||
import 'package:spotube/components/shared/shimmers/shimmer_track_tile.dart';
|
||||
import 'package:spotube/components/shared/page_window_title_bar.dart';
|
||||
@ -284,6 +285,17 @@ class TrackCollectionView<T> extends HookConsumerWidget {
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
if (album != null)
|
||||
Text(
|
||||
"${AlbumType.from(album?.albumType).formatted} • Released • ${DateTime.tryParse(
|
||||
album?.releaseDate ?? "",
|
||||
)?.year}",
|
||||
style:
|
||||
theme.textTheme.titleMedium!.copyWith(
|
||||
color: color?.titleTextColor,
|
||||
fontWeight: FontWeight.normal,
|
||||
),
|
||||
),
|
||||
if (description != null)
|
||||
Text(
|
||||
description!,
|
||||
|
@ -34,6 +34,7 @@ class ArtistPage extends HookConsumerWidget {
|
||||
SpotifyApi spotify = ref.watch(spotifyProvider);
|
||||
final parentScrollController = useScrollController();
|
||||
final theme = Theme.of(context);
|
||||
final scaffoldMessenger = ScaffoldMessenger.of(context);
|
||||
final textTheme = theme.textTheme;
|
||||
final chipTextVariant = useBreakpointValue(
|
||||
sm: textTheme.bodySmall,
|
||||
@ -126,7 +127,7 @@ class ArtistPage extends HookConsumerWidget {
|
||||
BorderRadius.circular(50)),
|
||||
child: Text(
|
||||
data.type!.toUpperCase(),
|
||||
style: chipTextVariant?.copyWith(
|
||||
style: chipTextVariant.copyWith(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
@ -142,7 +143,7 @@ class ArtistPage extends HookConsumerWidget {
|
||||
BorderRadius.circular(50)),
|
||||
child: Text(
|
||||
"Blacklisted",
|
||||
style: chipTextVariant?.copyWith(
|
||||
style: chipTextVariant.copyWith(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
@ -262,8 +263,7 @@ class ArtistPage extends HookConsumerWidget {
|
||||
text: data.externalUrls?.spotify),
|
||||
);
|
||||
|
||||
ScaffoldMessenger.of(context)
|
||||
.showSnackBar(
|
||||
scaffoldMessenger.showSnackBar(
|
||||
const SnackBar(
|
||||
width: 300,
|
||||
behavior: SnackBarBehavior.floating,
|
||||
@ -334,7 +334,7 @@ class ArtistPage extends HookConsumerWidget {
|
||||
),
|
||||
onPressed: () {
|
||||
playlistNotifier.add(topTracks.toList());
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
scaffoldMessenger.showSnackBar(
|
||||
SnackBar(
|
||||
width: 300,
|
||||
behavior: SnackBarBehavior.floating,
|
||||
|
Loading…
Reference in New Issue
Block a user