mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-26 12:07:11 +08:00
mod: marquee use velocity
This commit is contained in:
committed by
bggRGjQaUbCoE
parent
8d94c0405f
commit
498ab2818e
@@ -19,18 +19,12 @@ class MusicRecommandPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MusicRecommandPageState extends State<MusicRecommandPage>
|
||||
with GridMixin, SingleTickerProviderStateMixin {
|
||||
with GridMixin {
|
||||
late final _controller = Get.put(
|
||||
MusicRecommendController(),
|
||||
tag: Utils.generateRandomString(8),
|
||||
);
|
||||
|
||||
late final _animation = AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(seconds: 5),
|
||||
reverseDuration: const Duration(seconds: 5),
|
||||
)..repeat(reverse: true);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
@@ -68,10 +62,8 @@ class _MusicRecommandPageState extends State<MusicRecommandPage>
|
||||
response?.isNotEmpty == true
|
||||
? SliverGrid.builder(
|
||||
gridDelegate: gridDelegate,
|
||||
itemBuilder: (context, index) => MusicVideoCardH(
|
||||
videoItem: response[index],
|
||||
animation: _animation,
|
||||
),
|
||||
itemBuilder: (context, index) =>
|
||||
MusicVideoCardH(videoItem: response[index]),
|
||||
itemCount: response!.length,
|
||||
)
|
||||
: HttpError(onReload: _controller.onReload),
|
||||
@@ -120,10 +112,4 @@ class _MusicRecommandPageState extends State<MusicRecommandPage>
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_animation.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,12 +14,10 @@ import 'package:flutter/material.dart';
|
||||
|
||||
class MusicVideoCardH extends StatelessWidget {
|
||||
final BgmRecommend videoItem;
|
||||
final Animation<double> animation;
|
||||
|
||||
const MusicVideoCardH({
|
||||
super.key,
|
||||
required this.videoItem,
|
||||
required this.animation,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -117,7 +115,7 @@ class MusicVideoCardH extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 3),
|
||||
BounceMarquee(
|
||||
animation: animation,
|
||||
velocity: 25,
|
||||
child: Row(
|
||||
spacing: 8,
|
||||
children: [
|
||||
|
||||
@@ -1933,8 +1933,6 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
||||
return MarqueeText(
|
||||
title,
|
||||
maxWidth: constraints.maxWidth,
|
||||
count: 3,
|
||||
bounce: false,
|
||||
spacing: 30,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
|
||||
Reference in New Issue
Block a user