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(
|
GoRoute(
|
||||||
name: 'login',
|
name: 'login',
|
||||||
path: '/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(
|
GoRoute(
|
||||||
name: 'register',
|
name: 'register',
|
||||||
path: '/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(
|
GoRoute(
|
||||||
name: 'main',
|
name: 'main',
|
||||||
|
|
@ -117,6 +135,7 @@ final _router = GoRouter(
|
||||||
builder: (context, state) => const CustomerItemviewPage(),
|
builder: (context, state) => const CustomerItemviewPage(),
|
||||||
),
|
),
|
||||||
GoRoute(
|
GoRoute(
|
||||||
|
name: 'languagesetting',
|
||||||
path: '/languagesetting',
|
path: '/languagesetting',
|
||||||
pageBuilder: (BuildContext context, GoRouterState state) => CustomTransitionPage<void>(
|
pageBuilder: (BuildContext context, GoRouterState state) => CustomTransitionPage<void>(
|
||||||
key: state.pageKey,
|
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))),
|
Tween<Offset>(begin: Offset(0.95, 0), end: Offset.zero).chain(CurveTween(curve: Curves.easeIn))),
|
||||||
child: child),
|
child: child),
|
||||||
),
|
),
|
||||||
// builder: (context, state) => const LanguageSettingPage(),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue