How to create an outlined filter chip in Flutter

29.2k views Asked by At

I'm trying to create an outlined filter chip in Flutter.

I can create a standard filter chip using the following code but I can't see a way to access the outlined version as shown in the image.

Is there a way to modify the standard chip to give the outline version?

FilterChip(
   label: Text("text"), 
   onSelected: (bool value) {print("selected");},
),

Material Design Filter Chips

1

There are 1 answers

1
nuxibyte On BEST ANSWER

I have it working now. Here is the code:

FilterChip(
    label: Text("text"), 
    backgroundColor: Colors.transparent,
    shape: StadiumBorder(side: BorderSide()),
    onSelected: (bool value) {print("selected");},
),

This post also helped me discover the StadiumBorder.