一个包含很多炫酷字体动画的Flutter软件包。
安装1.添加依赖把软件包添加到pubspec.yaml文件中:
depedecies: aimated\_text\_kit: ^1.2.02.安装你可以通过下列的命令行来安装:
通过pub:
$ pub get通过Flutter:
$ flutter packages get3.引用把软件包引入到dart文件
import 'package:aimated\_text\_kit/aimated\_text\_kit.dart';用例:你可以在AimatedTextKit类中重写并设置duratio的时间。如果动画不需要重复播放,你可以改变isRepeatigAimatio为Flase:
FadeAimatedTextKit( duratio: Duratio(millisecods: 5000), isRepeatigAimatio: false, text: \["do IT!", "do it RIGHT!!", "do it RIGHT NOW!!!"\], textStyle: TextStyle(fotSize: 32.0, fotWeight: FotWeight.bold),);RotateRow( maiAxisSize: MaiAxisSize.mi, childre: <Widget>\[ SizedBox(width: 20.0, height: 100.0), Text( "Be", style: TextStyle(fotSize: 43.0), ), SizedBox(width: 20.0, height: 100.0), RotateAimatedTextKit( oTap: () { prit("Tap Evet"); }, text: \["AWESOME", "OPTIMISTIC", "DIFFERENT"\], textStyle: TextStyle(fotSize: 40.0, fotFamily: "Horizo"), ), \],);Note: 你可以通过在RotateAimatedTextKit类中设置trasitioHeight的值来改变文字变化的高度。
FadeSizedBox( width: 250.0, child: FadeAimatedTextKit( oTap: () { prit("Tap Evet"); }, text: \[ "do IT!", "do it RIGHT!!", "do it RIGHT NOW!!!" \], textStyle: TextStyle( fotSize: 32.0, fotWeight: FotWeight.bold ), ),);TyperSizedBox( width: 250.0, child: TyperAimatedTextKit( oTap: () { prit("Tap Evet"); }, text: \[ "It is ot eough to do your best,", "you must kow what to do,", "ad the do your best", "\- W.Edwards Demig", \], textStyle: TextStyle( fotSize: 30.0, fotFamily: "Bobbers" ), ),);TypewriterSizedBox( width: 250.0, child: TypewriterAimatedTextKit( oTap: () { prit("Tap Evet"); }, text: \[ "Disciplie is the best tool", "Desig first, the code", "Do ot patch bugs out, rewrite them", "Do ot test bugs out, desig them out", \], textStyle: TextStyle( fotSize: 30.0, fotFamily: "Age" ), ),);ScaleSizedBox( width: 250.0, child: ScaleAimatedTextKit( oTap: () { prit("Tap Evet"); }, text: \[ "Thik", "Build", "Ship" \], textStyle: TextStyle( fotSize: 70.0, fotFamily: "Caterbury" ), ),);ColorizeSizedBox( width: 250.0, child: ColorizeAimatedTextKit( oTap: () { prit("Tap Evet"); }, text: \[ "Larry Page", "Bill Gates", "Steve Jobs", \], textStyle: TextStyle( fotSize: 50.0, fotFamily: "Horizo" ), colors: \[ Colors.purple, Colors.blue, Colors.yellow, Colors.red, \], ),);Note: colors listshouldcotaisatleasttwovalues.
BugsorRequests如果你有任何问题欢迎提issue.如果你感觉这个库还需要完善欢迎提 ticket 。
LiceseAimated-Text-Kitisliceseduder MITlicese.View licese.
评论