From d32121da704140672d3998b99f2595eb8c7843ab Mon Sep 17 00:00:00 2001 From: Anthony Whitford Date: Fri, 23 Oct 2020 14:57:27 -0700 Subject: [PATCH] Removed redundant duplicate logic. --- lib/src/rotate.dart | 51 ++++++++++++++------------------------------- 1 file changed, 16 insertions(+), 35 deletions(-) diff --git a/lib/src/rotate.dart b/lib/src/rotate.dart index 8f1db95..c722401 100644 --- a/lib/src/rotate.dart +++ b/lib/src/rotate.dart @@ -183,41 +183,22 @@ class _RotatingTextState extends State 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(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(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(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,