1.mainAxisAlignment

new Row(

  mainAxisAlignment: MainAxisAlignment.spaceBetween,

  children: [

    new Text("left"),

    new Text("right")

  ]

);

2.Expanded

Row(

  children: <Widget>[

    FlutterLogo(),//左对齐

    Expanded(child: SizedBox()),//自动扩展挤压

    FlutterLogo(),//右对齐

  ],

);

3.Spacer

Row(

  children: <Widget>[

    FlutterLogo(),

    Spacer(),

    FlutterLogo(),

  ],

);

4.Flexible

Row(

  children: <Widget>[

    FlutterLogo(),

    Flexible(fit: FlexFit.tight, child: SizedBox()),

    FlutterLogo(),

  ],

);

转自:https://www.cnblogs.com/lavinia/p/13491191.html

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐