ScaffoldMessenger shown under NavBar
marcoberetta96 opened this issue · 1 comments
marcoberetta96 commented
ScaffoldMessenger messages are shown under the CurvedNavigationBar and this looks very ugly.
Is there any way to show ScaffoldMessenger messages on the top of the CurvedNavigationBar?
Thanks!
rafalbednarczuk commented
It's possible to show the SnackBar
over CurvedNavigationBar
by setting behavior
and margin
.
CurvedNavigationBar
is set that way that it overflows over the body
of a Scaffold
, that's why by default the SnackBar
is under the CurvedNavigationBar
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
behavior:SnackBarBehavior.floating ,
margin: EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 20.0),
content: Text("Very important message"),
),
);