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

Cupertino modal bottom sheet not showing properly when using useRootNavigator #340

Open
fbarsotti opened this issue Apr 11, 2023 · 3 comments

Comments

@fbarsotti
Copy link

I have a flutter app (cupertino styled) with a CupertinoTabBar for navigation. On the HomePage, I have a button to go to the settings (where I use MaterialWithModalsPageRoute to navigate, in order to get the animation). When I press the button on the new page to show the popup, it shows correctly (cupertino styled) but UNDER the CupertinoTabBar. Since i dont want this behaviour, I set useRootNavigator = true: but if I do so I don't get the effect I want.

Here i have two screenshots of what I'm talking about:

  1. The first screenshot shows the first error: I get the correct backdrop effect in iOS style, but the popup is under my tabBar
    simulator_screenshot_F2B46657-BF51-4023-81B8-807329D706C1

  2. In the second screenshot I'm able to hide the tabBar with useRootNavigator = true, but i lose the effect i hade before.
    simulator_screenshot_7D58FCA2-135C-4217-A1E0-AF104AF81996

In my HomePage i have a button like this one:

CupertinoButton(
  child: Icon(
    CupertinoIcons.settings,
  ),
  onPressed: () => Navigator.of(context).push(
    MaterialWithModalsPageRoute(
      builder: (context) => SettingsPage(),
    ),
  ),
),

In my SettingsPage, a CupertinoListTile that invokes the popup:

onTap: () => showCupertinoModalBottomSheet(
  context: context,
    builder: (context) => SettingsLanguage(),
),

In simple words, I want the backdrop effect I have on screenshot 1) OVER the tabBar like in screenshot 2).
I tried a few things, but I don't seem to find a solution mentioned in the documentation.
What am I missing?

@mosabalrsaheed
Copy link

Hi @fbarsotti, did you manage to find a solution? I am facing a similar issue.

@fbarsotti
Copy link
Author

Hello @mosabalrsaheed, sadly I couldn't get anywhere, so I left the problem behind hoping for a bug fix or a solution/workaround. I still don't know how to fix this.

@mosabalrsaheed
Copy link

mosabalrsaheed commented Jul 10, 2023

Hi @fbarsotti. my issue turned out to be related to how I was pushing my page, I am using autoroute package.
Using CupertinoScaffold.showCupertinoModalBottomSheet and pushing the previous page as a route(was being pushed as a widget)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants