How can you make a Row's content Fractionally Spaced

334 views
Skip to first unread message

Jeff Jorczak

unread,
Aug 19, 2018, 8:11:59 PM8/19/18
to Flutter Dev
I tried:

Row(
children: <Widget>[
FractionallySizedBox(
widthFactor: 0.5,
),
FractionallySizedBox(
widthFactor: 0.25,
),
FractionallySizedBox(
widthFactor: 0.25,
),
]
)


But I get an exception BoxConstraints forces an infinite width.  so I am assuming FractionallySizedBox won't work inside a Row?

Jeff Jorczak

unread,
Aug 19, 2018, 8:22:09 PM8/19/18
to Flutter Dev
Using Wrap instead of Row seemed to work:

Wrap(

Ryan Gonzalez

unread,
Aug 19, 2018, 10:45:19 PM8/19/18
to Jeff Jorczak, Flutter Dev
I think you're looking Expanded or Flexible (Expanded is just Flexible that's forced to fill all its parents space):

Row(
  children: <Widget>[
    Expanded(
      flex: 2,
      child: ...
    ),
    Expanded(
      flex: 1,
      child: ...
    ),
    Expanded(
      flex: 1,
      child: ...
    ),
  ]
)

--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Ryan (ライアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone else
https://refi64.com/

Reply all
Reply to author
Forward
0 new messages