mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-16 09:05:16 +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.1 KiB
Dart
94 lines
3.1 KiB
Dart
import 'package:flutter/gestures.dart';
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
import 'package:shadcn_flutter/shadcn_flutter.dart';
|
|
import 'package:spotify/spotify.dart';
|
|
import 'package:spotube/collections/spotube_icons.dart';
|
|
import 'package:spotube/components/image/universal_image.dart';
|
|
import 'package:spotube/extensions/constrains.dart';
|
|
import 'package:spotube/extensions/image.dart';
|
|
import 'package:spotube/provider/spotify/spotify.dart';
|
|
import 'package:url_launcher/url_launcher_string.dart';
|
|
|
|
class ArtistPageFooter extends ConsumerWidget {
|
|
final Artist artist;
|
|
const ArtistPageFooter({super.key, required this.artist});
|
|
|
|
@override
|
|
Widget build(BuildContext context, ref) {
|
|
final ThemeData(:typography) = Theme.of(context);
|
|
final mediaQuery = MediaQuery.of(context);
|
|
|
|
final artistImage = artist.images.asUrlString(
|
|
placeholder: ImagePlaceholder.artist,
|
|
);
|
|
final summary = ref.watch(artistWikipediaSummaryProvider(artist));
|
|
if (summary.asData?.value == null) return const SizedBox.shrink();
|
|
|
|
return Container(
|
|
margin: const EdgeInsets.all(8),
|
|
padding: mediaQuery.smAndDown
|
|
? const EdgeInsets.all(20)
|
|
: const EdgeInsets.all(30),
|
|
constraints: const BoxConstraints(minHeight: 300),
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(10),
|
|
image: DecorationImage(
|
|
colorFilter: ColorFilter.mode(
|
|
Colors.black.withOpacity(0.5),
|
|
BlendMode.darken,
|
|
),
|
|
image: UniversalImage.imageProvider(
|
|
summary.asData?.value!.thumbnail?.source_ ?? artistImage,
|
|
height: summary.asData?.value!.thumbnail?.height.toDouble(),
|
|
width: summary.asData?.value!.thumbnail?.width.toDouble(),
|
|
),
|
|
fit: BoxFit.cover,
|
|
alignment: Alignment.center,
|
|
),
|
|
),
|
|
alignment: Alignment.center,
|
|
child: RichText(
|
|
text: TextSpan(
|
|
style: typography.semiBold.copyWith(
|
|
color: Colors.white,
|
|
),
|
|
children: [
|
|
// icon
|
|
const WidgetSpan(
|
|
child: Icon(
|
|
SpotubeIcons.wikipedia,
|
|
color: Colors.white,
|
|
size: 30,
|
|
),
|
|
),
|
|
TextSpan(
|
|
text: " Wikipedia",
|
|
style: typography.large.copyWith(
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
const TextSpan(text: '\n\n'),
|
|
TextSpan(
|
|
text: summary.asData?.value!.extract,
|
|
),
|
|
TextSpan(
|
|
text: '\n...read more at wikipedia',
|
|
style: typography.semiBold.copyWith(
|
|
color: Colors.sky[300],
|
|
decoration: TextDecoration.underline,
|
|
decorationColor: Colors.sky[300],
|
|
),
|
|
recognizer: TapGestureRecognizer()
|
|
..onTap = () async {
|
|
await launchUrlString(
|
|
"http://en.wikipedia.org/wiki?curid=${summary.asData?.value?.pageid}",
|
|
);
|
|
},
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|