Skip to content

Instantly share code, notes, and snippets.

@shinayser
Created May 25, 2021 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shinayser/8c352e6fd465bea748e9076b7481f24b to your computer and use it in GitHub Desktop.
Save shinayser/8c352e6fd465bea748e9076b7481f24b to your computer and use it in GitHub Desktop.
class LateralNavigationPageRoute<T> extends MaterialPageRoute<T> {
LateralNavigationPageRoute({
required WidgetBuilder builder,
RouteSettings? settings,
}) : super(builder: builder, settings: settings);
@override
Widget buildTransitions(BuildContext context, Animation<double> animation,
Animation<double> secondaryAnimation, Widget child) =>
SlideTransition(
position: Tween<Offset>(
begin: const Offset(1, 0),
end: Offset.zero,
).animate(animation),
child: SlideTransition(
position: Tween<Offset>(
end: const Offset(-1, 0),
begin: Offset.zero,
).animate(secondaryAnimation),
child: child,
),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment