I am working on a Flutter web app using go_router. I need to display a dialog outside the ShellRoute view.
I have the following code:
ShellRoute(
builder: (context, state, child) {
return HomePage(
child: child,
),
);
},
routes: [
GoRoute(
path: '/home',
name: 'home',
pageBuilder: (_, state) => NoTransitionPage(
child: const SplashScreen(),
),
),
GoRoute(
path: '/dashboard',
name: 'dashboard-parent',
pageBuilder: (_, state) => NoTransitionPage(
child: DashboardPage.show(
key: ValueKey(state.params['id'] ?? ''),
),
),
routes: [
GoRoute(
path: 'details',
name: 'details',
pageBuilder: (_, state) => AlertDialog(),
),
],
),
],
),
class AlertDialog extends Page {
@override
Route createRoute(BuildContext context) => RawDialogRoute(
pageBuilder: (BuildContext context, Animation<double> animation,
Animation<double> secondaryAnimation) =>
Text('TEST'),
settings: this,
);
}
It works quite well, but I have a problem with the position of the dialog. I need to render it outside of the main container. Please take a look at this picture.
Do you have any idea on how can I achieve that result?