Skip to content

Commit 3cbda23

Browse files
committed
feat(router): update account linking page transition
- Replace MaterialPage with CustomTransitionPage for modal bottom sheet presentation - Implement slide-up animation for the modal bottom sheet - Add barrier dismissible feature to allow closing the modal by tapping outside
1 parent 997c788 commit 3cbda23

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

lib/router/router.dart

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,23 @@ GoRouter createRouter({
201201
GoRoute(
202202
path: Routes.accountLinking,
203203
name: Routes.accountLinkingName,
204-
// Use pageBuilder to create a modal (fullscreen dialog) presentation.
204+
// Use CustomTransitionPage to create a modal bottom sheet presentation.
205205
pageBuilder: (context, state) {
206-
return MaterialPage(
207-
fullscreenDialog: true,
206+
return CustomTransitionPage<void>(
207+
// Set opaque to false to allow the underlying page to be visible.
208+
opaque: false,
209+
// Allow dismissing the modal by tapping outside the sheet.
210+
barrierDismissible: true,
211+
// Define the slide-up transition for the modal bottom sheet.
212+
transitionsBuilder: (context, animation, secondaryAnimation, child) {
213+
return SlideTransition(
214+
position: Tween<Offset>(
215+
begin: const Offset(0, 1), // Start from bottom
216+
end: Offset.zero, // Slide to its final position
217+
).animate(animation),
218+
child: child,
219+
);
220+
},
208221
child: BlocProvider(
209222
create: (context) => AuthenticationBloc(
210223
authenticationRepository: context.read<AuthRepository>(),

0 commit comments

Comments
 (0)