Row
And Column
there can be uniformly allocated to the sub- Widget
attribute mainAxisAlignment
.
Row(
mainAxisAlignment:MainAxisAlignment.spaceAround,
children:[
MyBox(),
MyBox(),
MyBox()
],
)
复制代码
If you want more personalized achieve sub- Widget
space allocation can be used Spacer
;
Row (
children:[
MyBox(),
Spacer(),
MyBox(),
Spacer(),
MyBox(),
],
)
复制代码
Just add Spacer
instances to the other Widget
between, they will expand and create additional space. 1 may be used as the default flex
attributes to customize their relative sizes:
Row (
children:[
MyBox(),
Spacer(),
MyBox(),
Spacer(flex:3),
MyBox(),
],
)
复制代码