17、Flutter Widget - Spacer;

  RowAnd Columnthere can be uniformly allocated to the sub- Widgetattribute mainAxisAlignment.

Row(
   mainAxisAlignment:MainAxisAlignment.spaceAround,
   children:[
    MyBox(),
    MyBox(),
    MyBox()
   ],
 )
复制代码

  If you want more personalized achieve sub- Widgetspace allocation can be used Spacer;

Row (
  children:[
    MyBox(),
    Spacer(),
    MyBox(),
    Spacer(),
    MyBox(),
],
)
复制代码

  Just add Spacerinstances to the other Widgetbetween, they will expand and create additional space. 1 may be used as the default flexattributes to customize their relative sizes:

Row (
  children:[
    MyBox(),
    Spacer(),
    MyBox(),
    Spacer(flex:3),
    MyBox(),
],
)
复制代码

Guess you like

Origin blog.csdn.net/weixin_34377919/article/details/91395689