gpt4 book ai didi

flutter - Flutter-mainAxisAlignment对列中的行不起作用

转载 作者:行者123 更新时间:2023-12-03 04:44:14 29 4
gpt4 key购买 nike

我对RowColumn小部件很熟悉。但是我在'float'中以父Row的正确大小对Row的内容进行尝试尝试Column时遇到了麻烦,但无法正常工作

Row(
// mainAxisSize: MainAxisSize.min,
mainAxisAlignment:
isMine ? MainAxisAlignment.end : MainAxisAlignment.start,
children: <Widget>[
Container(
margin: isMine
? EdgeInsets.only(right: 10.0, bottom: 20.0)
: EdgeInsets.only(
left: 10.0,
bottom: 20.0,
),
constraints: BoxConstraints(maxWidth: deviceSize.width * 0.85),
decoration: BoxDecoration(
color: isMine ? Colors.green[200] : Colors.grey[300],
borderRadius: BorderRadius.circular(10.0)),
padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 10.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(message),
Row(
// Horizontally
mainAxisAlignment: MainAxisAlignment.end,
// Vertically
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(sentAtToSting(sentAt)),
SizedBox(width: 10.0),
Icon(Icons.done_all)
],
),
],
),
),
],
);
enter image description here
那么有人可以帮助我将包含时间和图标的 Row移动到突出显示区域的右侧吗?
我将非常感谢您的帮助!
谢谢 !

最佳答案

这是因为您使用

mainAxisSize: MainAxisSize.min
尝试移除主轴尺寸并查看

关于flutter - Flutter-mainAxisAlignment对列中的行不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62586367/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com