반응형

RoundedContainer 

모서리가 둥근 container 는 종종 필요합니다.

Container(
            width: 100.0,
            height: 150.0,
            decoration: BoxDecoration(
              borderRadius: BorderRadius.all(Radius.circular(8.0)),
              color: Colors.redAccent,
            ),
            child: [your widget]
)

 

 

RoundedCorners clipping tip.

Rounded container를 만들고 나서 padding 을 없게 꽉 채우게 되는 경우에 corner가  clipping이 안됩니다.

그럴때 ClipRRect를 사용해서 clipping 합니다.

ClipRRect(
  borderRadius: BorderRadius.circular(20), // Image border
  child: SizedBox.fromSize(
    size: Size.fromRadius(48), // Image radius
    child: Image.network('imageUrl', fit: BoxFit.cover),
  ),
)

 

 

https://stackoverflow.com/questions/51513429/how-to-do-rounded-corners-image-in-flutter

 

How to do Rounded Corners Image in Flutter

I am using Flutter to make a list of information about movies. Now I want the cover image on the left to be a rounded corners picture. I did the following, but it didn’t work. Thanks! getItem(...

stackoverflow.com

 

 

 

+ Recent posts