mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-12-07 07:49:43 +00:00
Configuration File Removals:
.vscode/c_cpp_properties.json: Removed the entire configuration for C/C++ properties.
.vscode/launch.json: Removed the Dart launch configurations for different environments and modes.
.vscode/settings.json: Removed settings related to CMake, spell checking, file nesting, and Dart Flutter SDK path.
.vscode/snippets.code-snippets: Removed code snippets for Dart, including PaginatedState and PaginatedNotifier templates.
.vscode/tasks.json: Removed the tasks configuration file.
Documentation Updates:
CONTRIBUTION.md: Removed heart emoji from the introductory text.
README.md: Updated the logo image and made minor text adjustments, including removing emojis and updating section titles. [1] [2] [3] [4] [5]
Asset Removals:
lib/collections/assets.gen.dart: Removed multiple unused asset references, including images related to Spotube logos and banners. [1] [2] [3]
Minor Code Cleanups:
cli/commands/build/linux.dart, cli/commands/build/windows.dart, cli/commands/translated.dart, cli/commands/untranslated.dart: Adjusted import statements for consistency. [1] [2] [3] [4]
integration_test/app_test.dart: Removed an unnecessary blank line.
lib/collections/routes.dart: Commented out the TrackRoute configuration.
120 lines
3.9 KiB
Dart
120 lines
3.9 KiB
Dart
import 'package:auto_route/auto_route.dart';
|
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
import 'package:shadcn_flutter/shadcn_flutter.dart' hide Consumer;
|
|
import 'package:shadcn_flutter/shadcn_flutter_extension.dart';
|
|
import 'package:spotube/components/image/universal_image.dart';
|
|
import 'package:spotube/components/titlebar/titlebar.dart';
|
|
import 'package:spotube/extensions/context.dart';
|
|
import 'package:spotube/extensions/image.dart';
|
|
import 'package:spotube/hooks/utils/use_palette_color.dart';
|
|
import 'package:spotube/pages/lyrics/plain_lyrics.dart';
|
|
import 'package:spotube/pages/lyrics/synced_lyrics.dart';
|
|
import 'package:spotube/provider/audio_player/audio_player.dart';
|
|
import 'package:spotube/provider/spotify/spotify.dart';
|
|
import 'package:spotube/utils/platform.dart';
|
|
|
|
@RoutePage()
|
|
class LyricsPage extends HookConsumerWidget {
|
|
static const name = "lyrics";
|
|
|
|
const LyricsPage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context, ref) {
|
|
final playlist = ref.watch(audioPlayerProvider);
|
|
String albumArt = useMemoized(
|
|
() => (playlist.activeTrack?.album?.images).asUrlString(
|
|
index: (playlist.activeTrack?.album?.images?.length ?? 1) - 1,
|
|
placeholder: ImagePlaceholder.albumArt,
|
|
),
|
|
[playlist.activeTrack?.album?.images],
|
|
);
|
|
final palette = usePaletteColor(albumArt, ref);
|
|
final selectedIndex = useState(0);
|
|
|
|
Widget tabbar = Padding(
|
|
padding: const EdgeInsets.all(10),
|
|
child: Tabs(
|
|
index: selectedIndex.value,
|
|
onChanged: (index) => selectedIndex.value = index,
|
|
children: [
|
|
TabItem(child: Text(context.l10n.synced)),
|
|
TabItem(child: Text(context.l10n.plain)),
|
|
],
|
|
),
|
|
);
|
|
|
|
tabbar = Row(
|
|
children: [
|
|
tabbar,
|
|
const Spacer(),
|
|
Consumer(
|
|
builder: (context, ref, child) {
|
|
final playback = ref.watch(audioPlayerProvider);
|
|
final lyric = ref.watch(syncedLyricsProvider(playback.activeTrack));
|
|
final providerName = lyric.asData?.value.provider;
|
|
|
|
if (providerName == null) {
|
|
return const SizedBox.shrink();
|
|
}
|
|
|
|
return Align(
|
|
alignment: Alignment.bottomRight,
|
|
child: Text(context.l10n.powered_by_provider(providerName)),
|
|
);
|
|
},
|
|
),
|
|
const Gap(5),
|
|
],
|
|
);
|
|
|
|
return SafeArea(
|
|
bottom: false,
|
|
child: Scaffold(
|
|
floatingHeader: true,
|
|
headers: [
|
|
!kIsMacOS
|
|
? TitleBar(
|
|
backgroundColor: Colors.transparent,
|
|
title: tabbar,
|
|
height: 58 * context.theme.scaling,
|
|
surfaceBlur: 0,
|
|
automaticallyImplyLeading: false,
|
|
)
|
|
: tabbar
|
|
],
|
|
child: Container(
|
|
clipBehavior: Clip.hardEdge,
|
|
decoration: BoxDecoration(
|
|
image: DecorationImage(
|
|
image: UniversalImage.imageProvider(albumArt),
|
|
fit: BoxFit.cover,
|
|
),
|
|
),
|
|
margin: const EdgeInsets.only(bottom: 10),
|
|
child: SurfaceCard(
|
|
surfaceBlur: context.theme.surfaceBlur,
|
|
surfaceOpacity: context.theme.surfaceOpacity,
|
|
padding: EdgeInsets.zero,
|
|
borderRadius: BorderRadius.zero,
|
|
borderWidth: 0,
|
|
child: ColoredBox(
|
|
color: palette.color.withOpacity(.7),
|
|
child: SafeArea(
|
|
child: IndexedStack(
|
|
index: selectedIndex.value,
|
|
children: [
|
|
SyncedLyrics(palette: palette, isModal: false),
|
|
PlainLyrics(palette: palette, isModal: false),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|