Changed animation on route
This commit is contained in:
parent
6fc81869a3
commit
2bd32df8fd
1 changed files with 31 additions and 2 deletions
|
|
@ -18,9 +18,38 @@ final _router = GoRouter(
|
||||||
initialLocation: '/',
|
initialLocation: '/',
|
||||||
routes: [
|
routes: [
|
||||||
GoRoute(name: 'index', path: '/', builder: (context, state) => const IndexPage()),
|
GoRoute(name: 'index', path: '/', builder: (context, state) => const IndexPage()),
|
||||||
GoRoute(name: 'login', path: '/login', builder: (context, state) => const LoginPage()),
|
GoRoute(
|
||||||
|
name: 'login',
|
||||||
|
path: '/login',
|
||||||
|
builder: (context, state) => const LoginPage(),
|
||||||
|
pageBuilder: (BuildContext context, GoRouterState state) => CustomTransitionPage<void>(
|
||||||
|
key: state.pageKey,
|
||||||
|
child: const LoginPage(),
|
||||||
|
transitionsBuilder: (context, animation, secondaryAnimation, child) {
|
||||||
|
return SlideTransition(
|
||||||
|
position: Tween<Offset>(begin: Offset(-1.0, 0.0), end: Offset.zero).animate(animation),
|
||||||
|
child: child,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
GoRoute(name: 'approval', path: '/approval', builder: (context, state) => const ApprovalPage()),
|
GoRoute(name: 'approval', path: '/approval', builder: (context, state) => const ApprovalPage()),
|
||||||
GoRoute(name: 'validate', path: '/validate', builder: (context, state) => const ValidatePage()),
|
GoRoute(
|
||||||
|
name: 'validate',
|
||||||
|
path: '/validate',
|
||||||
|
builder: (context, state) => const ValidatePage(),
|
||||||
|
pageBuilder: (BuildContext context, GoRouterState state) => CustomTransitionPage<void>(
|
||||||
|
key: state.pageKey,
|
||||||
|
child: const ValidatePage(),
|
||||||
|
transitionsBuilder: (context, animation, secondaryAnimation, child) {
|
||||||
|
return SlideTransition(
|
||||||
|
position: Tween<Offset>(begin: Offset(1.0, 0.0), end: Offset.zero).animate(animation),
|
||||||
|
child: child,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// GoRoute(name: 'validate', path: '/validate', builder: (context, state) => const ValidatePage()),
|
||||||
GoRoute(name: 'result', path: '/result', builder: (context, state) => const ValidationResultPage()),
|
GoRoute(name: 'result', path: '/result', builder: (context, state) => const ValidationResultPage()),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue