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