mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-08-05 18:20:10 +08:00
@@ -46,12 +46,7 @@ class PayCoinsPage extends StatefulWidget {
|
||||
transitionDuration: const Duration(milliseconds: 225),
|
||||
transitionBuilder: (context, animation, secondaryAnimation, child) {
|
||||
return FadeTransition(
|
||||
opacity: animation.drive(
|
||||
Tween<double>(
|
||||
begin: 0.0,
|
||||
end: 1.0,
|
||||
).chain(CurveTween(curve: Curves.linear)),
|
||||
),
|
||||
opacity: animation,
|
||||
child: child,
|
||||
);
|
||||
},
|
||||
@@ -73,9 +68,8 @@ class _PayCoinsPageState extends State<PayCoinsPage>
|
||||
late final Animation<Offset> _slide22Anim;
|
||||
late final AnimationController _scale22Controller;
|
||||
late final Animation<double> _scale22Anim;
|
||||
late final AnimationController _coinSlideController;
|
||||
late final AnimationController _coinController;
|
||||
late final Animation<Offset> _coinSlideAnim;
|
||||
late final AnimationController _coinFadeController;
|
||||
late final Animation<double> _coinFadeAnim;
|
||||
late final AnimationController _boxAnimController;
|
||||
late final Animation<Offset> _boxAnim;
|
||||
@@ -155,7 +149,7 @@ class _PayCoinsPageState extends State<PayCoinsPage>
|
||||
duration: const Duration(milliseconds: 50),
|
||||
);
|
||||
_slide22Anim = _slide22Controller.drive(
|
||||
Tween(
|
||||
Tween<Offset>(
|
||||
begin: Offset.zero,
|
||||
end: const Offset(0.0, -0.2),
|
||||
),
|
||||
@@ -165,32 +159,30 @@ class _PayCoinsPageState extends State<PayCoinsPage>
|
||||
duration: const Duration(milliseconds: 50),
|
||||
);
|
||||
_scale22Anim = _scale22Controller.drive(
|
||||
Tween(begin: 1, end: 1.1),
|
||||
Tween<double>(begin: 1.0, end: 1.1),
|
||||
);
|
||||
_coinSlideController = AnimationController(
|
||||
_coinController = AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
duration: const Duration(milliseconds: 300),
|
||||
);
|
||||
_coinSlideAnim = _coinSlideController.drive(
|
||||
Tween(
|
||||
_coinSlideAnim = _coinController.drive(
|
||||
Tween<Offset>(
|
||||
begin: Offset.zero,
|
||||
end: const Offset(0.0, -2),
|
||||
),
|
||||
end: const Offset(0.0, -2.0),
|
||||
).chain(CurveTween(curve: const Interval(0.0, 2 / 3))),
|
||||
);
|
||||
_coinFadeController = AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(milliseconds: 100),
|
||||
_coinFadeAnim = _coinController.drive(
|
||||
Tween<double>(
|
||||
begin: 1.0,
|
||||
end: 0.0,
|
||||
).chain(CurveTween(curve: const Interval(2 / 3, 1.0))),
|
||||
);
|
||||
_coinFadeAnim = Tween<double>(
|
||||
begin: 1,
|
||||
end: 0,
|
||||
).animate(_coinFadeController);
|
||||
_boxAnimController = AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(milliseconds: 50),
|
||||
);
|
||||
_boxAnim = _boxAnimController.drive(
|
||||
Tween(
|
||||
Tween<Offset>(
|
||||
begin: Offset.zero,
|
||||
end: const Offset(0.0, -0.2),
|
||||
),
|
||||
@@ -204,8 +196,7 @@ class _PayCoinsPageState extends State<PayCoinsPage>
|
||||
_cancelTimer();
|
||||
_slide22Controller.dispose();
|
||||
_scale22Controller.dispose();
|
||||
_coinSlideController.dispose();
|
||||
_coinFadeController.dispose();
|
||||
_coinController.dispose();
|
||||
_boxAnimController.dispose();
|
||||
_controller?.dispose();
|
||||
super.dispose();
|
||||
@@ -570,11 +561,9 @@ class _PayCoinsPageState extends State<PayCoinsPage>
|
||||
});
|
||||
}
|
||||
_boxAnimController.forward().whenComplete(_boxAnimController.reverse);
|
||||
_coinSlideController.forward().whenComplete(() {
|
||||
_coinFadeController.forward().whenComplete(() {
|
||||
Get.back();
|
||||
widget.onPayCoin(_pageIndex.value + 1, _coinWithLike.value);
|
||||
});
|
||||
_coinController.forward().whenComplete(() {
|
||||
Get.back();
|
||||
widget.onPayCoin(_pageIndex.value + 1, _coinWithLike.value);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user