Viewing version 2.5.4. Open the latest package page.

animated_text_kit

2.5.4

A flutter package project which contains a collection of cool and beautiful text animations.

Download archive

Readme

Animated Text Kit

Table of contents

Installing

1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
  animated_text_kit: ^2.5.4

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

3. Import it

Now in your Dart code, you can use:

import 'package:animated_text_kit/animated_text_kit.dart';

Usage

You can override the duration of animation of single text by setting its duration in each AnimatedTextKit class, also you can set the time of the pause between texts by setting the pause parameter and with this when isRepeatingAnimation is set to true, you can set number of times the animation should repeat with totalRepeatCount (or repeat forever with repeatForever). The speed parameter is also included for some classes which sets the delay between the apparition of each characters. Also, the displayFullTextOnTap and stopPauseOnTap parameters have been included for some classes.

TypewriterAnimatedTextKit(
  speed: Duration(milliseconds: 2000),
  totalRepeatCount: 4,
  repeatForever: true, //this will ignore [totalRepeatCount]
  pause: Duration(milliseconds:  1000),
  text: ["do IT!", "do it RIGHT!!", "do it RIGHT NOW!!!"],
  textStyle: TextStyle(fontSize: 32.0, fontWeight: FontWeight.bold),
  pause: Duration(milliseconds: 1000),
  displayFullTextOnTap: true,
  stopPauseOnTap: true
);

Also, different callbacks are added to each AnimatedTextKit class along with the onTap callback:

  • onNext(int index, bool isLast) - This callback will be called before the next text animation, after the previous one's pause.
  • onNextBeforePause(int index, bool isLast) - This callback will be called before the next text animation, before the previous one's pause.
  • onFinished - This callback is called at the end, if the parameter isRepeatingAnimation is set to false.

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"),
      textAlign: TextAlign.start
    ),
  ],
);

Note: You can override transition height by setting the value of parameter transitionHeight for RotateAnimatedTextKit class.

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
    ),
    textAlign: TextAlign.start,
    alignment: AlignmentDirectional.topStart // or Alignment.topLeft
  ),
);

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"
    ),
    textAlign: TextAlign.start,
    alignment: AlignmentDirectional.topStart // or Alignment.topLeft
  ),
);

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"
    ),
    textAlign: TextAlign.start,
    alignment: AlignmentDirectional.topStart // or Alignment.topLeft
  ),
);

Scale

SizedBox(
  width: 250.0,
  child: ScaleAnimatedTextKit(
    onTap: () {
        print("Tap Event");
      },
    text: [
      "Think",
      "Build",
      "Ship"
      ],
    textStyle: TextStyle(
        fontSize: 70.0,
        fontFamily: "Canterbury"
    ),
    textAlign: TextAlign.start,
    alignment: AlignmentDirectional.topStart // or Alignment.topLeft
  ),
);

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,
    ],
    textAlign: TextAlign.start,
    alignment: AlignmentDirectional.topStart // or Alignment.topLeft
  ),
);

Note: colors list should contains at least two values.

TextLiquidFill

SizedBox(
  width: 250.0,
  child: TextLiquidFill(
        text: 'LIQUIDY',
        waveColor: Colors.blueAccent,
        boxBackgroundColor: Colors.redAccent,
        textStyle: TextStyle(
          fontSize: 80.0,
          fontWeight: FontWeight.bold,
        ),
        boxHeight: 300.0,
  ),
);

To get more information about how the animated text made from scratch by @HemilPanchiwala, visit the Medium blog.

Wavy

WavyAnimatedTextKit(
  textStyle: TextStyle(
        fontSize: 32.0,
        fontWeight: FontWeight.bold
    ),
  text: [
    "Hello World",
    "Look at the waves",
  ],
  isRepeatingAnimation: true,
),

Bugs or Requests

If you encounter any problems feel free to open an issue. If you feel the library is missing a feature, please raise a ticket on GitHub and I'll look into it. Pull request are also welcome.

See Contributing.md.

Donate

If you found this project helpful or you learned something from the source code and want to thank me, consider buying me a cup of :coffee:

Contributors

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind are welcome! See Contributing.md.

License

Animated-Text-Kit is licensed under MIT license. View license.

Changelog

2.5.4

  • Added missing dart documentation to the public classes and methods.

2.5.3

  • Updated the README to revert links to be pub.dev friendly.

2.5.2

Issue Fixed

  • Bug fix for ScaleAnimatedTextKit to check mounted before setState to avoid potential conflict with dispose. Resolves #105 -- PR #143

2.5.1

Bug Fixes and Enhancements

  • Minor bug fix to RotateAnimatedTextKit to properly handle alignment property, and introduced textDirection property #138
  • Increased test coverage #128

2.5.0

Bug Fixes and Enhancements

  • Increase test coverage #137 and #135.
  • Removed redundant _texts variables #133.
  • Added pedantic lint rules. #132.
  • Refactored code to move default logic from the State class to the StatefulWidget #131.
  • Revised _textKey to not be a global variable. Resolves #129 issue -- PR #130.
  • Other basic improvements #136 and #134.

2.4.1

Issue Fixed

2.4.0

Issues Fixed

2.3.0

New Animated Text

Issues Fixed

2.2.0

Issues Fixed

Code Review #81

  • Removed obsolete new keywords.
  • Added types to collection and function variables.
  • Added final and const keywords.
  • Replaced null guards with concise ?. and ?? operators.
  • Added missing null check on dispose for FadeAnimatedTextKit.
  • In fade.dart, renamed the _RotatingTextState class to _FadeTextState to be consistent with the overall pattern and avoid confusion with _RotatingTextState in rotate.dart.

Warning:

  • Removed onNextBeforePause from ColorizeAnimatedTextKit because it was not referenced.

2.1.0

Issues Fixed

Feature Enhancement

  • Add repeatForever option.

    repeatForever: true, //this will ignore [totalRepeatCount]
    

2.0.1

  • Minor updates.

2.0.0

  • TextLiquidFill animated text added to the package🎉🎉

  • Breaking Changes: Different arguments are included in the classes and duration has been broken into speed and pause in some classes as per their needs.

    • duration - Change the duration from the animation time of the complete list to single element animation time.
    • speed - Time between the display of characters.
    • pause - Delay between the animation of texts.
    • totalRepeatCount - Sets the number of times animation should repeat
    • displayFullTextOnTap - If true, tapping the screen will stop current animated text, and display it fully.
    • stopPauseOnTap - If true, tapping during a pause will stop it and start the next text animation.
  • Better control over Animated Texts:
    Callbacks added:

    • onNext(int index, bool isLast) - This callback will be called before the next text animation, after the previous ones pause.
    • onNextBeforePause(int index, bool isLast) - This callback will be called before the next text animation, before the previous one's pause.
    • onFinished - This callback is called at the end when the parameter isRepeatingAnimation is set to false.

1.3.1

  • Updated example app readme.
  • Added documentation for the various parameters of all the animated widgets.

1.3.0

Feature Enhancement

  • Added attribute to align text.
  • Updated Readme.

1.2.0

Feature Enhancement

  • Added attribute to check whether the animation should repeat or not.
  • Updated Readme.

1.1.1

  • Fixed flutter formatting issues.

1.1.0

Feature Enhancement

  • Added onTap callback for all AnimatedText widget.
  • Updated Readme.

1.0.3

  • General update.

1.0.2

  • Updated Readme.

1.0.1

  • Initial Release.

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add 'animated_text_kit:2.5.4'
pubspec.yaml
name: animated_text_kit
description: A flutter package project which contains a collection of cool and beautiful text animations.
version: 2.5.4
homepage: https://github.com/aagarwal1012/Animated-Text-Kit/
maintainer: Ayush Agarwal (@aagarwal1012)

dependencies:
  flutter:
    sdk: flutter
  characters: ^1.0.0

dev_dependencies:
  flutter_test:
    sdk: flutter
  pedantic: ^1.9.2

flutter:

environment:
  sdk: ">=2.0.0 <3.0.0"
  flutter: ">=0.3.0 <2.0.0"

Version history

VersionPublishedArchiveSHA-256
1.0.1Cached · Upstream SHA-256 matchedDownload3b7cbc0a…e8aea3
1.0.2Cached · Upstream SHA-256 matchedDownload340776dc…a12870
1.0.3Cached · Upstream SHA-256 matchedDownload076e8fc4…4e09a5
1.1.0Cached · Upstream SHA-256 matchedDownload5dbe6a03…b91288
1.1.1Cached · Upstream SHA-256 matchedDownload39301f90…1e57c7
1.2.0Cached · Upstream SHA-256 matchedDownloadedd23c6f…59d48b
1.3.0Cached · Upstream SHA-256 matchedDownload064b7f1a…e35a8a
1.3.1Cached · Upstream SHA-256 matchedDownloadd566edbd…bde1c2
2.0.0Cached · Upstream SHA-256 matchedDownload7d401646…4b7889
2.0.1Cached · Upstream SHA-256 matchedDownload27a9f2b7…cde772
2.1.0Cached · Upstream SHA-256 matchedDownloada3ec787b…6e8008
2.2.0Cached · Upstream SHA-256 matchedDownloadb8772b1a…75ee6a
2.3.0Cached · Upstream SHA-256 matchedDownload4688bcd5…be8efa
2.4.0Cached · Upstream SHA-256 matchedDownloada8051390…875d4e
2.4.1Cached · Upstream SHA-256 matchedDownload1774e554…d34def
2.5.0Cached · Upstream SHA-256 matchedDownloadf9437101…2cc5cf
2.5.1Cached · Upstream SHA-256 matchedDownload10c0bb77…0195e8
2.5.2Cached · Upstream SHA-256 matchedDownload49d9508f…535234
2.5.3Cached · Upstream SHA-256 matchedDownload0e9ab1f7…c796bb
2.5.4Cached · Upstream SHA-256 matchedDownload41c615f9…741d2d
3.0.0Cached · Upstream SHA-256 matchedDownloadc34a7454…272ece
3.0.1Cached · Upstream SHA-256 matchedDownload91232e2c…86e0a1
3.0.2Cached · Upstream SHA-256 matchedDownload84343cc1…c98629
3.1.0Cached · Upstream SHA-256 matchedDownload8e2d38cf…afdfcc
3.1.1Cached · Upstream SHA-256 matchedDownload4bbb0b0e…5ef242
3.1.2Cached · Upstream SHA-256 matchedDownload617b93ac…3fe8aa
4.0.0Cached · Upstream SHA-256 matchedDownloadecc5f312…071bb7
4.1.0Cached · Upstream SHA-256 matchedDownload17c098e6…b2d353
4.1.1Cached · Upstream SHA-256 matchedDownload3eacf786…dad2bd
4.2.0Cached · Upstream SHA-256 matchedDownloadea637054…7809b8
4.2.1Cached · Upstream SHA-256 matchedDownload5e6bf696…2ccdcc
4.2.2Cached · Upstream SHA-256 matchedDownload37392a53…22fa92
4.2.3Cached · Upstream SHA-256 matchedDownloadadba517a…93a93d
4.3.0Cached · Upstream SHA-256 matchedDownload1d414868…5c81f2

Dependencies

characters "^1.0.0"

flutter { "sdk": "flutter" }