I am trying to make a UI which has snackbar like this -
But I am getting the UI -
How can I decrease the width of snackbar, and place it more above the bottom of screen?
Here is the code -
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
width: MediaQuery.of(context).size.width*0.46,
elevation: 5.0,
behavior: SnackBarBehavior.floating,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(35.0)),
content: Wrap(
children: [
Container(
//height: 20,
child: Center(
child: Text(
'Please enter valid email',
),
),
),
],
),
)
);
I tried giving margin to snackbar like -
SnackBar(
width: MediaQuery.of(context).size.width*0.46,
elevation: 5.0,
margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
But, it gives me an exception that out of width or margin, one should be null -
Failed assertion: line 210 pos 10: 'width == null || margin == null': Width and margin can not be used together

