Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make a circular border with Flutter's PhysicalModel?

I'm trying to make a circular border within a PhysicalModel. It works if I don't wrap my widget in a PhysicalModel, but once I do, I get a square-ish border.

new PhysicalModel(
  color: Colors.green,
  child: new Container(
    width: 50.0,
    height: 50.0,
    decoration: new BoxDecoration(
      borderRadius: new BorderRadius.circular(25.0),
      border: new Border.all(
        width: 5.0,
        color: Colors.red,
      ),
    ),
  ),
),
like image 504
Mary Avatar asked Aug 16 '17 22:08

Mary


People also ask

How do you make a circular border on a container?

To set border radius for Container widget, set its decoration property with BoxDecoration where the borderRadius property is set with required value.

How do you round the border of a container flutter?

To make a container border circular at a selected corner. topRight: Radius. circular(40.0), bottomRight: Radius.


1 Answers

You can just add the shape - circle

PhysicalModel(
  shape: BoxShape.circle,  //Here
),
like image 172
Rahul Dange Avatar answered Oct 31 '22 09:10

Rahul Dange