mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
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:
parent
2fd5d6fe9c
commit
5df96b5892
@ -1,6 +1,7 @@
|
|||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
import 'package:marquee/marquee.dart';
|
||||||
import 'package:spotify/spotify.dart';
|
import 'package:spotify/spotify.dart';
|
||||||
|
|
||||||
class ArtistCard extends StatelessWidget {
|
class ArtistCard extends StatelessWidget {
|
||||||
@ -41,10 +42,29 @@ class ArtistCard extends StatelessWidget {
|
|||||||
minRadius: 20,
|
minRadius: 20,
|
||||||
backgroundImage: backgroundImage,
|
backgroundImage: backgroundImage,
|
||||||
),
|
),
|
||||||
Text(
|
SizedBox(
|
||||||
artist.name!,
|
height: 30,
|
||||||
style: Theme.of(context).textTheme.headline5,
|
child: artist.name!.length > 15
|
||||||
overflow: TextOverflow.ellipsis,
|
? 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,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"Artist",
|
"Artist",
|
||||||
|
@ -114,13 +114,14 @@ class PlaybuttonCard extends StatelessWidget {
|
|||||||
velocity: 30.0,
|
velocity: 30.0,
|
||||||
startAfter: const Duration(seconds: 2),
|
startAfter: const Duration(seconds: 2),
|
||||||
pauseAfterRound: const Duration(seconds: 2),
|
pauseAfterRound: const Duration(seconds: 2),
|
||||||
startPadding: 10.0,
|
|
||||||
accelerationDuration:
|
accelerationDuration:
|
||||||
const Duration(seconds: 1),
|
const Duration(seconds: 1),
|
||||||
accelerationCurve: Curves.linear,
|
accelerationCurve: Curves.linear,
|
||||||
decelerationDuration:
|
decelerationDuration:
|
||||||
const Duration(milliseconds: 500),
|
const Duration(milliseconds: 500),
|
||||||
decelerationCurve: Curves.easeOut,
|
decelerationCurve: Curves.easeOut,
|
||||||
|
fadingEdgeStartFraction: 0.15,
|
||||||
|
fadingEdgeEndFraction: 0.15,
|
||||||
)
|
)
|
||||||
: Text(
|
: Text(
|
||||||
description!,
|
description!,
|
||||||
|
Loading…
Reference in New Issue
Block a user