flutter 如何让两个子控件左对齐和右对齐

第一种:Flexible

Row(
  children: <Widget>[
    Align(
      alignment: Alignment.centerLeft,
      child: Text('123'),
    ),
    Flexible(fit: FlexFit.tight, child: SizedBox()),
    Align(
      alignment: Alignment.centerRight,
      child:
          Image.asset('lib/images/arrow_right.png'),
    )
  ],
)

第二种:spaceBetween

Row(
  mainAxisAlignment: MainAxisAlignment.spaceBetween,
  children: <Widget>[
    Align(
      alignment: Alignment.centerLeft,
      child: Text('123'),
    ),
    Align(
      alignment: Alignment.centerRight,
      child:
          Image.asset('lib/images/arrow_right.png'),
    )
  ],
)
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 编程工作室 设计师: CSDN官方博客
应支付0元
点击重新获取
扫码支付

支付成功即可阅读