Skip to content

Commit

Permalink
Merge pull request #134 from awhitford/rotate_dup
Browse files Browse the repository at this point in the history
Removed redundant duplicate logic.
  • Loading branch information
aagarwal1012 committed Oct 23, 2020
2 parents 4028ab0 + d32121d commit 2324d91
Showing 1 changed file with 16 additions and 35 deletions.
51 changes: 16 additions & 35 deletions lib/src/rotate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -183,41 +183,22 @@ class _RotatingTextState extends State<RotateAnimatedTextKit>
vsync: this,
);

if (_index == 0) {
_slideIn = AlignmentTween(
begin: const Alignment(-1.0, -1.0) + widget.alignment,
end: const Alignment(-1.0, 0.0) + widget.alignment,
).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.0, 0.4, curve: Curves.linear),
),
);

_fadeIn = Tween<double>(begin: 0.0, end: 1.0).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.0, 0.4, curve: Curves.easeOut),
),
);
} else {
_slideIn = AlignmentTween(
begin: const Alignment(-1.0, -1.0) + widget.alignment,
end: const Alignment(-1.0, 0.0) + widget.alignment,
).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.0, 0.4, curve: Curves.linear),
),
);

_fadeIn = Tween<double>(begin: 0.0, end: 1.0).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.0, 0.4, curve: Curves.easeOut),
),
);
}
_slideIn = AlignmentTween(
begin: const Alignment(-1.0, -1.0) + widget.alignment,
end: const Alignment(-1.0, 0.0) + widget.alignment,
).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.0, 0.4, curve: Curves.linear),
),
);

_fadeIn = Tween<double>(begin: 0.0, end: 1.0).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.0, 0.4, curve: Curves.easeOut),
),
);

_slideOut = AlignmentTween(
begin: const Alignment(-1.0, 0.0) + widget.alignment,
Expand Down

0 comments on commit 2324d91

Please sign in to comment.