文字特殊效果的第三方,可以參考文檔的樣式作選擇
使用起來類似是Flutter原生的RichText & TextSpan, 但炫炮很多.
totalRepeatCount: 重複播放次數,
pause: 播放結束停幾秒再開始下一輪,
stopPauseOnTap: 點下去的時候動畫暫停,
這篇借用cached_network_image的頁,下面剩餘的空間擺
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('CachedImagePage')),
body: SafeArea(
child: SizedBox.expand(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: AnimatedTextKit(
animatedTexts: [
TypewriterAnimatedText(
'Hello world!',
textStyle: const TextStyle(
fontSize: 32.0,
fontWeight: FontWeight.bold,
),
speed: const Duration(milliseconds: 500),
),
],
totalRepeatCount: 4,
),
),
Expanded(
child: AnimatedTextKit(
animatedTexts: [
FadeAnimatedText(
'Fade First',
textStyle: TextStyle(
fontSize: 32.0, fontWeight: FontWeight.bold),
),
ScaleAnimatedText(
'Then Scale',
textStyle:
TextStyle(fontSize: 70.0, fontFamily: 'Canterbury'),
),
],
),
),
],
),
),
),
);
}
下一篇將為大家介紹 Wrap & Chip