Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added animations in authentication page #28

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix #24:added animations in authentication page
avirupnandi1 committed Jan 15, 2024
commit fe2d29c34a3466f82b5c14d4b44cab0f7644bc74
55 changes: 49 additions & 6 deletions lib/route_generator.dart
Original file line number Diff line number Diff line change
@@ -46,24 +46,67 @@ final goRouterProvider = Provider<GoRouter>((ref) {
GoRoute(
name: 'Login',
path: '/login',
pageBuilder: (context, state) => const MaterialPage(child: LoginPage()),
pageBuilder: (context, state) => CustomTransitionPage<void>(
key: state.pageKey,
child: LoginPage(), // Directly use the page content widget here
transitionsBuilder: (context, animation, secondaryAnimation, child) =>
SlideTransition(
position: Tween<Offset>(
begin: const Offset(1.0, 0.0),
end: Offset.zero,
).animate(animation),
child: child,
),
),
),
GoRoute(
name: 'Signup',
path: '/signup',
pageBuilder: (context, state) =>
const MaterialPage(child: SignupPage()),
pageBuilder: (context, state) => CustomTransitionPage<void>(
key: state.pageKey,
child: SignupPage(), // Directly use the page content widget here
transitionsBuilder: (context, animation, secondaryAnimation, child) =>
SlideTransition(
position: Tween<Offset>(
begin: const Offset(1.0, 0.0),
end: Offset.zero,
).animate(animation),
child: child,
),
),
),
GoRoute(
name: 'Forgot Password',
path: '/forgot-password',
pageBuilder: (context, state) =>
const MaterialPage(child: ForgotPasswordScreen()),
pageBuilder: (context, state) => CustomTransitionPage<void>(
key: state.pageKey,
child:
ForgotPasswordScreen(), // Directly use the page content widget here
transitionsBuilder: (context, animation, secondaryAnimation, child) =>
SlideTransition(
position: Tween<Offset>(
begin: const Offset(1.0, 0.0),
end: Offset.zero,
).animate(animation),
child: child,
),
),
),
GoRoute(
name: 'Clickboard',
path: '/',
pageBuilder: (context, state) => const MaterialPage(child: AppScreen()),
pageBuilder: (context, state) => CustomTransitionPage<void>(
key: state.pageKey,
child: AppScreen(), // Directly use the page content widget here
transitionsBuilder: (context, animation, secondaryAnimation, child) =>
SlideTransition(
position: Tween<Offset>(
begin: const Offset(1.0, 0.0),
end: Offset.zero,
).animate(animation),
child: child,
),
),
),
GoRoute(
name: 'About us',