### Install Package with Flutter Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/README.md Use the flutter pub get command to install the package. ```bash $ flutter pub get ``` -------------------------------- ### Install Package with Pub Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/README.md Use the pub command to install the package after adding it to pubspec.yaml. ```bash $ pub get ``` -------------------------------- ### Fade Animation Example Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/README.md Shows how to implement the Fade animation. The `onTap` callback is available for interaction. ```dart return SizedBox( width: 250.0, child: DefaultTextStyle( style: const TextStyle( fontSize: 32.0, fontWeight: FontWeight.bold, ), child: AnimatedTextKit( animatedTexts: [ FadeAnimatedText('do IT!'), FadeAnimatedText('do it RIGHT!!'), FadeAnimatedText('do it RIGHT NOW!!!'), ], onTap: () { print("Tap Event"); }, ), ), ); ``` -------------------------------- ### ScaleAnimatedText Example Source: https://context7.com/aagarwal1012/animated-text-kit/llms.txt ScaleAnimatedText animates text by scaling it up from a small size and then scaling it back down. The starting and ending scale factor are configurable. ```dart SizedBox( width: 250.0, child: DefaultTextStyle( style: const TextStyle(fontSize: 60, fontFamily: 'Canterbury'), child: AnimatedTextKit( repeatForever: true, animatedTexts: [ ScaleAnimatedText( 'Think', scalingFactor: 0.3, // starts at 30% of full size duration: const Duration(milliseconds: 2000), ), ScaleAnimatedText('Build'), ScaleAnimatedText('Ship'), ], ), ), ) ``` -------------------------------- ### Scale Animated Text Example Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/README.md Use ScaleAnimatedText for text that scales in and out. Configure the text style and animation properties. ```dart return SizedBox( width: 250.0, child: DefaultTextStyle( style: const TextStyle( fontSize: 70.0, fontFamily: 'Canterbury', ), child: AnimatedTextKit( animatedTexts: [ ScaleAnimatedText('Think'), ScaleAnimatedText('Build'), ScaleAnimatedText('Ship'), ], onTap: () { print("Tap Event"); }, ), ), ); ``` -------------------------------- ### Implement ScaleAnimatedTextKit Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/example/README.md Create scaling text animations with ScaleAnimatedTextKit. This example includes setting text, styles, and an `onTap` handler. ```dart 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 ), ); ``` -------------------------------- ### Rotate Animation Example Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/README.md Demonstrates the Rotate animation. The `onTap` callback can be used to handle tap events. ```dart Row( mainAxisSize: MainAxisSize.min, children: [ const SizedBox(width: 20.0, height: 100.0), const Text( 'Be', style: TextStyle(fontSize: 43.0), ), const SizedBox(width: 20.0, height: 100.0), DefaultTextStyle( style: const TextStyle( fontSize: 40.0, fontFamily: 'Horizon', ), child: AnimatedTextKit( animatedTexts: [ RotateAnimatedText('AWESOME'), RotateAnimatedText('OPTIMISTIC'), RotateAnimatedText('DIFFERENT'), ], onTap: () { print("Tap Event"); }, ), ), ], ); ``` -------------------------------- ### Implement TyperAnimatedTextKit Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/example/README.md Create a typing effect with TyperAnimatedTextKit. This example demonstrates setting custom text, styles, and an `onTap` handler. ```dart 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 Animation Example Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/README.md Demonstrates the Typewriter animation, which simulates typing with a slight delay between characters. The `onTap` callback is provided for interaction. ```dart return SizedBox( width: 250.0, child: DefaultTextStyle( style: const TextStyle( fontSize: 30.0, fontFamily: 'Agne', ), child: AnimatedTextKit( animatedTexts: [ TypewriterAnimatedText('Discipline is the best tool'), TypewriterAnimatedText('Design first, then code'), TypewriterAnimatedText('Do not patch bugs out, rewrite them'), TypewriterAnimatedText('Do not test bugs out, design them out'), ], onTap: () { print("Tap Event"); }, ), ), ); ``` -------------------------------- ### Import AnimatedTextKit in Dart Code Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/README.md Import the package into your Dart files to start using its widgets. ```dart import 'package:animated_text_kit/animated_text_kit.dart'; ``` -------------------------------- ### Implement RotateAnimatedTextKit Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/example/README.md Use RotateAnimatedTextKit to display rotating text. This example shows how to integrate it within a Row and includes an `onTap` callback. ```dart Row( mainAxisSize: MainAxisSize.min, children: [ 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, alignment: AlignmentDirectional.topStart // or Alignment.topLeft ), ], ); ``` -------------------------------- ### FadeAnimatedText Example Source: https://context7.com/aagarwal1012/animated-text-kit/llms.txt Use FadeAnimatedText for text that fades in and out. Configure fade-in and fade-out intervals as fractions of the total animation duration. ```dart SizedBox( width: 300.0, child: DefaultTextStyle( style: const TextStyle(fontSize: 28, fontWeight: FontWeight.bold), child: AnimatedTextKit( repeatForever: true, animatedTexts: [ FadeAnimatedText( 'do IT!', fadeInEnd: 0.4, // fade in completes at 40% of duration fadeOutBegin: 0.7, // fade out starts at 70% of duration duration: const Duration(milliseconds: 2500), ), FadeAnimatedText('do it RIGHT!!'), FadeAnimatedText('do it RIGHT NOW!!!'), ], onTap: () => print('Fade tapped'), ), ), ) ``` -------------------------------- ### Wavy Animated Text Example Source: https://context7.com/aagarwal1012/animated-text-kit/llms.txt Displays text with a rolling stadium-wave pattern. The speed of the per-character motion is configurable. ```dart DefaultTextStyle( style: const TextStyle(fontSize: 22), child: AnimatedTextKit( repeatForever: true, animatedTexts: [ WavyAnimatedText( 'Hello World! 👋', speed: const Duration(milliseconds: 250), ), WavyAnimatedText('Look at the waves'), ], onTap: () => print('Wavy tapped'), ), ) ``` -------------------------------- ### TyperAnimatedText Example Source: https://context7.com/aagarwal1012/animated-text-kit/llms.txt TyperAnimatedText simulates characters appearing one by one as if typed, without a cursor. Per-character speed and easing curve are configurable. ```dart SizedBox( width: 300.0, child: DefaultTextStyle( style: const TextStyle(fontSize: 24, fontFamily: 'Bobbers'), child: AnimatedTextKit( repeatForever: true, animatedTexts: [ TyperAnimatedText( 'It is not enough to do your best,', speed: const Duration(milliseconds: 60), curve: Curves.easeInOut, ), TyperAnimatedText('you must know what to do,'), TyperAnimatedText('and then do your best.'), ], ), ), ) ``` -------------------------------- ### Wavy Animated Text Example Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/README.md WavyAnimatedText displays text with a wavy motion. Set `isRepeatingAnimation` to true for continuous looping. ```dart return DefaultTextStyle( style: const TextStyle( fontSize: 20.0, ), child: AnimatedTextKit( animatedTexts: [ WavyAnimatedText('Hello World'), WavyAnimatedText('Look at the waves'), ], isRepeatingAnimation: true, onTap: () { print("Tap Event"); }, ), ); ``` -------------------------------- ### TypewriterAnimatedText Example Source: https://context7.com/aagarwal1012/animated-text-kit/llms.txt TypewriterAnimatedText displays characters sequentially with a blinking cursor. The cursor character, typing speed, and easing curve can be customized. ```dart SizedBox( width: 300.0, child: AnimatedTextKit( repeatForever: true, animatedTexts: [ TypewriterAnimatedText( 'Design first, then code', textStyle: const TextStyle(fontSize: 24, fontFamily: 'Agne'), speed: const Duration(milliseconds: 120), cursor: '|', // custom cursor character curve: Curves.linear, ), TypewriterAnimatedText('Do not patch bugs out, rewrite them'), TypewriterAnimatedText('Do not test bugs out, design them out'), ], displayFullTextOnTap: true, stopPauseOnTap: true, ), ) ``` -------------------------------- ### TextLiquidFill Example Source: https://context7.com/aagarwal1012/animated-text-kit/llms.txt TextLiquidFill is a widget for animating text with a rising liquid wave effect. It allows configuration of wave cycle duration, total load time, and a fill cap. ```dart TextLiquidFill( text: 'FLUTTER', textStyle: const TextStyle( fontSize: 90.0, fontWeight: FontWeight.bold, ), textAlign: TextAlign.center, waveColor: Colors.blueAccent, boxBackgroundColor: Colors.black87, boxHeight: 280.0, boxWidth: 400.0, loadDuration: const Duration(seconds: 5), waveDuration: const Duration(seconds: 2), loadUntil: 0.85, // fill only up to 85% ) ``` -------------------------------- ### TextLiquidFill Animation Example Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/README.md TextLiquidFill creates a liquid-like effect for text. Customize `waveColor`, `boxBackgroundColor`, and `boxHeight`. ```dart return 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, ), ); ``` -------------------------------- ### Rotate Animated Text Example Source: https://context7.com/aagarwal1012/animated-text-kit/llms.txt Demonstrates the RotateAnimatedText widget, which slides text in from the top and out through the bottom. Customize transition height, alignment, direction, and whether the text rotates out. ```dart Row( mainAxisSize: MainAxisSize.min, children: [ const Text('We are ', style: TextStyle(fontSize: 32)), DefaultTextStyle( style: const TextStyle(fontSize: 32, fontFamily: 'Horizon'), child: AnimatedTextKit( repeatForever: true, animatedTexts: [ RotateAnimatedText( 'CREATIVE', transitionHeight: 120.0, alignment: Alignment.center, textDirection: TextDirection.ltr, rotateOut: true, duration: const Duration(milliseconds: 2000), ), RotateAnimatedText('INNOVATIVE'), RotateAnimatedText('DIFFERENT'), ], ), ), ], ) ``` -------------------------------- ### Bounce Animated Text Example Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/README.md BounceAnimatedText animates text with a bouncing effect. This is useful for drawing attention to specific words or phrases. ```dart return SizedBox( width: 250.0, child: DefaultTextStyle( style: const TextStyle( fontSize: 60.0, fontWeight: FontWeight.bold, ), child: AnimatedTextKit( animatedTexts: [ BounceAnimatedText('Bounce!'), BounceAnimatedText('Spring!'), BounceAnimatedText('Jump!'), ], onTap: () { print("Tap Event"); }, ), ), ); ``` -------------------------------- ### Typer Animation Example Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/README.md Implements the Typer animation effect. This animation types text character by character. The `onTap` callback can be used. ```dart return SizedBox( width: 250.0, child: DefaultTextStyle( style: const TextStyle( fontSize: 30.0, fontFamily: 'Bobbers', ), child: AnimatedTextKit( animatedTexts: [ TyperAnimatedText('It is not enough to do your best,'), TyperAnimatedText('you must know what to do,'), TyperAnimatedText('and then do your best'), TyperAnimatedText('- W.Edwards Deming'), ], onTap: () { print("Tap Event"); }, ), ), ); ``` -------------------------------- ### ColorizeAnimatedText Example Source: https://context7.com/aagarwal1012/animated-text-kit/llms.txt ColorizeAnimatedText creates a gradient shimmer effect that sweeps across the text. Requires a TextStyle with an explicit fontSize and at least two colors. ```dart const colorizeTextStyle = TextStyle( fontSize: 50.0, fontFamily: 'Horizon', ); AnimatedTextKit( repeatForever: true, animatedTexts: [ ColorizeAnimatedText( 'Larry Page', textStyle: colorizeTextStyle, colors: const [Colors.purple, Colors.blue, Colors.yellow, Colors.red], speed: const Duration(milliseconds: 300), textDirection: TextDirection.ltr, ), ColorizeAnimatedText( 'Bill Gates', textStyle: colorizeTextStyle, colors: const [Colors.orange, Colors.pink, Colors.cyan], ), ColorizeAnimatedText('Steve Jobs', textStyle: colorizeTextStyle, colors: const [Colors.green, Colors.indigo]), ], ) ``` -------------------------------- ### Bounce Animated Text Example Source: https://context7.com/aagarwal1012/animated-text-kit/llms.txt Text bounces in from below using an elastic curve, landing with a playful spring effect. Bounce height and easing curve are configurable. ```dart SizedBox( width: 280.0, child: DefaultTextStyle( style: const TextStyle(fontSize: 55, fontWeight: FontWeight.bold), child: AnimatedTextKit( repeatForever: true, animatedTexts: [ BounceAnimatedText( 'Bounce!', bounceHeight: 80.0, curve: Curves.elasticOut, duration: const Duration(milliseconds: 1500), ), BounceAnimatedText('Spring!'), BounceAnimatedText('Jump!', bounceHeight: 120.0), ], ), ), ) ``` -------------------------------- ### Colorize Animated Text Example Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/README.md ColorizeAnimatedText animates text by cycling through a list of colors. Ensure the `colors` list has at least two values. ```dart const colorizeColors = [ Colors.purple, Colors.blue, Colors.yellow, Colors.red, ]; const colorizeTextStyle = TextStyle( fontSize: 50.0, fontFamily: 'Horizon', ); return SizedBox( width: 250.0, child: AnimatedTextKit( animatedTexts: [ ColorizeAnimatedText( 'Larry Page', textStyle: colorizeTextStyle, colors: colorizeColors, ), ColorizeAnimatedText( 'Bill Gates', textStyle: colorizeTextStyle, colors: colorizeColors, ), ColorizeAnimatedText( 'Steve Jobs', textStyle: colorizeTextStyle, colors: colorizeColors, ), ], isRepeatingAnimation: true, onTap: () { print("Tap Event"); }, ), ); ``` -------------------------------- ### Scramble Animated Text Example Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/README.md ScrambleAnimatedText animates text by scrambling and unscrambling characters. Adjust the `speed` property to control the animation duration. ```dart return SizedBox( width: 250.0, child: DefaultTextStyle( style: const TextStyle( fontSize: 40.0, fontWeight: FontWeight.bold, ), child: AnimatedTextKit( animatedTexts: [ ScrambleAnimatedText( 'Mobile Dev.', speed: const Duration(milliseconds: 200), ), ScrambleAnimatedText('Explorer'), ], onTap: () { print("Tap Event"); }, ), ), ); ``` -------------------------------- ### Flicker Animated Text Example Source: https://context7.com/aagarwal1012/animated-text-kit/llms.txt Text enters with a flickering bounce-in glow effect, suitable for neon or night-vibe aesthetics. The entryEnd parameter controls the duration of the flicker-in phase. ```dart SizedBox( width: 280.0, child: DefaultTextStyle( style: const TextStyle( fontSize: 35, color: Colors.white, shadows: [ Shadow(blurRadius: 8.0, color: Colors.white, offset: Offset(0, 0)), Shadow(blurRadius: 20.0, color: Colors.blue, offset: Offset(0, 0)), ], ), child: AnimatedTextKit( repeatForever: true, animatedTexts: [ FlickerAnimatedText( 'Neon Glow', speed: const Duration(milliseconds: 1600), entryEnd: 0.5, ), FlickerAnimatedText('Night Vibes'), FlickerAnimatedText("C'est La Vie!"), ], ), ), ) ``` -------------------------------- ### Scramble Animated Text Example Source: https://context7.com/aagarwal1012/animated-text-kit/llms.txt Characters are revealed one by one, scrambling through random characters before settling on the correct letter, simulating a decryption effect. ```dart SizedBox( width: 280.0, child: DefaultTextStyle( style: const TextStyle(fontSize: 36, fontWeight: FontWeight.bold), child: AnimatedTextKit( repeatForever: true, animatedTexts: [ ScrambleAnimatedText( 'Hello, World!', speed: const Duration(milliseconds: 400), ), ScrambleAnimatedText('Flutter Dev'), ScrambleAnimatedText( 'Scrambled!', speed: const Duration(milliseconds: 200), ), ], ), ), ) ``` -------------------------------- ### Flicker Animated Text Example Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/README.md FlickerAnimatedText creates a flickering effect for text, suitable for creating a sense of urgency or attention. Use `repeatForever: true` for continuous flickering. ```dart return SizedBox( width: 250.0, child: DefaultTextStyle( style: const TextStyle( fontSize: 35, color: Colors.white, shadows: [ Shadow( blurRadius: 7.0, color: Colors.white, offset: Offset(0, 0), ), ], ), child: AnimatedTextKit( repeatForever: true, animatedTexts: [ FlickerAnimatedText('Flicker Frenzy'), FlickerAnimatedText('Night Vibes On'), FlickerAnimatedText("C'est La Vie !"), ], onTap: () { print("Tap Event"); }, ), ), ); ``` -------------------------------- ### Add Animated Text Kit to pubspec.yaml Source: https://context7.com/aagarwal1012/animated-text-kit/llms.txt Add the animated_text_kit package to your project's dependencies in pubspec.yaml. ```yaml dependencies: animated_text_kit: ^4.3.0 ``` -------------------------------- ### Basic AnimatedTextKit Usage Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/README.md Demonstrates the basic usage of AnimatedTextKit with a TypewriterAnimatedText. Configure properties like textStyle, speed, totalRepeatCount, and pause for custom animations. ```dart AnimatedTextKit( animatedTexts: [ TypewriterAnimatedText( 'Hello world!', textStyle: const TextStyle( fontSize: 32.0, fontWeight: FontWeight.bold, ), speed: const Duration(milliseconds: 2000), ), ], totalRepeatCount: 4, pause: const Duration(milliseconds: 1000), displayFullTextOnTap: true, stopPauseOnTap: true, controller: myAnimatedTextController ) ``` -------------------------------- ### AnimatedTextController - Programmatic Control Source: https://context7.com/aagarwal1012/animated-text-kit/llms.txt A controller to programmatically play, pause, and reset the `AnimatedTextKit` animations. ```APIDOC ## AnimatedTextController — Programmatic Control ### Description A controller that exposes `play()`, `pause()`, and `reset()` methods to programmatically manage the animation lifecycle. Pass it to `AnimatedTextKit` via the `controller` parameter. ### Methods - **play()**: Starts or resumes the animation. - **pause()**: Pauses the current animation. - **reset()**: Resets the animation to its initial state. - **dispose()**: Disposes of the controller and releases resources. ### Usage Example ```dart class MyWidget extends StatefulWidget { @override _MyWidgetState createState() => _MyWidgetState(); } class _MyWidgetState extends State { final _controller = AnimatedTextController(); @override void dispose() { _controller.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return Column( children: [ AnimatedTextKit( controller: _controller, animatedTexts: [ TypewriterAnimatedText('Controlled animation'), FadeAnimatedText('Play, pause, reset'), ], repeatForever: true, ), Row( children: [ ElevatedButton( onPressed: _controller.play, child: const Text('Play'), ), ElevatedButton( onPressed: _controller.pause, child: const Text('Pause'), ), ElevatedButton( onPressed: _controller.reset, child: const Text('Reset'), ), ], ), ], ); } } ``` ``` -------------------------------- ### Use Custom Animated Text in AnimatedTextKit Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/README.md Demonstrates how to integrate a custom animated text widget into the `AnimatedTextKit`. Ensure your custom animation class extends `AnimatedText` and implements the necessary methods. ```dart AnimatedTextKit( animatedTexts: [ CustomAnimatedText( 'Insert Text Here', textStyle: const TextStyle( fontSize: 32.0, fontWeight: FontWeight.bold, ), ), ], ), ``` -------------------------------- ### Implement ColorizeAnimatedTextKit Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/example/README.md Use ColorizeAnimatedTextKit for text that animates through different colors. Requires a list of at least two `Colors`. This snippet includes an `onTap` callback. ```dart 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 ), ); ``` -------------------------------- ### Add Dependency to pubspec.yaml Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/README.md Add this to your package's pubspec.yaml file to include the animated_text_kit package. ```yaml dependencies: animated_text_kit: ^4.2.2 ``` -------------------------------- ### AnimatedTextKit - Core Widget Source: https://context7.com/aagarwal1012/animated-text-kit/llms.txt The main widget for sequencing and managing text animations. It accepts a list of AnimatedText subclasses and handles timing, repeats, and callbacks. ```APIDOC ## AnimatedTextKit - Core Widget ### Description The central stateful widget that sequences a list of `AnimatedText` animations, managing timing, repeats, callbacks, and programmatic control. ### Widget Signature ```dart AnimatedTextKit({ Key? key, required List animatedTexts, Duration? pause, bool isRepeatingAnimation = false, bool repeatForever = false, int? totalRepeatCount, bool displayFullTextOnTap = false, bool stopPauseOnTap = false, VoidCallback? onTap, AnimatedTextCallback? onNext, AnimatedTextCallback? onNextBeforePause, VoidCallback? onFinished, AnimatedTextController? controller, }) ``` ### Parameters - **animatedTexts** (List) - Required - A list of `AnimatedText` subclass instances to be displayed sequentially. - **pause** (Duration) - Optional - The duration to pause between each animation. Defaults to 800 milliseconds. - **isRepeatingAnimation** (bool) - Optional - Whether the animation should repeat. Defaults to false. - **repeatForever** (bool) - Optional - If true, the animation will repeat indefinitely. Defaults to false. - **totalRepeatCount** (int) - Optional - The total number of times the animation sequence should repeat. Only used if `repeatForever` is false. - **displayFullTextOnTap** (bool) - Optional - If true, tapping on the text will display the full text immediately. Defaults to false. - **stopPauseOnTap** (bool) - Optional - If true, tapping on the text will stop the current pause. Defaults to false. - **onTap** (VoidCallback) - Optional - Callback function executed when the widget is tapped. - **onNext** (AnimatedTextCallback) - Optional - Callback function executed before the next animation starts. - **onNextBeforePause** (AnimatedTextCallback) - Optional - Callback function executed before the pause between animations. - **onFinished** (VoidCallback) - Optional - Callback function executed when all animations are completed. - **controller** (AnimatedTextController) - Optional - A controller to programmatically manage the animation lifecycle. ### Request Example ```dart AnimatedTextKit( animatedTexts: [ TypewriterAnimatedText('Hello, World!'), FadeAnimatedText('Flutter is awesome'), ScaleAnimatedText('Build. Ship. Repeat.'), ], pause: const Duration(milliseconds: 800), isRepeatingAnimation: true, repeatForever: false, totalRepeatCount: 3, displayFullTextOnTap: true, stopPauseOnTap: true, onTap: () => print('Tapped!'), onNext: (index, isLast) => print('Next animation: $index, isLast: $isLast'), onNextBeforePause: (index, isLast) => print('Before pause at $index'), onFinished: () => print('All animations complete'), ) ``` ``` -------------------------------- ### Implement TypewriterAnimatedTextKit Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/example/README.md Use TypewriterAnimatedTextKit for a typewriter-style text animation. This snippet shows how to set text, styles, and an `onTap` callback. ```dart 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 ), ); ``` -------------------------------- ### Custom Shake Animated Text Subclass Source: https://context7.com/aagarwal1012/animated-text-kit/llms.txt Demonstrates creating a custom animation by extending AnimatedText. Implement initAnimation to bind animations and animatedBuilder to define the widget tree for each frame. ```dart class ShakeAnimatedText extends AnimatedText { ShakeAnimatedText( String text, { TextStyle? textStyle, Duration duration = const Duration(milliseconds: 1000), } ) : super(text: text, textStyle: textStyle, duration: duration); late Animation _shakeX; @override void initAnimation(AnimationController controller) { _shakeX = TweenSequence([ TweenSequenceItem(tween: Tween(begin: 0.0, end: -10.0), weight: 1), TweenSequenceItem(tween: Tween(begin: -10.0, end: 10.0), weight: 2), TweenSequenceItem(tween: Tween(begin: 10.0, end: -10.0), weight: 2), TweenSequenceItem(tween: Tween(begin: -10.0, end: 0.0), weight: 1), ]).animate(controller); } @override Widget animatedBuilder(BuildContext context, Widget? child) { return Transform.translate( offset: Offset(_shakeX.value, 0), child: textWidget(text), ); } } // Usage AnimatedTextKit( repeatForever: true, animatedTexts: [ ShakeAnimatedText( 'Shake it!', textStyle: const TextStyle(fontSize: 40, fontWeight: FontWeight.bold), ), TypewriterAnimatedText('Mixed animations too'), ], ) ``` -------------------------------- ### Use AnimatedTextKit with Multiple Animations Source: https://context7.com/aagarwal1012/animated-text-kit/llms.txt Configure the core AnimatedTextKit widget to display a sequence of different text animations with custom timing and repeat behavior. ```dart AnimatedTextKit( animatedTexts: [ TypewriterAnimatedText('Hello, World!'), FadeAnimatedText('Flutter is awesome'), ScaleAnimatedText('Build. Ship. Repeat.'), ], pause: const Duration(milliseconds: 800), isRepeatingAnimation: true, repeatForever: false, totalRepeatCount: 3, displayFullTextOnTap: true, stopPauseOnTap: true, onTap: () => print('Tapped!'), onNext: (index, isLast) => print('Next animation: $index, isLast: $isLast'), onNextBeforePause: (index, isLast) => print('Before pause at $index'), onFinished: () => print('All animations complete'), ) ``` -------------------------------- ### RotateAnimatedText Source: https://context7.com/aagarwal1012/animated-text-kit/llms.txt Animates text by sliding it in from the top and out through the bottom, with options for transition height, alignment, and direction. ```APIDOC ## RotateAnimatedText — Rotate Animation ### Description Text slides in from the top and out through the bottom with configurable transition height, alignment, and direction. The `rotateOut` parameter controls whether the text also slides out (default) or stays visible after entering. ### Widget Signature ```dart RotateAnimatedText( String text, { Duration? duration, Curve? curve, double transitionHeight = 100.0, AlignmentGeometry alignment = Alignment.center, TextDirection? textDirection, bool rotateOut = true, Key? key, TextStyle? textStyle, } ) ``` ### Parameters - **text** (String) - Required - The text to animate. - **duration** (Duration) - Optional - The duration of the animation. - **curve** (Curve) - Optional - The curve to use for the animation. - **transitionHeight** (double) - Optional - The height of the transition for the text. Defaults to 100.0. - **alignment** (AlignmentGeometry) - Optional - The alignment of the text within its bounds. Defaults to `Alignment.center`. - **textDirection** (TextDirection) - Optional - The text direction for layout. - **rotateOut** (bool) - Optional - Whether the text should slide out after animating in. Defaults to true. ### Request Example ```dart Row( mainAxisSize: MainAxisSize.min, children: [ const Text('We are ', style: TextStyle(fontSize: 32)), DefaultTextStyle( style: const TextStyle(fontSize: 32, fontFamily: 'Horizon'), child: AnimatedTextKit( repeatForever: true, animatedTexts: [ RotateAnimatedText( 'CREATIVE', transitionHeight: 120.0, alignment: Alignment.center, textDirection: TextDirection.ltr, rotateOut: true, duration: const Duration(milliseconds: 2000), ), RotateAnimatedText('INNOVATIVE'), RotateAnimatedText('DIFFERENT'), ], ), ), ], ) ``` ``` -------------------------------- ### Implement FadeAnimatedTextKit Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/example/README.md Display fading text animations using FadeAnimatedTextKit. This snippet includes an `onTap` callback and custom text styles. ```dart 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 ), ); ``` -------------------------------- ### Git Commit Message Prefixes Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/CONTRIBUTING.md Use these prefixes for Git commit messages to categorize changes. Ensure the first line is 72 characters or less and use the present tense. ```text feat: (addition of a new feature) rfac: (refactoring the code: optimization/ different logic of existing code - output doesn't change, just the way of execution changes) docs: (documenting the code, be it readme, or extra comments) bfix: (bug fixing) chor: (chore - beautifying code, indents, spaces, camelcasing, changing variable names to have an appropriate meaning) ptch: (patches - small changes in code, mainly UI, for example color of a button, incrasing size of tet, etc etc) conf: (configurational settings - changing directory structure, updating gitignore, add libraries, changing manifest etc) ``` -------------------------------- ### Observe and Control AnimatedTextState Source: https://context7.com/aagarwal1012/animated-text-kit/llms.txt Listen to state changes using stateNotifier and programmatically control the animation playback with an AnimatedTextController. Ensure to call dispose when done. ```dart final controller = AnimatedTextController(); // Listen for state changes controller.stateNotifier.addListener(() { switch (controller.state) { case AnimatedTextState.playing: print('Animation is playing'); break; case AnimatedTextState.pausedByUser: print('Paused by user'); break; case AnimatedTextState.pausedBetweenAnimations: print('In the inter-animation pause gap'); break; case AnimatedTextState.pausedBetweenAnimationsByUser: print('User paused during gap; will remain paused after gap ends'); break; case AnimatedTextState.stopped: print('Animation stopped'); break; case AnimatedTextState.reset: print('Animation reset'); break; } }); // Programmatic transitions controller.pause(); // → pausedByUser controller.play(); // → playing controller.reset(); // → reset (then auto-transitions to playing) controller.dispose(); // call when done ``` -------------------------------- ### Programmatic Control of Animations with AnimatedTextController Source: https://context7.com/aagarwal1012/animated-text-kit/llms.txt Utilize AnimatedTextController to programmatically play, pause, and reset animations within AnimatedTextKit. Ensure the controller is disposed of when no longer needed. ```dart class MyWidget extends StatefulWidget { @override _MyWidgetState createState() => _MyWidgetState(); } class _MyWidgetState extends State { final _controller = AnimatedTextController(); @override void dispose() { _controller.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return Column( children: [ AnimatedTextKit( controller: _controller, animatedTexts: [ TypewriterAnimatedText('Controlled animation'), FadeAnimatedText('Play, pause, reset'), ], repeatForever: true, ), Row( children: [ ElevatedButton( onPressed: _controller.play, child: const Text('Play'), ), ElevatedButton( onPressed: _controller.pause, child: const Text('Pause'), ), ElevatedButton( onPressed: _controller.reset, child: const Text('Reset'), ), ], ), ], ); } } ``` -------------------------------- ### Combine Multiple Animations with AnimatedTextKit Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/README.md Use AnimatedTextKit to combine different animation types. Ensure all animations are subclasses of AnimatedText. ```dart AnimatedTextKit( animatedTexts: [ FadeAnimatedText( 'Fade First', textStyle: TextStyle(fontSize: 32.0, fontWeight: FontWeight.bold), ), ScaleAnimatedText( 'Then Scale', textStyle: TextStyle(fontSize: 70.0, fontFamily: 'Canterbury'), ), ], ), ``` -------------------------------- ### Register Service Worker for Flutter Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/example/web/index.html Register the service worker when the Flutter app is ready. This is specific to Flutter web applications. ```javascript if ('serviceWorker' in navigator) { window.addEventListener('flutter-first-frame', function () { navigator.serviceWorker.register('flutter_service_worker.js'); }); } ``` -------------------------------- ### Customize FadeAnimatedTextKit Animation Source: https://github.com/aagarwal1012/animated-text-kit/blob/master/example/README.md Override the default animation duration and repetition behavior for FadeAnimatedTextKit. Set `duration` for animation length and `isRepeatingAnimation` to false to stop looping. ```dart 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), ); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.