mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-21 17:46:24 +08:00
opt marquee
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -80,8 +80,9 @@ class _MusicDetailPageState extends CommonDynPageState<MusicDetailPage> {
|
||||
children: [
|
||||
NetworkImgLayer(
|
||||
src: info.data.mvCover,
|
||||
width: 40,
|
||||
height: 40,
|
||||
width: 36,
|
||||
height: 36,
|
||||
type: ImageType.avatar,
|
||||
),
|
||||
Text(info.data.musicTitle!),
|
||||
],
|
||||
@@ -456,7 +457,7 @@ class _MusicDetailPageState extends CommonDynPageState<MusicDetailPage> {
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: MarqueeText(
|
||||
item.musicTitle!,
|
||||
maxWidth: maxWidth - 136, // 80 + 16 + 32 + 8
|
||||
spacing: 30,
|
||||
style: textTheme.titleMedium,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -114,8 +114,9 @@ class MusicVideoCardH extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 3),
|
||||
BounceMarquee(
|
||||
NormalMarquee(
|
||||
velocity: 25,
|
||||
spacing: 30,
|
||||
child: Row(
|
||||
spacing: 8,
|
||||
children: [
|
||||
|
||||
@@ -83,6 +83,9 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
||||
Timer? clock;
|
||||
bool get isFullScreen => plPlayerController.isFullScreen.value;
|
||||
Box setting = GStorage.setting;
|
||||
MarqueeController? marqueeController;
|
||||
MarqueeController get _marqueeController =>
|
||||
marqueeController ??= MarqueeController(autoStart: false);
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -97,6 +100,8 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
||||
@override
|
||||
void dispose() {
|
||||
clock?.cancel();
|
||||
marqueeController?.dispose();
|
||||
marqueeController = null;
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -1911,35 +1916,30 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
||||
padding: isPortrait
|
||||
? EdgeInsets.zero
|
||||
: const EdgeInsets.only(right: 10),
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
return Obx(
|
||||
() {
|
||||
final videoDetail =
|
||||
introController.videoDetail.value;
|
||||
final String title;
|
||||
if (videoDetail.videos == 1) {
|
||||
title = videoDetail.title!;
|
||||
} else {
|
||||
title =
|
||||
videoDetail.pages
|
||||
?.firstWhereOrNull(
|
||||
(e) =>
|
||||
e.cid == videoDetailCtr.cid.value,
|
||||
)
|
||||
?.pagePart ??
|
||||
videoDetail.title!;
|
||||
}
|
||||
return MarqueeText(
|
||||
title,
|
||||
maxWidth: constraints.maxWidth,
|
||||
spacing: 30,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Obx(
|
||||
() {
|
||||
final videoDetail = introController.videoDetail.value;
|
||||
final String title;
|
||||
if (videoDetail.videos == 1) {
|
||||
title = videoDetail.title!;
|
||||
} else {
|
||||
title =
|
||||
videoDetail.pages
|
||||
?.firstWhereOrNull(
|
||||
(e) => e.cid == videoDetailCtr.cid.value,
|
||||
)
|
||||
?.pagePart ??
|
||||
videoDetail.title!;
|
||||
}
|
||||
return MarqueeText(
|
||||
title,
|
||||
spacing: 30,
|
||||
velocity: 30,
|
||||
controller: _marqueeController,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user