mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-16 00:55:17 +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.
94 lines
3.3 KiB
Dart
94 lines
3.3 KiB
Dart
import 'package:auto_route/auto_route.dart';
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
import 'package:shadcn_flutter/shadcn_flutter.dart';
|
|
import 'package:spotify/spotify.dart';
|
|
import 'package:spotube/collections/assets.gen.dart';
|
|
import 'package:spotube/collections/routes.gr.dart';
|
|
import 'package:spotube/components/image/universal_image.dart';
|
|
import 'package:spotube/components/links/artist_link.dart';
|
|
import 'package:spotube/components/links/link_text.dart';
|
|
import 'package:spotube/extensions/artist_simple.dart';
|
|
import 'package:spotube/extensions/constrains.dart';
|
|
import 'package:spotube/extensions/image.dart';
|
|
import 'package:spotube/provider/audio_player/audio_player.dart';
|
|
|
|
class PlayerTrackDetails extends HookConsumerWidget {
|
|
final Color? color;
|
|
final Track? track;
|
|
const PlayerTrackDetails({super.key, this.color, this.track});
|
|
|
|
@override
|
|
Widget build(BuildContext context, ref) {
|
|
final theme = Theme.of(context);
|
|
final mediaQuery = MediaQuery.of(context);
|
|
final playback = ref.watch(audioPlayerProvider);
|
|
|
|
return Row(
|
|
children: [
|
|
if (playback.activeTrack != null)
|
|
Container(
|
|
padding: const EdgeInsets.all(6),
|
|
constraints: const BoxConstraints(
|
|
maxWidth: 80,
|
|
maxHeight: 80,
|
|
),
|
|
child: ClipRRect(
|
|
borderRadius: BorderRadius.circular(4),
|
|
child: UniversalImage(
|
|
path: (track?.album?.images)
|
|
.asUrlString(placeholder: ImagePlaceholder.albumArt),
|
|
placeholder: Assets.albumPlaceholder.path,
|
|
),
|
|
),
|
|
),
|
|
if (mediaQuery.mdAndDown)
|
|
Flexible(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
const SizedBox(height: 4),
|
|
LinkText(
|
|
playback.activeTrack?.name ?? "",
|
|
TrackRoute(trackId: playback.activeTrack?.id ?? ""),
|
|
push: true,
|
|
overflow: TextOverflow.ellipsis,
|
|
style: theme.typography.normal.copyWith(
|
|
color: color,
|
|
),
|
|
),
|
|
Text(
|
|
playback.activeTrack?.artists?.asString() ?? "",
|
|
overflow: TextOverflow.ellipsis,
|
|
style: theme.typography.small.copyWith(color: color),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
if (mediaQuery.lgAndUp)
|
|
Flexible(
|
|
flex: 1,
|
|
child: Column(
|
|
children: [
|
|
LinkText(
|
|
playback.activeTrack?.name ?? "",
|
|
TrackRoute(trackId: playback.activeTrack?.id ?? ""),
|
|
push: true,
|
|
overflow: TextOverflow.ellipsis,
|
|
style: TextStyle(fontWeight: FontWeight.bold, color: color),
|
|
),
|
|
ArtistLink(
|
|
artists: playback.activeTrack?.artists ?? [],
|
|
onRouteChange: (route) {
|
|
context.router.navigateNamed(route);
|
|
},
|
|
onOverflowArtistClick: () =>
|
|
context.navigateTo(TrackRoute(trackId: track!.id!)),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|