[英]How to animate TextSpan or part of a text in Flutter like in this game screenshot?
您是否有关于如何在 Flutter 中为 TextSpan 或部分文本设置动画以达到与此游戏截图相同的效果的任何指示?
我知道如何用打字机效果为整个文本设置动画,但不知道如何只为部分文本设置动画。
任何帮助将不胜感激。 非常感谢!
有一些包可以做到这一点,例如https://www.geeksforgeeks.org/animated-text-in-flutter/使用animated_text_kit
AnimatedTextKit(
animatedTexts: [
TyperAnimatedText('This is Animated text,',
textStyle: const TextStyle(
color: Colors.white,
fontSize: 30,
backgroundColor: Colors.purple)),
TyperAnimatedText('You are viewing it here.',
textStyle: const TextStyle(
fontSize: 20, fontWeight: FontWeight.bold)),
],
onTap: () {
print("I am executing");
},
),
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.