flutter - 有什么方法可以将颤振中的徽章对齐到最右边?
问题描述
我使用的代码:
Badge(
badgeColor: CUSTOM_GREEN,
shape: BadgeShape.square,
borderRadius: 20,
toAnimate: false,
badgeContent: Text("Responded",
style: TextStyle(
color: Colors.white, fontSize: 12)),
)
有什么办法可以将徽章对齐到最右边吗?
解决方案
将 MainAxisAlignment.spaceBetween 与 Row 小部件一起使用。
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Row(children: <Widget>[
CircleAvatar(),
Column(
children: [],
)
]),
Badge(
badgeColor: CUSTOM_GREEN,
shape: BadgeShape.square,
borderRadius: 20,
toAnimate: false,
badgeContent: Text("Responded",
style: TextStyle(color: Colors.white, fontSize: 12)),
)
]),
推荐阅读
- google-sheets - 如何根据 Google 表格上不同工作表的条件提取唯一行
- angular - NGXS 状态返回对象而不是实际数据
- node.js - 指定跨域资源策略以防止资源被阻止
- javascript - array.includes doesn't work when checking if an iterator exists in array
- python - 在 Python 中按值对矩阵进行排序
- android-studio - 如何删除或最小化android studio资产文件夹中的Audience_Network.dex文件?
- java - Do a HTTP POST instead of a GET
- r - 使用 purrr 和 select 创建二分变量
- android - UriMatcher matching wilcard? (Crash in Android mail app)
- c++ - 当分子和分母都有一个有限的范围时,找到一个实数的有理逼近