slide animation on login and register
This commit is contained in:
parent
2decbc43e5
commit
69615fa4b6
1 changed files with 21 additions and 3 deletions
|
|
@ -54,12 +54,30 @@ final _router = GoRouter(
|
|||
GoRoute(
|
||||
name: 'login',
|
||||
path: '/login',
|
||||
builder: (context, state) => const LoginPage(),
|
||||
pageBuilder: (BuildContext context, GoRouterState state) => CustomTransitionPage<void>(
|
||||
key: state.pageKey,
|
||||
child: const LoginPage(),
|
||||
transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation,
|
||||
Widget child) =>
|
||||
SlideTransition(
|
||||
position: animation.drive(
|
||||
Tween<Offset>(begin: Offset(0, 0.95), end: Offset.zero).chain(CurveTween(curve: Curves.easeOut))),
|
||||
child: child),
|
||||
),
|
||||
),
|
||||
GoRoute(
|
||||
name: 'register',
|
||||
path: '/register',
|
||||
builder: (context, state) => const RegisterPage(),
|
||||
pageBuilder: (BuildContext context, GoRouterState state) => CustomTransitionPage<void>(
|
||||
key: state.pageKey,
|
||||
child: const RegisterPage(),
|
||||
transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation,
|
||||
Widget child) =>
|
||||
SlideTransition(
|
||||
position: animation.drive(
|
||||
Tween<Offset>(begin: Offset(0, 0.95), end: Offset.zero).chain(CurveTween(curve: Curves.easeOut))),
|
||||
child: child),
|
||||
),
|
||||
),
|
||||
GoRoute(
|
||||
name: 'main',
|
||||
|
|
@ -117,6 +135,7 @@ final _router = GoRouter(
|
|||
builder: (context, state) => const CustomerItemviewPage(),
|
||||
),
|
||||
GoRoute(
|
||||
name: 'languagesetting',
|
||||
path: '/languagesetting',
|
||||
pageBuilder: (BuildContext context, GoRouterState state) => CustomTransitionPage<void>(
|
||||
key: state.pageKey,
|
||||
|
|
@ -128,7 +147,6 @@ final _router = GoRouter(
|
|||
Tween<Offset>(begin: Offset(0.95, 0), end: Offset.zero).chain(CurveTween(curve: Curves.easeIn))),
|
||||
child: child),
|
||||
),
|
||||
// builder: (context, state) => const LanguageSettingPage(),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue