flutterdartflutter-showmodalbottomsheetflutter-go-router

showModalBottomSheet not working properly within nested go router navigation


I am using go_router package for Navigation 2.0, but while running showModalBottomSheetFunction, the view is not showing correctly. Here is the picture: enter image description here

By the way, I am using nested navigation for bottom navigation bar.

I was expecting that ModalBottomSheet should look proper.


Solution

  • The navigation bar is probably above your navigation tree (the nested one). To cover the navigation bar with the bottom sheet use: useRootNavigator: true

        showModalBottomSheet(
            useRootNavigator: true,
            context: context,
            builder: (BuildContext context) {
                return const Text("hello");
            });