问题描述
我使用的代码:
Badge(
badgeColor: CUSTOM_GREEN,shape: BadgeShape.square,borderRadius: 20,toAnimate: false,badgeContent: Text("Responded",style: TextStyle(
color: Colors.white,fontSize: 12)),)
有什么办法可以将徽章对齐到最右边?
解决方法
将MainAxisAlignment.spaceBetween与“行”小部件一起使用。
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)),)
]),