From 27107ad34d9418c7257fd73cf585590596259eed Mon Sep 17 00:00:00 2001 From: toly <1981462002@qq.com> Date: Tue, 2 May 2023 16:42:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A8=E7=94=BB=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/muyu/animate_text.dart | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/muyu/animate_text.dart b/lib/muyu/animate_text.dart index 94d396f..0b273c3 100644 --- a/lib/muyu/animate_text.dart +++ b/lib/muyu/animate_text.dart @@ -18,8 +18,10 @@ class _FadTextState extends State with SingleTickerProviderStateMix @override void initState() { super.initState(); - controller = AnimationController(vsync: this, duration: const Duration(milliseconds: 500)); + controller = AnimationController(vsync: this, duration: Duration(milliseconds: 500)); opacity = Tween(begin: 1.0, end: 0.0).animate(controller); + scale = Tween(begin: 1.0, end: 0.9).animate(controller); + position = Tween(begin: const Offset(0, 2), end: Offset.zero,).animate(controller); controller.forward(); } @@ -37,9 +39,14 @@ class _FadTextState extends State with SingleTickerProviderStateMix @override Widget build(BuildContext context) { - return FadeTransition( - opacity: opacity, - child: Text(widget.text), + return ScaleTransition( + scale: scale, + child: SlideTransition( + position: position, + child: FadeTransition( + opacity: opacity, + child: Text(widget.text), + )), ); } -} +} \ No newline at end of file