Added support for marquee text for the ArtistCard and made adjustments to the marquee effect in the PlayButtonCard as well

This commit is contained in:
Stelios Papamichail 2022-04-01 02:06:03 +03:00
parent 2fd5d6fe9c
commit 5df96b5892
2 changed files with 26 additions and 5 deletions

View File

@ -1,6 +1,7 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:marquee/marquee.dart';
import 'package:spotify/spotify.dart';
class ArtistCard extends StatelessWidget {
@ -41,10 +42,29 @@ class ArtistCard extends StatelessWidget {
minRadius: 20,
backgroundImage: backgroundImage,
),
Text(
SizedBox(
height: 30,
child: artist.name!.length > 15
? Marquee(
text: artist.name!,
style: Theme.of(context).textTheme.headline5,
scrollAxis: Axis.horizontal,
crossAxisAlignment: CrossAxisAlignment.start,
blankSpace: 60.0,
velocity: 30.0,
startAfter: const Duration(seconds: 2),
pauseAfterRound: const Duration(seconds: 2),
accelerationDuration: const Duration(seconds: 1),
accelerationCurve: Curves.linear,
decelerationDuration: const Duration(milliseconds: 500),
decelerationCurve: Curves.easeOut,
fadingEdgeStartFraction: 0.15,
fadingEdgeEndFraction: 0.15,
)
: Text(
artist.name!,
style: Theme.of(context).textTheme.headline5,
overflow: TextOverflow.ellipsis,
),
),
Text(
"Artist",

View File

@ -114,13 +114,14 @@ class PlaybuttonCard extends StatelessWidget {
velocity: 30.0,
startAfter: const Duration(seconds: 2),
pauseAfterRound: const Duration(seconds: 2),
startPadding: 10.0,
accelerationDuration:
const Duration(seconds: 1),
accelerationCurve: Curves.linear,
decelerationDuration:
const Duration(milliseconds: 500),
decelerationCurve: Curves.easeOut,
fadingEdgeStartFraction: 0.15,
fadingEdgeEndFraction: 0.15,
)
: Text(
description!,