Home > Enterprise >  Flutter SnackBar's height
Flutter SnackBar's height

Time:10-09

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 enter image description here

The actual size:

enter image description here

CodePudding user response:

you can add height to that container and your problem will be fixed

 Container(
    height: 10
    child: ListTile(
        leading: _successIcon(),
        dense: true,
        title: Text(
          message,
          textAlign: TextAlign.center,
          style: TextStyle(
            color: HATheme.HOPAUT_PINK,
            fontWeight: FontWeight.bold
          ),
        )
  • Related