My Row()
is too loose. I’d like it to stick to the child.
I tried to add a Flexible with a FlexibleFit.tight with no success.
return Align(
alignment: Alignment.center,
child: Padding(
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 20),
child: Column(children: [
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(10)),
child:
// === The logo
Container(
decoration: BoxDecoration(border: Border.all()),
child: Flexible(
fit: FlexFit.tight,
child: Row(
children: [
StringBadge()
StringBadge()
StringBadge()
])
// etc.
4
Answers
I finally added a
mainAxisSize: MainAxisSize.min
as follows:Just wrap each of the children of ROW with Expanded
you must use Expanded Widget. this widget help to keep all screen.
for Example:
Depending on how your UI should look like, there are few options:
like the others said, wrap each child in an expanded. however, there may be other implications for this depending on the child widget.
use the
mainAxisAlignment
property of the Row widgetSpacer()
to put an expanding space between the widgets