Skip to content

Commit

Permalink
fix(artist-page): SpotubeMarqueeText used in ArtistCard crashes the app
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Sep 13, 2022
1 parent 16064f6 commit 4279541
Showing 1 changed file with 45 additions and 22 deletions.
67 changes: 45 additions & 22 deletions lib/components/Artist/ArtistCard.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:spotify/spotify.dart';
import 'package:spotube/components/Shared/HoverBuilder.dart';
import 'package:spotube/components/Shared/SpotubeMarqueeText.dart';
import 'package:spotube/components/Shared/UniversalImage.dart';
import 'package:spotube/utils/type_conversion_utils.dart';

Expand All @@ -13,11 +12,12 @@ class ArtistCard extends StatelessWidget {

@override
Widget build(BuildContext context) {
final backgroundImage =
UniversalImage.imageProvider(TypeConversionUtils.image_X_UrlString(
artist.images,
placeholder: ImagePlaceholder.artist,
));
final backgroundImage = UniversalImage.imageProvider(
TypeConversionUtils.image_X_UrlString(
artist.images,
placeholder: ImagePlaceholder.artist,
),
);
return SizedBox(
height: 240,
width: 200,
Expand All @@ -34,32 +34,55 @@ class ArtistCard extends StatelessWidget {
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
blurRadius: 10,
offset: const Offset(0, 3),
spreadRadius: 5,
color: Theme.of(context).shadowColor)
blurRadius: 10,
offset: const Offset(0, 3),
spreadRadius: 5,
color: Theme.of(context).shadowColor,
)
],
),
child: Padding(
padding: const EdgeInsets.all(15),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
CircleAvatar(
maxRadius: 80,
minRadius: 20,
backgroundImage: backgroundImage,
Stack(
children: [
CircleAvatar(
maxRadius: 80,
minRadius: 20,
backgroundImage: backgroundImage,
),
Positioned(
right: 0,
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.blue,
borderRadius: BorderRadius.circular(50)),
child: const Text(
"Artist",
style: TextStyle(
color: Colors.white,
fontSize: 12,
fontWeight: FontWeight.bold,
),
),
),
),
],
),
SpotubeMarqueeText(
text: artist.name!,
AutoSizeText(
artist.name!,
maxLines: 2,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodyLarge!.copyWith(
fontWeight: FontWeight.bold,
),
isHovering: isHovering,
),
Text(
"Artist",
style: Theme.of(context).textTheme.subtitle1,
)
],
),
),
Expand Down

0 comments on commit 4279541

Please sign in to comment.