From 267a06fa91cb7f0898d779818fa70e0f8972a890 Mon Sep 17 00:00:00 2001 From: Anthony Whitford Date: Thu, 5 Nov 2020 19:44:50 -0800 Subject: [PATCH 1/3] Added missing dartdoc to classes. --- lib/src/colorize.dart | 3 +++ lib/src/fade.dart | 3 +++ lib/src/rotate.dart | 3 +++ lib/src/scale.dart | 3 +++ lib/src/text_liquid_fill.dart | 10 +++++++--- lib/src/typer.dart | 4 ++++ lib/src/typewriter.dart | 4 ++++ lib/src/wavy.dart | 4 ++++ 8 files changed, 31 insertions(+), 3 deletions(-) diff --git a/lib/src/colorize.dart b/lib/src/colorize.dart index 3d76511..a1d7cd0 100644 --- a/lib/src/colorize.dart +++ b/lib/src/colorize.dart @@ -1,6 +1,9 @@ import 'package:flutter/material.dart'; import 'dart:async'; +/// Animation that displays [text] elements, shimmering transition between [colors]. +/// +/// ![colorize example](https://raw.githubusercontent.com/aagarwal1012/Animated-Text-Kit/master/display/colorize.gif) class ColorizeAnimatedTextKit extends StatefulWidget { /// List of [String] that would be displayed subsequently in the animation. final List text; diff --git a/lib/src/fade.dart b/lib/src/fade.dart index 68ddf17..8cf5c43 100644 --- a/lib/src/fade.dart +++ b/lib/src/fade.dart @@ -2,6 +2,9 @@ import 'dart:async'; import 'dart:math'; import 'package:flutter/material.dart'; +/// 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) class FadeAnimatedTextKit extends StatefulWidget { /// List of [String] that would be displayed subsequently in the animation. final List text; diff --git a/lib/src/rotate.dart b/lib/src/rotate.dart index 5144fa4..82a9fbd 100644 --- a/lib/src/rotate.dart +++ b/lib/src/rotate.dart @@ -1,6 +1,9 @@ import 'dart:async'; import 'package:flutter/material.dart'; +/// 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) class RotateAnimatedTextKit extends StatefulWidget { /// List of [String] that would be displayed subsequently in the animation. final List text; diff --git a/lib/src/scale.dart b/lib/src/scale.dart index c399151..9e7c35c 100644 --- a/lib/src/scale.dart +++ b/lib/src/scale.dart @@ -2,6 +2,9 @@ import 'dart:async'; import 'dart:math'; import 'package:flutter/material.dart'; +/// 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) class ScaleAnimatedTextKit extends StatefulWidget { /// List of [String] that would be displayed subsequently in the animation. final List text; diff --git a/lib/src/text_liquid_fill.dart b/lib/src/text_liquid_fill.dart index 65cb31d..624bf02 100644 --- a/lib/src/text_liquid_fill.dart +++ b/lib/src/text_liquid_fill.dart @@ -1,6 +1,10 @@ import 'dart:math'; import 'package:flutter/material.dart'; +/// Animation that displays a [text] element, coloring it to look like sloshing +/// water is filling it up. +/// +/// ![TextLiquidFill example](https://raw.githubusercontent.com/aagarwal1012/Animated-Text-Kit/master/display/text_liquid_fill.gif) class TextLiquidFill extends StatefulWidget { /// Gives [TextStyle] to the text string. /// @@ -126,7 +130,7 @@ class _TextLiquidFillState extends State animation: _waveController, builder: (BuildContext context, Widget child) { return CustomPaint( - painter: WavePainter( + painter: _WavePainter( textKey: _textKey, waveAnimation: _waveController, percentValue: _loadValue.value, @@ -164,7 +168,7 @@ class _TextLiquidFillState extends State } } -class WavePainter extends CustomPainter { +class _WavePainter extends CustomPainter { final _pi2 = 2 * pi; final GlobalKey textKey; final Animation waveAnimation; @@ -172,7 +176,7 @@ class WavePainter extends CustomPainter { final double boxHeight; final Color waveColor; - WavePainter({ + _WavePainter({ @required this.textKey, this.waveAnimation, this.percentValue, diff --git a/lib/src/typer.dart b/lib/src/typer.dart index 5e46ca6..33c8592 100644 --- a/lib/src/typer.dart +++ b/lib/src/typer.dart @@ -3,6 +3,10 @@ import 'dart:math'; import 'package:characters/characters.dart'; import 'package:flutter/material.dart'; +/// Animation that displays [text] elements, as if they are being typed one +/// character at a time. +/// +/// ![typer example](https://raw.githubusercontent.com/aagarwal1012/Animated-Text-Kit/master/display/typer.gif) class TyperAnimatedTextKit extends StatefulWidget { /// List of [String] that would be displayed subsequently in the animation. final List text; diff --git a/lib/src/typewriter.dart b/lib/src/typewriter.dart index c3c9c53..94f2d0a 100644 --- a/lib/src/typewriter.dart +++ b/lib/src/typewriter.dart @@ -3,6 +3,10 @@ import 'dart:math'; import 'package:characters/characters.dart'; import 'package:flutter/material.dart'; +/// Animation that displays [text] elements, as if they are being typed one +/// 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) class TypewriterAnimatedTextKit extends StatefulWidget { /// List of [String] that would be displayed subsequently in the animation. final List text; diff --git a/lib/src/wavy.dart b/lib/src/wavy.dart index 917df38..585865b 100644 --- a/lib/src/wavy.dart +++ b/lib/src/wavy.dart @@ -2,6 +2,10 @@ import 'dart:async'; import 'dart:math' as math; import 'package:flutter/material.dart'; +/// Animation that displays [text] elements, with each text animated with its +/// characters popping like a stadium wave. +/// +/// ![Wavy example](https://raw.githubusercontent.com/aagarwal1012/Animated-Text-Kit/master/display/wavy.gif) class WavyAnimatedTextKit extends StatefulWidget { const WavyAnimatedTextKit({ Key key, From 7ba57877717ef5ab638bf3090bf7306bf6f1bdd1 Mon Sep 17 00:00:00 2001 From: Anthony Whitford Date: Thu, 5 Nov 2020 22:05:45 -0800 Subject: [PATCH 2/3] Added dartdoc to createState methods as workaround for https://github.com/kf6gpe/dart-flutter-favorite/issues/11 --- lib/src/colorize.dart | 1 + lib/src/fade.dart | 1 + lib/src/rotate.dart | 1 + lib/src/scale.dart | 1 + lib/src/text_liquid_fill.dart | 1 + lib/src/typer.dart | 1 + lib/src/typewriter.dart | 1 + lib/src/wavy.dart | 3 +-- 8 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/src/colorize.dart b/lib/src/colorize.dart index a1d7cd0..9f9758b 100644 --- a/lib/src/colorize.dart +++ b/lib/src/colorize.dart @@ -91,6 +91,7 @@ class ColorizeAnimatedTextKit extends StatefulWidget { assert(null != isRepeatingAnimation), super(key: key); + /// Creates the mutable state for this widget. See [StatefulWidget.createState]. @override _ColorizeTextState createState() => _ColorizeTextState(); } diff --git a/lib/src/fade.dart b/lib/src/fade.dart index 8cf5c43..640500c 100644 --- a/lib/src/fade.dart +++ b/lib/src/fade.dart @@ -107,6 +107,7 @@ class FadeAnimatedTextKit extends StatefulWidget { assert(null != isRepeatingAnimation), super(key: key); + /// Creates the mutable state for this widget. See [StatefulWidget.createState]. @override _FadeTextState createState() => _FadeTextState(); } diff --git a/lib/src/rotate.dart b/lib/src/rotate.dart index 82a9fbd..ce463db 100644 --- a/lib/src/rotate.dart +++ b/lib/src/rotate.dart @@ -111,6 +111,7 @@ class RotateAnimatedTextKit extends StatefulWidget { assert(null != isRepeatingAnimation), super(key: key); + /// Creates the mutable state for this widget. See [StatefulWidget.createState]. @override _RotatingTextState createState() => _RotatingTextState(); } diff --git a/lib/src/scale.dart b/lib/src/scale.dart index 9e7c35c..45fea69 100644 --- a/lib/src/scale.dart +++ b/lib/src/scale.dart @@ -114,6 +114,7 @@ class ScaleAnimatedTextKit extends StatefulWidget { assert(null != stopPauseOnTap), super(key: key); + /// Creates the mutable state for this widget. See [StatefulWidget.createState]. @override _ScaleTextState createState() => _ScaleTextState(); } diff --git a/lib/src/text_liquid_fill.dart b/lib/src/text_liquid_fill.dart index 624bf02..06fc3c6 100644 --- a/lib/src/text_liquid_fill.dart +++ b/lib/src/text_liquid_fill.dart @@ -72,6 +72,7 @@ class TextLiquidFill extends StatefulWidget { assert(null != waveColor), super(key: key); + /// Creates the mutable state for this widget. See [StatefulWidget.createState]. @override _TextLiquidFillState createState() => _TextLiquidFillState(); } diff --git a/lib/src/typer.dart b/lib/src/typer.dart index 33c8592..1bf0c96 100644 --- a/lib/src/typer.dart +++ b/lib/src/typer.dart @@ -92,6 +92,7 @@ class TyperAnimatedTextKit extends StatefulWidget { assert(null != stopPauseOnTap), super(key: key); + /// Creates the mutable state for this widget. See [StatefulWidget.createState]. @override _TyperState createState() => _TyperState(); } diff --git a/lib/src/typewriter.dart b/lib/src/typewriter.dart index 94f2d0a..4e77dfa 100644 --- a/lib/src/typewriter.dart +++ b/lib/src/typewriter.dart @@ -107,6 +107,7 @@ class TypewriterAnimatedTextKit extends StatefulWidget { assert(null != isRepeatingAnimation), super(key: key); + /// Creates the mutable state for this widget. See [StatefulWidget.createState]. @override _TypewriterState createState() => _TypewriterState(); } diff --git a/lib/src/wavy.dart b/lib/src/wavy.dart index 585865b..06e8eb6 100644 --- a/lib/src/wavy.dart +++ b/lib/src/wavy.dart @@ -63,14 +63,13 @@ class WavyAnimatedTextKit extends StatefulWidget { /// By default it is set to true. final bool isRepeatingAnimation; + /// Creates the mutable state for this widget. See [StatefulWidget.createState]. @override _WavyAnimatedTextKitState createState() => _WavyAnimatedTextKitState(); } class _WavyAnimatedTextKitState extends State with TickerProviderStateMixin { - // List> _keys; - AnimationController _controller; Animation _waveAnim; Timer _timer; From fd413cb7576f29fd2167e89edb287224609c96f1 Mon Sep 17 00:00:00 2001 From: Anthony Whitford Date: Thu, 5 Nov 2020 23:21:42 -0800 Subject: [PATCH 3/3] Added brief library dartdoc. --- lib/animated_text_kit.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/animated_text_kit.dart b/lib/animated_text_kit.dart index 476795f..32a7ad9 100644 --- a/lib/animated_text_kit.dart +++ b/lib/animated_text_kit.dart @@ -1,3 +1,4 @@ +/// _Animated Text Kit_ is a library of some cool and awesome text animations. library animated_text_kit; export 'src/typer.dart';