mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
Added support for marquee text on album's with long descriptions and static text for those with short ones
This commit is contained in:
parent
c27b497c4b
commit
2fd5d6fe9c
@ -1,5 +1,6 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:marquee/marquee.dart';
|
||||
|
||||
class PlaybuttonCard extends StatelessWidget {
|
||||
final void Function()? onTap;
|
||||
@ -82,7 +83,7 @@ class PlaybuttonCard extends StatelessWidget {
|
||||
const SizedBox(height: 5),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 8, vertical: 10),
|
||||
const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
child: Column(
|
||||
children: [
|
||||
Tooltip(
|
||||
@ -95,17 +96,47 @@ class PlaybuttonCard extends StatelessWidget {
|
||||
),
|
||||
if (description != null) ...[
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
SizedBox(
|
||||
height: 30,
|
||||
child: description!.length > 30
|
||||
? Marquee(
|
||||
text: description!,
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: Theme.of(context)
|
||||
.textTheme
|
||||
.headline4
|
||||
?.color,
|
||||
),
|
||||
scrollAxis: Axis.horizontal,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
blankSpace: 60.0,
|
||||
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,
|
||||
)
|
||||
: Text(
|
||||
description!,
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: Theme.of(context).textTheme.headline4?.color,
|
||||
color: Theme.of(context)
|
||||
.textTheme
|
||||
.headline4
|
||||
?.color,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
]
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
14
pubspec.lock
14
pubspec.lock
@ -169,6 +169,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.4"
|
||||
fading_edge_scrollview:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fading_edge_scrollview
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -387,6 +394,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.2"
|
||||
marquee:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: marquee
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.2.1"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -58,6 +58,7 @@ dependencies:
|
||||
just_audio_background: ^0.0.1-beta.5
|
||||
logger: ^1.1.0
|
||||
permission_handler: ^9.2.0
|
||||
marquee: ^2.2.1
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
Loading…
Reference in New Issue
Block a user