I wanted to create an InputChip Widget that looked the this (The red circle).
M3 Official Figma
With This code, I can get the chip circled in blue:
@override
Widget build(BuildContext context) {
return InputChip(
label: const Text('tag'),
onDeleted: () {},
);
}
By adding some parameters I can change the color:
@override
Widget build(BuildContext context) {
return InputChip(
label: const Text('tag'),
backgroundColor: Colors.blue[100],
onDeleted: () {},
);
}
But I can't remove the outline.
I have tried changing the selected parameter to true but this creates a check mark I don't want:
@override
Widget build(BuildContext context) {
return InputChip(
label: const Text('tag'),
selected: true,
onDeleted: () {},
);
}
How can I achieve this?


If you see the implementation of
InputChip, the border style is controlled by the value ofisSelected:From the source code it seems like there are no other way to achieve the exact combination of border style and background color like that, so you just have to enable
selectedand disableshowCheckmarklike this:Note: It is also possible to set
sidetoBorderSide(color: Colors.transparent), but then we have to set the background color manually too. The background color used when the chip is selected is taken from a private method inRawChipcalled_getBackgroundColor, which make this a more complicated solution.