Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-02-07 11:02:42 +08:00
parent e8145ef65a
commit d253ef468b
6 changed files with 43 additions and 38 deletions

View File

@@ -75,6 +75,17 @@ class InteractiveViewerBoundaryState extends State<InteractiveViewerBoundary>
);
_updateMoveAnimation();
_scaleAnimation = _animateController.drive(
Tween<double>(begin: 1.0, end: 0.25),
);
_opacityAnimation = _animateController.drive(
DecorationTween(
begin: const BoxDecoration(color: Colors.black),
end: const BoxDecoration(color: Colors.transparent),
),
);
}
@override
@@ -86,31 +97,12 @@ class InteractiveViewerBoundaryState extends State<InteractiveViewerBoundary>
void _updateMoveAnimation() {
final double endX = _offset.dx.sign * (_offset.dx.abs() / _offset.dy.abs());
final double endY = _offset.dy.sign;
_slideAnimation = _animateController.drive(
Tween<Offset>(
begin: Offset.zero,
end: Offset(endX, endY),
),
);
_scaleAnimation = _animateController.drive(
Tween<double>(
begin: 1.0,
end: 0.25,
),
);
_opacityAnimation = _animateController.drive(
DecorationTween(
begin: const BoxDecoration(
color: Colors.black,
),
end: const BoxDecoration(
color: Colors.transparent,
),
),
);
}
void _handleDragStart(ScaleStartDetails details) {

View File

@@ -36,12 +36,7 @@ class _DynamicsTabPageState
DynamicsController dynamicsController = Get.putOrFind(DynamicsController.new);
@override
late final DynamicsTabController controller = Get.putOrFind(
() =>
DynamicsTabController(dynamicsType: widget.dynamicsType)
..mid = dynamicsController.mid.value,
tag: widget.dynamicsType.name,
);
late final DynamicsTabController controller;
@override
bool get wantKeepAlive => true;
@@ -68,6 +63,12 @@ class _DynamicsTabPageState
@override
void initState() {
controller = Get.putOrFind(
() =>
DynamicsTabController(dynamicsType: widget.dynamicsType)
..mid = dynamicsController.mid.value,
tag: widget.dynamicsType.name,
);
super.initState();
if (widget.dynamicsType == DynamicsTabType.up) {
_listener = dynamicsController.mid.listen((mid) {

View File

@@ -33,13 +33,19 @@ class _MemberContributeState extends State<MemberContribute>
@override
bool get wantKeepAlive => true;
late final _controller = Get.putOrFind(
late final MemberContributeCtr _controller;
@override
void initState() {
super.initState();
_controller = Get.putOrFind(
() => MemberContributeCtr(
heroTag: widget.heroTag,
initialIndex: widget.initialIndex,
),
tag: widget.heroTag,
);
}
@override
Widget build(BuildContext context) {

View File

@@ -20,7 +20,7 @@ class MusicRecommendPage extends StatefulWidget {
class _MusicRecommendPageState extends State<MusicRecommendPage>
with GridMixin {
late final MusicRecommendController _controller = Get.putOrFind(
final MusicRecommendController _controller = Get.putOrFind(
MusicRecommendController.new,
tag: (Get.arguments as MusicRecommendArgs).id,
);

View File

@@ -40,7 +40,7 @@ class MusicDetailPage extends StatefulWidget {
class _MusicDetailPageState extends CommonDynPageState<MusicDetailPage> {
@override
late final MusicDetailController controller = Get.putOrFind(
final MusicDetailController controller = Get.putOrFind(
MusicDetailController.new,
tag: Get.parameters['musicId']!,
);

View File

@@ -16,10 +16,16 @@ class RelatedVideoPanel extends StatefulWidget {
}
class _RelatedVideoPanelState extends State<RelatedVideoPanel> with GridMixin {
late final RelatedController _relatedController = Get.putOrFind(
late final RelatedController _relatedController;
@override
void initState() {
super.initState();
_relatedController = Get.putOrFind(
RelatedController.new,
tag: widget.heroTag,
);
}
@override
Widget build(BuildContext context) {