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

the modal dialog or sheet is not centering properly when called from within a ShellRoute in a Flutter app #147839

Open
talpx0 opened this issue May 4, 2024 · 1 comment
Labels
in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds

Comments

@talpx0
Copy link

talpx0 commented May 4, 2024

image

class NavigationDestination {
  const NavigationDestination({
    required this.route,
    required this.label, 
    required this.icon,
    this.child,
  });

  final String route;
  final String label;
  final Icon icon;
  final Widget? child;
}


const List<NavigationDestination> destinations = [
  NavigationDestination(
    label: 'Home',
    icon: Icon(Icons.home),
    route: '/',
  ),
  NavigationDestination(
    label: 'Explore',
    icon: Icon(Icons.playlist_add_check),
    route: '/explore',
  ),
  NavigationDestination(
    label: 'AI',
    icon: Icon(Icons.air),
    route: '/ai',
  ),
  NavigationDestination(
    label: 'Settings',
    icon: Icon(Icons.settings),
    route: '/settings',
  ),
  
];



const shellNavigatorKey = ValueKey('_scaffoldKey');
final rootNavigatorKey = GlobalKey<NavigatorState>();

final appRouter = GoRouter(
  initialLocation: '/',
  navigatorKey: rootNavigatorKey,
  routes: [
    ShellRoute(
      parentNavigatorKey: rootNavigatorKey,
      builder: (BuildContext context, GoRouterState state, Widget child) {
        int currentIndex = destinations.indexWhere((destination) =>
          state.fullPath!.startsWith(destination.route));
        return RootLayout(
          currentIndex: currentIndex,
          child: child,
        );
      },
      routes: [
        GoRoute(
          path: '/',
          builder: (context, state) => const HomePage(),
        ),
        GoRoute(
          path: '/explore',
          builder: (context, state) => const SettingsPage(),
          
        ),
        GoRoute(
          path: '/ai',
          builder: (context, state) => const SettingsPage(),
        ),
        GoRoute(
          path: '/settings',
          builder: (context, state) => const SettingsPage(),
          routes: [
            GoRoute(
              path: 'appearance',
              builder: (context, state) => const ThemeScreen(),
            ),
          ],
        ),
      ],
    ),
    // Additional routes outside the shell can be defined here
  ],
);

I would expect the modal show as overlay and in the center of the screen , but not in the center of the child .

@huycozy huycozy added the in triage Presently being triaged by the triage team label May 6, 2024
@huycozy
Copy link
Member

huycozy commented May 6, 2024

Hi @talpx0
Could you please provide a completed and minimal reproducible code sample that doesn’t include 3rd party plugins or complex production code? Also, please provide the output of flutter doctor -v as well. Thank you!

This may be related/similar to #146772.

@huycozy huycozy added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds
Projects
None yet
Development

No branches or pull requests

2 participants