My Goal
I want to display the Flutter's default SnackBar with a ListTile as content.
The problem
For some reason, the Snackbar is almost three times higher than I wanted and seems there is no parameter in the Snackbar to set height.
I checked similar questions, didn't find a working example.
The SnackBar
void showSuccessSnackBar({BuildContext context, String message}) {
Scaffold.of(context).showSnackBar(
SnackBar(
content: Container(
child: ListTile(
leading: _successIcon(),
dense: true,
title: Text(
message,
textAlign: TextAlign.center,
style: TextStyle(
color: HATheme.HOPAUT_PINK,
fontWeight: FontWeight.bold
),
)),
),
behavior: SnackBarBehavior.floating,
duration: Duration(seconds: 3),
backgroundColor: Colors.white));
}
Widget _successIcon() {
return Image.asset(
'assets/icons/success.png',
// resizing this doesn't help
height: 30,
width: 30,
);
}
The size I want:
The actual size: