Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create an outlined filter chip in Flutter

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

like image 321
nuxibyte Avatar asked Nov 21 '18 12:11

nuxibyte


1 Answers

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.

like image 168
nuxibyte Avatar answered Oct 24 '22 06:10

nuxibyte