I'm creating a custom widget for a segment control.
return Padding(
padding: const EdgeInsets.symmetric(vertical: 20.0),
child: Container(
decoration: BoxDecoration(border: Border.all(color: Colors.blue)),
child: Row(
mainAxisSize: MainAxisSize.min,
children: buttons,
),
),
);
I want the container to shrink to the minimum size to contain its children. However when I include the widget in a parent, it expands to fill the parent. This is visible because the border from the decoration is larger than the buttons.
How do I force the container to shrink?