我正在使用FilterChip
和CircleAvatar
作为头像,但是所选状态有一个令人讨厌的矩形,我似乎找不到任何参考。如何删除它?
代码:
child: FilterChip(
avatar: CircleAvatar(
backgroundColor: category.color
),
label: Text(category.name),
selected: badCategoryIds.contains(category.id),
onSelected: (bool value) {
if (value) {
badCategoryIds.add(category.id);
}
else {
badCategoryIds.remove(category.id);
}
categoryChoiceCallback(badCategoryIds);
},
)
结果:
我希望它如何显示(摘自material.io文档)
答案 0 :(得分:1)
您也可以尝试将此解决方案调整为适用于您的Chip Circle的Circle Image
new Container(
width: 190.0,
height: 190.0,
decoration: new BoxDecoration(
shape: BoxShape.circle,
image: new DecorationImage(
fit: BoxFit.fill,
image: new NetworkImage(
"https://i.imgur.com/BoN9kdC.png")
)
)),
此中等帖子https://medium.com/@boldijar.paul/circle-image-view-in-flutter-965963c46cf5