Search code examples
flutterdarttransparencyflutter-bottomnavigation

Flutter why is Navigator changing colour of Scaffold beneath transparent Widget


Q) Why in this DartPad is the transparent page not showing solid blue like the BottomNavigationBar, which is also transparent?

Edit: This is just to illustrate the problem that is occurring on my iOS device + simulator.

Edit2: This was working fine in Flutter V2, now not so much in Flutter V3!

  • Explanation:

I've got a persistent BottomNavigationBar and I'm wrapping each tab's page with its own 'Navigator', so I can have individual page stacks. That's all fine.

However, in this example, I want my pages to be transparent and show the colour behind, which is wrapping the whole screen.

  • To demonstrate:

If you go to line 156 - you can toggle between: return _page!; and return Visibility(...

Screenshot bad:

enter image description here

Screenshot good:

enter image description here


Solution

  • This is a regression bug from v2 to v3. Github issue here:

    https://github.com/flutter/flutter/issues/105738