Skip to content

Commit

Permalink
Issue #58 resolved (#74)
Browse files Browse the repository at this point in the history
* Rotating text : add animation objects and controller

* Rotating text : add text widgets

* Rotating text : nested text widgets with animation builder

* Rotating text : working

* Typer : removed addlisteners for animations

* Rotating text : removed animation listeners and code cleanup

* Typewriter : partially working code

* Typewriter : working

* Typewriter : added default parameter for duration and made text @required for all

* refractor names

* Fade : working

* Colorizer : gradient text made

* Typewriter : dart analuysis error removed

* Colorizer : working

* Colorizer : updated ui

* Colorizer : refrator name

* Colorize : added tuning parameter

* Colorize : made text string to list and added fade animation

* Colorize : added default value of duration

* fixed some ui

* Typewriter : added default value of duration

* Typewriter : added else value of duration

* Colorize : added default value of duration

* Fade : added default value of duration

* Rotate : added default value of duration and added a new parameter transition height and added its default value

* Typer : added default value of duration

* Rotate : change slide curve to linear

* fade : change fade curve to linear

* Scale : working

* Scale : added scaling parameter

* Made basic example app ui

* Added fonts

* made theme for typer and typewriter

* made theme for rest animated texts

* showcase completed

* added cover widget

* fixed play button alignment

* Typer : updated default value of duration

* added labels for animations in ui

* added smoke test {not working}

* fixed testing errors

* Updated LICENSE

* added example app testing in travis.yaml

* added preview gifs

* fixed formatting issues

* initial release 1.0.1

* Updated README.md

* updated flutter version compatibility

* fixed flutter compatibility issues

* Added CODE_OF_CONDUCT.md

* Update issue templates

* Added contributing.md and updated readme

* Added pull request template

* Updated readme and contributions.md

* Updated version to 1.0.2

* added table of contents to readme

* Updated pull request section in contributing.md

* Update travis.yaml and contributing.md

* Remove travis build errors

* 🎨 fix formating in test file

* 🎉 update version to 1.0.3

* ⬆️ added onTap event for all text animations

* ⬆️ updated example

* 🐛 changed InkWell widget to GestureDetector for the onTap event

* 🔥 fixed formatting issues

* 🐛 fixed dart analysis issues

* 🎉 updated to version 1.1.0

* 💚 added some animations for the roadmap

* 🐛 fixed formatting issues

* add .idea to .gitignore

* Expand .gitignore, Add flag for running animation once, update gradle.

* 🐛 fixed fading with isRepeatingAnimation is set false

* 📝 added isRepeatingAnimation to Readme

* 🎉 updated version to 1.2.0

* Added alignment property to Stack and textAlign property to Text

* Added GenericAnimatedTextKit to simplify some initialization
Added some common assertions

* Revert "Added GenericAnimatedTextKit to simplify some initialization"

This reverts commit 1dc30cc.

* Updated README.md.

Added the usage of "textAlign" and "alignment" properties

* 🐛 fixed opacity value in typer

* 🎉 updated to 1.3.0

* Updated Readme

* docs: added documentation for the various parameters of all the animated text widgets

* docs: updated example app readme

* conf: updated travis script

* conf: updated package to version 1.3.1

* conf: create funding.yml

* docs: updated docs for duration parameter

* docs: updated contributing.md

* bfix: fixed travis

* conf: added codecov coverage

* docs: add salihgueler as a contributor (#36)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: updated readme

* docs: add anderscheow as a contributor (#37)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add r1walz as a contributor (#38)

* docs: update README.md

* docs: update .all-contributorsrc

* Enhanced different classes of AnimatedTextKit

* Fixed travis issue

* Typer Class Enhancments (#40)

* Typer Class Enhancments

Refer to issue #34
The Typer Class has been greatly improved in term of control. 

### Let's start with breaking changes : 
####The duration parameter has become two new ones : speed and pause
  * speed is the elapsed time between the animation of each characters of a text (Default is 40 ms)
  * pause is the pause duration between texts (Default is 500 ms)

### New features : 
####Three new callbacks come alongside the onTap :  
  * 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
####Two new arguments : 
  * displayFullTextOnTap - If true, tapping the screen will stop current animated text, and display it fully for min(remaining, pause) time. (Default is false)
  * stopPauseOnTap - If true, tapping during a pause will stop it and start the next text animation (Default is false)
####The text list parameter now accept either strings, or map where you can give a text custom speed and pause.

If you like thoses changes, I'll make another commit with updated readme regarding this PR with code examples.

* Fix indentation issues for Travis

* Fix indentation issues for Travis

* Fix formating issue in travis

* chor: deleted flutter_export_environment.sh file (unnecessary)

* Addeed TextLiquidFill animation to AnimatedTextKit

* chor: fixed formatting issues

* bfix: fixed Travis fail

* conf: updated to version 2.0.0

* chor: updated readme

* docs: add AdamSGit as a contributor (#49)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* docs: add hemilpanchiwala as a contributor (#50)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* docs: added text liquid fill medium blog link in Readme

* feat: updated to v2.0.1 (#67)

* #44 fix

* added gitignore

* gitignore

* Issue 58

* Changed back to default example

Co-authored-by: aagarwal1012 <[email protected]>
Co-authored-by: r1walz <[email protected]>
Co-authored-by: Muhammed Salih Guler <[email protected]>
Co-authored-by: Anders Cheow <[email protected]>
Co-authored-by: Anders Cheow <[email protected]>
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Hemil Panchiwala <[email protected]>
Co-authored-by: AdamSGit <[email protected]>
  • Loading branch information
9 people committed May 18, 2020
1 parent 72229de commit 13da380
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 56 deletions.
8 changes: 3 additions & 5 deletions lib/src/colorize.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class _RotatingTextState extends State<ColorizeAnimatedTextKit>

@override
void dispose() {
_controller.dispose();
_controller?.dispose();
super.dispose();
}

Expand Down Expand Up @@ -204,9 +204,7 @@ class _RotatingTextState extends State<ColorizeAnimatedTextKit>
_index++;
}

if (_controller != null) _controller.dispose();

setState(() {});
if (mounted) setState(() {});

_controller = new AnimationController(
duration: _texts[_index]['speed'] * _texts[_index]['text'].length,
Expand All @@ -231,7 +229,7 @@ class _RotatingTextState extends State<ColorizeAnimatedTextKit>
curve: Interval(0.0, 1.0, curve: Curves.easeIn)))
..addStatusListener(_animationEndCallback);

_controller.forward();
_controller?.forward();
}

void _animationEndCallback(state) {
Expand Down
16 changes: 6 additions & 10 deletions lib/src/fade.dart
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,13 @@ class _RotatingTextState extends State<FadeAnimatedTextKit>
_texts.add({'text': widget.text[i], 'pause': _pause});
}
}

_nextAnimation();
}

@override
void dispose() {
_controller
..stop()
..dispose();
_controller?.stop();
_controller.dispose();
super.dispose();
}

Expand Down Expand Up @@ -214,9 +212,7 @@ class _RotatingTextState extends State<FadeAnimatedTextKit>
_index++;
}

if (_controller != null) _controller.dispose();

setState(() {});
if (mounted) setState(() {});

_controller = new AnimationController(
duration: _duration,
Expand All @@ -230,14 +226,14 @@ class _RotatingTextState extends State<FadeAnimatedTextKit>
parent: _controller, curve: Interval(0.8, 1.0, curve: Curves.linear)))
..addStatusListener(_animationEndCallback);

_controller..forward();
_controller.forward();
}

void _setPause() {
bool isLast = _index == widget.text.length - 1;

_isCurrentlyPausing = true;
setState(() {});
if (mounted) setState(() {});

// Handle onNextBeforePause callback
if (widget.onNextBeforePause != null)
Expand Down Expand Up @@ -265,7 +261,7 @@ class _RotatingTextState extends State<FadeAnimatedTextKit>
pause = _texts[_index]['pause'].inMilliseconds;
left = widget.duration.inMilliseconds;

_controller.stop();
_controller?.stop();

_setPause();

Expand Down
13 changes: 5 additions & 8 deletions lib/src/rotate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,8 @@ class _RotatingTextState extends State<RotateAnimatedTextKit>

@override
void dispose() {
_controller
..stop()
..dispose();
_controller?.stop();
_controller?.dispose();
super.dispose();
}

Expand Down Expand Up @@ -222,9 +221,7 @@ class _RotatingTextState extends State<RotateAnimatedTextKit>
_index++;
}

if (_controller != null) _controller.dispose();

setState(() {});
if (mounted) setState(() {});

if (widget.transitionHeight == null) {
_transitionHeight = widget.textStyle.fontSize * 10 / 3;
Expand Down Expand Up @@ -278,7 +275,7 @@ class _RotatingTextState extends State<RotateAnimatedTextKit>
bool isLast = _index == widget.text.length - 1;

_isCurrentlyPausing = true;
setState(() {});
if (mounted) setState(() {});

// Handle onNextBeforePause callback
if (widget.onNextBeforePause != null)
Expand All @@ -301,7 +298,7 @@ class _RotatingTextState extends State<RotateAnimatedTextKit>
} else {
pause = _texts[_index]['pause'].inMilliseconds;

_controller.stop();
_controller?.stop();

_setPause();

Expand Down
8 changes: 2 additions & 6 deletions lib/src/scale.dart
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,8 @@ class _RotatingTextState extends State<ScaleAnimatedTextKit>

@override
void dispose() {
if (_controller != null)
_controller
..stop()
..dispose();
_controller?.stop();
_controller?.dispose();
super.dispose();
}

Expand Down Expand Up @@ -225,8 +223,6 @@ class _RotatingTextState extends State<ScaleAnimatedTextKit>
_index++;
}

if (_controller != null) _controller.dispose();

setState(() {});

_controller = new AnimationController(
Expand Down
14 changes: 4 additions & 10 deletions lib/src/text_liquid_fill.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,10 @@ class _TextLiquidFillState extends State<TextLiquidFill>

@override
void dispose() {
if (_waveController != null)
_waveController
..stop()
..dispose();

if (_loadController != null)
_loadController
..stop()
..dispose();

_waveController?.stop();
_waveController?.dispose();
_loadController?.stop();
_loadController?.dispose();
super.dispose();
}

Expand Down
12 changes: 4 additions & 8 deletions lib/src/typer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,8 @@ class _TyperState extends State<TyperAnimatedTextKit>

@override
void dispose() {
if (_controller != null)
_controller
..stop()
..dispose();
_controller?.stop();
_controller?.dispose();
super.dispose();
}

Expand Down Expand Up @@ -187,9 +185,7 @@ class _TyperState extends State<TyperAnimatedTextKit>
_index++;
}

if (_controller != null) _controller.dispose();

setState(() {});
if (mounted) setState(() {});

_controller = new AnimationController(
duration: _texts[_index]['speed'] * _texts[_index]['text'].length,
Expand All @@ -207,7 +203,7 @@ class _TyperState extends State<TyperAnimatedTextKit>
bool isLast = _index == widget.text.length - 1;

_isCurrentlyPausing = true;
setState(() {});
if (mounted) setState(() {});

// Handle onNextBeforePause callback
if (widget.onNextBeforePause != null)
Expand Down
13 changes: 4 additions & 9 deletions lib/src/typewriter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,8 @@ class _TypewriterState extends State<TypewriterAnimatedTextKit>

@override
void dispose() {
if (_controller != null) {
_controller
..stop()
..dispose();
}
_controller?.stop();
_controller?.dispose();
super.dispose();
}

Expand Down Expand Up @@ -229,9 +226,7 @@ class _TypewriterState extends State<TypewriterAnimatedTextKit>
_index++;
}

if (_controller != null) _controller.dispose();

setState(() {});
if (mounted) setState(() {});

_controller = new AnimationController(
duration: _texts[_index]['speed'] * _texts[_index]['text'].length,
Expand All @@ -250,7 +245,7 @@ class _TypewriterState extends State<TypewriterAnimatedTextKit>
bool isLast = _index == widget.text.length - 1;

_isCurrentlyPausing = true;
setState(() {});
if (mounted) setState(() {});

// Handle onNextBeforePause callback
if (widget.onNextBeforePause != null)
Expand Down

0 comments on commit 13da380

Please sign in to comment.