Skip to content

Instantly share code, notes, and snippets.

@SahanAmarsha
Created June 5, 2020 11:42
Show Gist options
  • Save SahanAmarsha/abd45484840eec1a90daa0365f6d9d20 to your computer and use it in GitHub Desktop.
Save SahanAmarsha/abd45484840eec1a90daa0365f6d9d20 to your computer and use it in GitHub Desktop.
Defining a Slide Transition for Flutter App
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