I wanted to create an InputChip Widget that looked the this (The red circle). M3 Official Figma
有了这个代码,我就可以用蓝色圈出芯片:
@override
Widget build(BuildContext context) {
return InputChip(
label: const Text('tag'),
onDeleted: () {},
);
}
通过添加一些参数,我可以更改 colored颜色 :
@override
Widget build(BuildContext context) {
return InputChip(
label: const Text('tag'),
backgroundColor: Colors.blue[100],
onDeleted: () {},
);
}
但我不能删除轮廓.
我已try 将selected
参数更改为true
,但这会创建一个我不想要的复选标记:
@override
Widget build(BuildContext context) {
return InputChip(
label: const Text('tag'),
selected: true,
onDeleted: () {},
);
}
我怎样才能做到这一点呢?