mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-30 23:58:13 +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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user