flutterdartchips

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


Solution

  • 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.