[FlutterLogo(),//左对齐Expanded(child:SizedBo..._flutter row 图片居右">
当前位置:   article > 正文

flutter row 里面的元素分别居左和居右对齐_flutter row 图片居右

flutter row 图片居右

1.mainAxisAlignment

  1. new Row(
  2.   mainAxisAlignment: MainAxisAlignment.spaceBetween,
  3.   children: [
  4.     new Text("left"),
  5.     new Text("right")
  6.   ]
  7. );

2.Expanded

  1. Row(
  2.   children: <Widget>[
  3.     FlutterLogo(),//左对齐
  4.     Expanded(childSizedBox()),//自动扩展挤压
  5.     FlutterLogo(),//右对齐
  6.   ],
  7. );

3.Spacer

  1. Row(
  2.   children: <Widget>[
  3.     FlutterLogo(),
  4.     Spacer(),
  5.     FlutterLogo(),
  6.   ],
  7. );

4.Flexible

  1. Row(
  2.   children: <Widget>[
  3.     FlutterLogo(),
  4.     Flexible(fit: FlexFit.tight, childSizedBox()),
  5.     FlutterLogo(),
  6.   ],
  7. );

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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/286572
推荐阅读
相关标签
  

闽ICP备14008679号