Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
351 changes: 225 additions & 126 deletions README.md

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

228 changes: 167 additions & 61 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ class _MyHomePageState extends State<MyHomePage> {
decoration: BoxDecoration(color: animatedTextExample.color),
height: 300.0,
width: 300.0,
child: Center(child: animatedTextExample.child),
child: Center(
key: ValueKey(animatedTextExample.label),
child: animatedTextExample.child,
),
),
Expanded(
child: Container(
Expand Down Expand Up @@ -102,6 +105,53 @@ class AnimatedTextExample {
});
}

// Rotate Text Style
const _textStyleHorizon40 = TextStyle(
fontSize: 40.0,
fontFamily: 'Horizon',
);

// Fade Text Style
const _textStyleBold32 = TextStyle(
fontSize: 32.0,
fontWeight: FontWeight.bold,
);

// Typer Text Style
const _textStyleBobbers30 = TextStyle(
fontSize: 30.0,
fontFamily: 'Bobbers',
);

// Typewriter Text Style
const _textStyleAgne30 = TextStyle(
fontSize: 30.0,
fontFamily: 'Agne',
);

// Scale Text Style
const _textStyleCanterbury70 = TextStyle(
fontSize: 70.0,
fontFamily: 'Canterbury',
);

// Colorize Text Style
const _textStyleHorizon50 = TextStyle(
fontSize: 50.0,
fontFamily: 'Horizon',
);

// Colorize Colors
const _colorizeColors = [
Colors.purple,
Colors.blue,
Colors.yellow,
Colors.red,
];

// Wavy Text Style
const _textStyleDefault20 = TextStyle(fontSize: 20);

List<AnimatedTextExample> animatedTextExamples({VoidCallback? onTap}) =>
<AnimatedTextExample>[
AnimatedTextExample(
Expand All @@ -125,15 +175,24 @@ List<AnimatedTextExample> animatedTextExamples({VoidCallback? onTap}) =>
width: 20.0,
height: 100.0,
),
RotateAnimatedTextKit(
AnimatedTextKit(
animatedTexts: [
RotateAnimatedText(
'AWESOME',
textStyle: _textStyleHorizon40,
),
RotateAnimatedText(
'OPTIMISTIC',
textStyle: _textStyleHorizon40,
),
RotateAnimatedText(
'DIFFERENT',
textStyle: _textStyleHorizon40,
),
],
onTap: onTap,
isRepeatingAnimation: true,
totalRepeatCount: 10,
text: ['AWESOME', 'OPTIMISTIC', 'DIFFERENT'],
textStyle: const TextStyle(
fontSize: 40.0,
fontFamily: 'Horizon',
),
),
],
),
Expand All @@ -143,29 +202,49 @@ List<AnimatedTextExample> animatedTextExamples({VoidCallback? onTap}) =>
AnimatedTextExample(
label: 'Fade',
color: Colors.brown[600],
child: FadeAnimatedTextKit(
child: AnimatedTextKit(
animatedTexts: [
FadeAnimatedText(
'do IT!',
textStyle: _textStyleBold32,
),
FadeAnimatedText(
'do it RIGHT!!',
textStyle: _textStyleBold32,
),
FadeAnimatedText(
'do it RIGHT NOW!!!',
textStyle: _textStyleBold32,
),
],
onTap: onTap,
text: ['do IT!', 'do it RIGHT!!', 'do it RIGHT NOW!!!'],
textStyle: TextStyle(fontSize: 32.0, fontWeight: FontWeight.bold),
),
),
AnimatedTextExample(
label: 'Typer',
color: Colors.lightGreen[800],
child: SizedBox(
width: 250.0,
child: TyperAnimatedTextKit(
onTap: onTap,
text: [
'It is not enough to do your best,',
'you must know what to do,',
'and then do your best',
'- W.Edwards Deming',
child: AnimatedTextKit(
animatedTexts: [
TyperAnimatedText(
'It is not enough to do your best,',
textStyle: _textStyleBobbers30,
),
TyperAnimatedText(
'you must know what to do,',
textStyle: _textStyleBobbers30,
),
TyperAnimatedText(
'and then do your best',
textStyle: _textStyleBobbers30,
),
TyperAnimatedText(
'- W.Edwards Deming',
textStyle: _textStyleBobbers30,
),
],
textStyle: const TextStyle(
fontSize: 30.0,
fontFamily: 'Bobbers',
),
onTap: onTap,
),
),
),
Expand All @@ -174,53 +253,72 @@ List<AnimatedTextExample> animatedTextExamples({VoidCallback? onTap}) =>
color: Colors.teal[700],
child: SizedBox(
width: 250.0,
child: TypewriterAnimatedTextKit(
onTap: onTap,
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',
child: AnimatedTextKit(
animatedTexts: [
TypewriterAnimatedText(
'Discipline is the best tool',
textStyle: _textStyleAgne30,
),
TypewriterAnimatedText(
'Design first, then code',
textStyle: _textStyleAgne30,
),
TypewriterAnimatedText(
'Do not patch bugs out, rewrite them',
textStyle: _textStyleAgne30,
),
TypewriterAnimatedText(
'Do not test bugs out, design them out',
textStyle: _textStyleAgne30,
),
],
textStyle: const TextStyle(
fontSize: 30.0,
fontFamily: 'Agne',
),
onTap: onTap,
),
),
),
AnimatedTextExample(
label: 'Scale',
color: Colors.blue[700],
child: ScaleAnimatedTextKit(
child: AnimatedTextKit(
animatedTexts: [
ScaleAnimatedText(
'Think',
textStyle: _textStyleCanterbury70,
),
ScaleAnimatedText(
'Build',
textStyle: _textStyleCanterbury70,
),
ScaleAnimatedText(
'Ship',
textStyle: _textStyleCanterbury70,
),
],
onTap: onTap,
text: ['Think', 'Build', 'Ship'],
textStyle: const TextStyle(
fontSize: 70.0,
fontFamily: 'Canterbury',
),
),
),
AnimatedTextExample(
label: 'Colorize',
color: Colors.blueGrey[50],
child: ColorizeAnimatedTextKit(
onTap: onTap,
text: [
'Larry Page',
'Bill Gates',
'Steve Jobs',
],
textStyle: const TextStyle(
fontSize: 50.0,
fontFamily: 'Horizon',
),
colors: [
Colors.purple,
Colors.blue,
Colors.yellow,
Colors.red,
child: AnimatedTextKit(
animatedTexts: [
ColorizeAnimatedText(
'Larry Page',
textStyle: _textStyleHorizon50,
colors: _colorizeColors,
),
ColorizeAnimatedText(
'Bill Gates',
textStyle: _textStyleHorizon50,
colors: _colorizeColors,
),
ColorizeAnimatedText(
'Steve Jobs',
textStyle: _textStyleHorizon50,
colors: _colorizeColors,
),
],
onTap: onTap,
),
),
AnimatedTextExample(
Expand All @@ -240,14 +338,22 @@ List<AnimatedTextExample> animatedTextExamples({VoidCallback? onTap}) =>
AnimatedTextExample(
label: 'Wavy Text',
color: Colors.black87,
child: WavyAnimatedTextKit(
onTap: onTap,
textStyle: const TextStyle(fontSize: 20),
text: [
'Hello World',
'Look at the waves',
'They look so Amazing',
child: AnimatedTextKit(
animatedTexts: [
WavyAnimatedText(
'Hello World',
textStyle: _textStyleDefault20,
),
WavyAnimatedText(
'Look at the waves',
textStyle: _textStyleDefault20,
),
WavyAnimatedText(
'They look so Amazing',
textStyle: _textStyleDefault20,
),
],
onTap: onTap,
),
),
AnimatedTextExample(
Expand Down
4 changes: 2 additions & 2 deletions lib/src/colorize.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import 'package:flutter/material.dart';
import 'animated_text.dart';

/// Animated Text for [ColorizeAnimatedTextKit] that will show text shimmering
/// between [colors].
/// Animated Text that shows text shimmering between [colors].
///
/// ![Colorize example](https://raw.githubusercontent.com/aagarwal1012/Animated-Text-Kit/master/display/colorize.gif)
class ColorizeAnimatedText extends AnimatedText {
Expand Down Expand Up @@ -111,6 +110,7 @@ class ColorizeAnimatedText extends AnimatedText {
/// Animation that displays [text] elements, shimmering transition between [colors].
///
/// ![Colorize example](https://raw.githubusercontent.com/aagarwal1012/Animated-Text-Kit/master/display/colorize.gif)
@Deprecated('Use AnimatedTextKit with ColorizeAnimatedText instead.')
class ColorizeAnimatedTextKit extends AnimatedTextKit {
ColorizeAnimatedTextKit({
Key? key,
Expand Down
1 change: 1 addition & 0 deletions lib/src/fade.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class FadeAnimatedText extends AnimatedText {
/// Animation that displays [text] elements, fading them in and then out.
///
/// ![Fade example](https://raw.githubusercontent.com/aagarwal1012/Animated-Text-Kit/master/display/fade.gif)
@Deprecated('Use AnimatedTextKit with FadeAnimatedText instead.')
class FadeAnimatedTextKit extends AnimatedTextKit {
FadeAnimatedTextKit({
Key? key,
Expand Down
1 change: 1 addition & 0 deletions lib/src/rotate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class RotateAnimatedText extends AnimatedText {
/// Animation that displays [text] elements, rotating them in one at a time.
///
/// ![Rotate example](https://raw.githubusercontent.com/aagarwal1012/Animated-Text-Kit/master/display/rotate.gif)
@Deprecated('Use AnimatedTextKit with RotateAnimatedText instead.')
class RotateAnimatedTextKit extends AnimatedTextKit {
RotateAnimatedTextKit({
Key? key,
Expand Down
1 change: 1 addition & 0 deletions lib/src/scale.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class ScaleAnimatedText extends AnimatedText {
/// Animation that displays [text] elements, scaling them up and then out, one at a time.
///
/// ![Scale example](https://raw.githubusercontent.com/aagarwal1012/Animated-Text-Kit/master/display/scale.gif)
@Deprecated('Use AnimatedTextKit with ScaleAnimatedText instead.')
class ScaleAnimatedTextKit extends AnimatedTextKit {
ScaleAnimatedTextKit({
Key? key,
Expand Down
1 change: 1 addition & 0 deletions lib/src/typer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class TyperAnimatedText extends AnimatedText {
/// character at a time.
///
/// ![Typer example](https://raw.githubusercontent.com/aagarwal1012/Animated-Text-Kit/master/display/typer.gif)
@Deprecated('Use AnimatedTextKit with TyperAnimatedText instead.')
class TyperAnimatedTextKit extends AnimatedTextKit {
TyperAnimatedTextKit({
Key? key,
Expand Down
1 change: 1 addition & 0 deletions lib/src/typewriter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class TypewriterAnimatedText extends AnimatedText {
/// character at a time. Similar to [TyperAnimatedTextKit], but shows a cursor.
///
/// ![Typewriter example](https://raw.githubusercontent.com/aagarwal1012/Animated-Text-Kit/master/display/typewriter.gif)
@Deprecated('Use AnimatedTextKit with TypewriterAnimatedText instead.')
class TypewriterAnimatedTextKit extends AnimatedTextKit {
TypewriterAnimatedTextKit({
Key? key,
Expand Down
1 change: 1 addition & 0 deletions lib/src/wavy.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class WavyAnimatedText extends AnimatedText {
/// characters popping like a stadium wave.
///
/// ![Wavy example](https://raw.githubusercontent.com/aagarwal1012/Animated-Text-Kit/master/display/wavy.gif)
@Deprecated('Use AnimatedTextKit with WavyAnimatedText instead.')
class WavyAnimatedTextKit extends AnimatedTextKit {
WavyAnimatedTextKit({
Key? key,
Expand Down
Loading