Cannot set height for snack bar. I need to use snack bar action. But the action label affect snack bar height, when give a long action label text. Does anyone face the same issue ?
long label text affect snackbar height:
short label text is normal:
Reproduce code:
final snackBar = SnackBar(
shape: const StadiumBorder(),
content: const Text('Alamat belum lengkap.',
style: TextStyle(color: Colors.white)),
action: SnackBarAction(
label: 'Lengkapi Alamat',
onPressed: () {},
),
);
ScaffoldMessenger.of(context).showSnackBar(snackBar);


It seems like the
SnackBarwill be as big as its child.As an alternative, you can use the
another_flushbarpackage.There's also a
mainButtonproperty as an alternative to yourSnackBarAction.Here's a complete example: