Skip to content

Instantly share code, notes, and snippets.

@itskgore
Last active May 6, 2020 14:29
Show Gist options
  • Save itskgore/a71a1035484d1ed8af5ec067b3123748 to your computer and use it in GitHub Desktop.
Save itskgore/a71a1035484d1ed8af5ec067b3123748 to your computer and use it in GitHub Desktop.
Bounce in animated navigation effect using flutter and dart
import 'package:flutter/material.dart';
class BounceInNavigation extends PageRouteBuilder {
final Widget widget;
BounceInNavigation({this.widget})
: super(
transitionDuration: Duration(milliseconds: 270),
transitionsBuilder: (BuildContext con, Animation<double> animation,
Animation<double> secAnimation, Widget child) {
animation = CurvedAnimation(
parent: animation, curve: Curves.easeInOutBack);
return ScaleTransition(
scale: animation,
alignment: Alignment.topCenter,
child: child,
);
},
pageBuilder: (BuildContext context, Animation<double> animation,
Animation<double> secanimation) {
return widget;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment