Animated-Text-Kit Flutter 字体动画包开源项目

我要开发同款
匿名用户2018年12月18日
50阅读
开发技术Dart
所属分类其他
授权协议MIT

作品详情

一个包含很多炫酷字体动画的Flutter软件包。

安装1.添加依赖

把软件包添加到pubspec.yaml文件中:

dependencies: animated\_text\_kit: ^1.2.0

2.安装

你可以通过下列的命令行来安装:

通过pub:

$ pub get

通过Flutter:

$ flutter packages get

3.引用

把软件包引入到dart文件

import 'package:animated\_text\_kit/animated\_text\_kit.dart';

用例:

你可以在AnimatedTextKit类中重写并设置duration的时间。如果动画不需要重复播放,你可以改变isRepeatingAnimation为Flase:

FadeAnimatedTextKit(  duration: Duration(milliseconds: 5000),  isRepeatingAnimation: false,  text: \["do IT!", "do it RIGHT!!", "do it RIGHT NOW!!!"\],  textStyle: TextStyle(fontSize: 32.0, fontWeight: FontWeight.bold),);

Rotate

Row(  mainAxisSize: MainAxisSize.min,  children: <Widget>\[    SizedBox(width: 20.0, height: 100.0),    Text(      "Be",      style: TextStyle(fontSize: 43.0),    ),    SizedBox(width: 20.0, height: 100.0),    RotateAnimatedTextKit(      onTap: () {        print("Tap Event");      },      text: \["AWESOME", "OPTIMISTIC", "DIFFERENT"\],      textStyle: TextStyle(fontSize: 40.0, fontFamily: "Horizon"),    ),  \],);

Note: 你可以通过在RotateAnimatedTextKit类中设置transitionHeight的值来改变文字变化的高度。

Fade

SizedBox(  width: 250.0,  child: FadeAnimatedTextKit(    onTap: () {        print("Tap Event");      },    text: \[      "do IT!",      "do it RIGHT!!",      "do it RIGHT NOW!!!"    \],    textStyle: TextStyle(        fontSize: 32.0,         fontWeight: FontWeight.bold    ),  ),);

Typer

SizedBox(  width: 250.0,  child: TyperAnimatedTextKit(    onTap: () {        print("Tap Event");      },    text: \[      "It is not enough to do your best,",      "you must know what to do,",      "and then do your best",      "\- W.Edwards Deming",    \],    textStyle: TextStyle(        fontSize: 30.0,        fontFamily: "Bobbers"    ),  ),);

Typewriter

SizedBox(  width: 250.0,  child: TypewriterAnimatedTextKit(    onTap: () {        print("Tap Event");      },    text: \[      "Discipline is the best tool",      "Design first, then code",      "Do not patch bugs out, rewrite them",      "Do not test bugs out, design them out",    \],    textStyle: TextStyle(        fontSize: 30.0,        fontFamily: "Agne"    ),  ),);

Scale

SizedBox(  width: 250.0,  child: ScaleAnimatedTextKit(    onTap: () {        print("Tap Event");      },    text: \[      "Think",      "Build",      "Ship"      \],    textStyle: TextStyle(        fontSize: 70.0,        fontFamily: "Canterbury"    ),  ),);

Colorize

SizedBox(  width: 250.0,  child: ColorizeAnimatedTextKit(    onTap: () {        print("Tap Event");      },    text: \[      "Larry Page",      "Bill Gates",      "Steve Jobs",    \],    textStyle: TextStyle(        fontSize: 50.0,         fontFamily: "Horizon"    ),    colors: \[      Colors.purple,      Colors.blue,      Colors.yellow,      Colors.red,    \],  ),);

Note: colors listshouldcontainsatleasttwovalues.

BugsorRequests

如果你有任何问题欢迎提issue.如果你感觉这个库还需要完善欢迎提 ticket 。

License

Animated-Text-Kitislicensedunder MITlicense.View license.

查看全文
声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论