I’m trying to add padding to an OutlinedButton, but the vertical padding doesn’t seem to work properly. I set the padding to 10, and when I set the child’s height and width to 20, I see in the Inspector that the width of the OutlinedButton is 40, which is as expected, but the height is only 24. Why is that?Below is my code and a screenshot of the inspector.
OutlinedButton(
style: TextButton.styleFrom(
minimumSize: Size.zero,
padding: const EdgeInsets.all(10),
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
side: const BorderSide(
color: mainColor,
),
),
onPressed: () {},
child: const SizedBox(height: 20,width: 20,),
)
enter image description here
In my opinion, the vertical padding should be the same as the value I set
New contributor
shane is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.