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(); _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 @override
@@ -86,31 +97,12 @@ class InteractiveViewerBoundaryState extends State<InteractiveViewerBoundary>
void _updateMoveAnimation() { void _updateMoveAnimation() {
final double endX = _offset.dx.sign * (_offset.dx.abs() / _offset.dy.abs()); final double endX = _offset.dx.sign * (_offset.dx.abs() / _offset.dy.abs());
final double endY = _offset.dy.sign; final double endY = _offset.dy.sign;
_slideAnimation = _animateController.drive( _slideAnimation = _animateController.drive(
Tween<Offset>( Tween<Offset>(
begin: Offset.zero, begin: Offset.zero,
end: Offset(endX, endY), 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) { void _handleDragStart(ScaleStartDetails details) {

View File

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

View File

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

View File

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

View File

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

View File

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