Created
June 5, 2020 11:42
-
-
Save SahanAmarsha/abd45484840eec1a90daa0365f6d9d20 to your computer and use it in GitHub Desktop.
Defining a Slide Transition for Flutter App
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AnimationController _controller; | |
Animation<Offset> _myAnimation; | |
@override | |
void initState() { | |
// TODO: implement initState | |
super.initState(); | |
_controller = AnimationController( | |
duration: const Duration(seconds: 2), | |
vsync: this, | |
); | |
_myAnimation = Tween<Offset>( | |
begin: Offset.zero, | |
end: const Offset(1.5, 0.0), | |
).animate(CurvedAnimation( | |
parent: _controller, | |
curve: Curves.elasticIn, | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment