0

I am showing a log in button in a page. Once the user has logged in, the SnackBar will display "Logged In with Google" for example. While the SnackBar is still showing, the body of the Scaffold is being build to a new page, the one accessible by logged in users. However, building the page while the Snackbar is still showing somehow leaves a padding in the Scaffold, in the area used by the SnackBar, so the underlying Scaffold body is still visible, yet you cannot interact with it. If there is a button at the bottom of that body, the button is not tapped because the invisible padding left behind by the (already closed) SnackBar blocks the content underneath.

What am I missing? Is there another way to produce the desired result?

enter image description here

FCR
  • 1,103
  • 10
  • 25
  • I have found the problem root cause. If in one page shows a Snackbar and while showing it, the user moves to another page (for example in a bottomNagationBar) the new page is build with the padding issue that I mentioned. However, if the `SnackBar` disappears before moving to another page, there is no issue. So 'transporting' a visible `SnackBar` to another page produces many issues. Any idea what can be done? – FCR May 01 '21 at 20:08

1 Answers1

0

I wrapped the Scaffold with a ScaffoldMessenger in every page and now seems to work. I will elaborate on the answer later on.

FCR
  • 1,103
  • 10
  • 25