mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
chore: add song link text in player view shortcut
This commit is contained in:
parent
a9a1d4c9dc
commit
b0970090b1
@ -138,12 +138,17 @@ class PlayerView extends HookConsumerWidget {
|
|||||||
onPressed: panelController.close,
|
onPressed: panelController.close,
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
IconButton(
|
TextButton.icon(
|
||||||
icon: Assets.logos.songlink.image(
|
icon: Assets.logos.songlinkTransparent.image(
|
||||||
width: 20,
|
width: 20,
|
||||||
height: 20,
|
height: 20,
|
||||||
|
color: bodyTextColor,
|
||||||
|
),
|
||||||
|
label: Text(context.l10n.song_link),
|
||||||
|
style: TextButton.styleFrom(
|
||||||
|
foregroundColor: bodyTextColor,
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
),
|
),
|
||||||
tooltip: context.l10n.song_link,
|
|
||||||
onPressed: currentTrack == null
|
onPressed: currentTrack == null
|
||||||
? null
|
? null
|
||||||
: () {
|
: () {
|
||||||
@ -157,7 +162,8 @@ class PlayerView extends HookConsumerWidget {
|
|||||||
icon: const Icon(SpotubeIcons.info, size: 18),
|
icon: const Icon(SpotubeIcons.info, size: 18),
|
||||||
tooltip: context.l10n.details,
|
tooltip: context.l10n.details,
|
||||||
style: IconButton.styleFrom(
|
style: IconButton.styleFrom(
|
||||||
foregroundColor: bodyTextColor),
|
foregroundColor: bodyTextColor,
|
||||||
|
),
|
||||||
onPressed: currentTrack == null
|
onPressed: currentTrack == null
|
||||||
? null
|
? null
|
||||||
: () {
|
: () {
|
||||||
|
@ -47,6 +47,7 @@ class AlbumPage extends HookConsumerWidget {
|
|||||||
image: TypeConversionUtils.image_X_UrlString(
|
image: TypeConversionUtils.image_X_UrlString(
|
||||||
album.images,
|
album.images,
|
||||||
placeholder: ImagePlaceholder.albumArt,
|
placeholder: ImagePlaceholder.albumArt,
|
||||||
|
index: 0,
|
||||||
),
|
),
|
||||||
title: album.name!,
|
title: album.name!,
|
||||||
description:
|
description:
|
||||||
|
@ -18,8 +18,7 @@ import 'package:flutter_desktop_tools/flutter_desktop_tools.dart';
|
|||||||
|
|
||||||
class GenrePlaylistsPage extends HookConsumerWidget {
|
class GenrePlaylistsPage extends HookConsumerWidget {
|
||||||
final Category category;
|
final Category category;
|
||||||
const GenrePlaylistsPage({Key? key, required this.category})
|
const GenrePlaylistsPage({super.key, required this.category});
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, ref) {
|
Widget build(BuildContext context, ref) {
|
||||||
@ -51,123 +50,118 @@ class GenrePlaylistsPage extends HookConsumerWidget {
|
|||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
extendBodyBehindAppBar: true,
|
extendBodyBehindAppBar: true,
|
||||||
body: CustomScrollView(
|
body: DecoratedBox(
|
||||||
controller: scrollController,
|
decoration: BoxDecoration(
|
||||||
slivers: [
|
image: DecorationImage(
|
||||||
SliverAppBar(
|
image: UniversalImage.imageProvider(category.icons!.first.url!),
|
||||||
automaticallyImplyLeading: DesktopTools.platform.isMobile,
|
alignment: Alignment.topCenter,
|
||||||
expandedHeight: mediaQuery.mdAndDown ? 200 : 150,
|
fit: BoxFit.cover,
|
||||||
pinned: true,
|
colorFilter: ColorFilter.mode(
|
||||||
floating: false,
|
Colors.black.withOpacity(0.5),
|
||||||
title: const Text(""),
|
BlendMode.darken,
|
||||||
backgroundColor: Colors.brown.withOpacity(0.7),
|
),
|
||||||
flexibleSpace: FlexibleSpaceBar(
|
repeat: ImageRepeat.noRepeat,
|
||||||
stretchModes: const [
|
matchTextDirection: true,
|
||||||
StretchMode.zoomBackground,
|
),
|
||||||
StretchMode.blurBackground,
|
),
|
||||||
],
|
child: CustomScrollView(
|
||||||
background: DecoratedBox(
|
controller: scrollController,
|
||||||
decoration: BoxDecoration(
|
slivers: [
|
||||||
image: DecorationImage(
|
SliverAppBar(
|
||||||
image: UniversalImage.imageProvider(
|
automaticallyImplyLeading: DesktopTools.platform.isMobile,
|
||||||
category.icons!.first.url!,
|
expandedHeight: mediaQuery.mdAndDown ? 200 : 150,
|
||||||
),
|
title: const Text(""),
|
||||||
fit: BoxFit.cover,
|
backgroundColor: Colors.transparent,
|
||||||
|
flexibleSpace: FlexibleSpaceBar(
|
||||||
|
centerTitle: DesktopTools.platform.isDesktop,
|
||||||
|
title: Text(
|
||||||
|
category.name!,
|
||||||
|
style: Theme.of(context).textTheme.headlineMedium?.copyWith(
|
||||||
|
color: Colors.white,
|
||||||
|
letterSpacing: 3,
|
||||||
|
shadows: [
|
||||||
|
const Shadow(
|
||||||
|
offset: Offset(-1.5, -1.5),
|
||||||
|
color: Colors.black54,
|
||||||
|
),
|
||||||
|
const Shadow(
|
||||||
|
offset: Offset(1.5, -1.5),
|
||||||
|
color: Colors.black54,
|
||||||
|
),
|
||||||
|
const Shadow(
|
||||||
|
offset: Offset(1.5, 1.5),
|
||||||
|
color: Colors.black54,
|
||||||
|
),
|
||||||
|
const Shadow(
|
||||||
|
offset: Offset(-1.5, 1.5),
|
||||||
|
color: Colors.black54,
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: BackdropFilter(
|
collapseMode: CollapseMode.parallax,
|
||||||
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
|
|
||||||
child: const ColoredBox(color: Colors.transparent),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
centerTitle: DesktopTools.platform.isDesktop,
|
|
||||||
title: Text(
|
|
||||||
category.name!,
|
|
||||||
style: Theme.of(context).textTheme.headlineMedium?.copyWith(
|
|
||||||
color: Colors.white,
|
|
||||||
letterSpacing: 3,
|
|
||||||
shadows: [
|
|
||||||
const Shadow(
|
|
||||||
offset: Offset(-1.5, -1.5),
|
|
||||||
color: Colors.black54,
|
|
||||||
),
|
|
||||||
const Shadow(
|
|
||||||
offset: Offset(1.5, -1.5),
|
|
||||||
color: Colors.black54,
|
|
||||||
),
|
|
||||||
const Shadow(
|
|
||||||
offset: Offset(1.5, 1.5),
|
|
||||||
color: Colors.black54,
|
|
||||||
),
|
|
||||||
const Shadow(
|
|
||||||
offset: Offset(-1.5, 1.5),
|
|
||||||
color: Colors.black54,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
collapseMode: CollapseMode.parallax,
|
|
||||||
),
|
),
|
||||||
),
|
const SliverGap(20),
|
||||||
const SliverGap(20),
|
SliverSafeArea(
|
||||||
SliverSafeArea(
|
top: false,
|
||||||
top: false,
|
sliver: SliverPadding(
|
||||||
sliver: SliverPadding(
|
padding: EdgeInsets.symmetric(
|
||||||
padding: EdgeInsets.symmetric(
|
horizontal: mediaQuery.mdAndDown ? 12 : 24,
|
||||||
horizontal: mediaQuery.mdAndDown ? 12 : 24,
|
),
|
||||||
),
|
sliver: playlists.isEmpty
|
||||||
sliver: playlists.isEmpty
|
? Skeletonizer.sliver(
|
||||||
? Skeletonizer.sliver(
|
child: SliverToBoxAdapter(
|
||||||
child: SliverToBoxAdapter(
|
child: Wrap(
|
||||||
child: Wrap(
|
spacing: 12,
|
||||||
spacing: 12,
|
runSpacing: 12,
|
||||||
runSpacing: 12,
|
children: List.generate(
|
||||||
children: List.generate(
|
6,
|
||||||
6,
|
(index) => PlaylistCard(FakeData.playlist),
|
||||||
(index) => PlaylistCard(FakeData.playlist),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
)
|
||||||
)
|
: SliverGrid.builder(
|
||||||
: SliverGrid.builder(
|
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
||||||
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
maxCrossAxisExtent: 190,
|
||||||
maxCrossAxisExtent: 190,
|
mainAxisExtent: mediaQuery.mdAndDown ? 225 : 250,
|
||||||
mainAxisExtent: mediaQuery.mdAndDown ? 225 : 250,
|
crossAxisSpacing: 12,
|
||||||
crossAxisSpacing: 12,
|
mainAxisSpacing: 12,
|
||||||
mainAxisSpacing: 12,
|
),
|
||||||
),
|
itemCount: playlists.length + 1,
|
||||||
itemCount: playlists.length + 1,
|
itemBuilder: (context, index) {
|
||||||
itemBuilder: (context, index) {
|
final playlist = playlists.elementAtOrNull(index);
|
||||||
final playlist = playlists.elementAtOrNull(index);
|
|
||||||
|
|
||||||
if (playlist == null) {
|
if (playlist == null) {
|
||||||
if (!playlistsQuery.hasNextPage) {
|
if (!playlistsQuery.hasNextPage) {
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
|
}
|
||||||
|
return Skeletonizer(
|
||||||
|
enabled: true,
|
||||||
|
child: Waypoint(
|
||||||
|
controller: scrollController,
|
||||||
|
isGrid: true,
|
||||||
|
onTouchEdge: () async {
|
||||||
|
if (playlistsQuery.hasNextPage) {
|
||||||
|
await playlistsQuery.fetchNext();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: PlaylistCard(FakeData.playlist),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return Skeletonizer(
|
|
||||||
enabled: true,
|
|
||||||
child: Waypoint(
|
|
||||||
controller: scrollController,
|
|
||||||
isGrid: true,
|
|
||||||
onTouchEdge: () async {
|
|
||||||
if (playlistsQuery.hasNextPage) {
|
|
||||||
await playlistsQuery.fetchNext();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: PlaylistCard(FakeData.playlist),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Skeleton.keep(
|
return Skeleton.keep(
|
||||||
child: PlaylistCard(playlist),
|
child: PlaylistCard(playlist),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
const SliverGap(20),
|
||||||
const SliverGap(20),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ import 'package:spotube/provider/user_preferences/user_preferences_provider.dart
|
|||||||
import 'package:spotube/services/queries/queries.dart';
|
import 'package:spotube/services/queries/queries.dart';
|
||||||
|
|
||||||
class GenrePage extends HookConsumerWidget {
|
class GenrePage extends HookConsumerWidget {
|
||||||
const GenrePage({Key? key}) : super(key: key);
|
const GenrePage({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, ref) {
|
Widget build(BuildContext context, ref) {
|
||||||
|
Loading…
Reference in New Issue
Block a user