Flutter mask a circle into a container

后端 未结 2 511
一整个雨季
一整个雨季 2020-12-09 23:35

I want to add a circle effect over a container, but I want the circle to not extend the dimensions of the container, but instead get clipped by it. This is what I\'m trying

2条回答
  •  孤街浪徒
    2020-12-09 23:54

    ClipRRect worked best for me.

    See reference video: https://www.youtube.com/watch?v=eI43jkQkrvs&vl=en

    ClipRRect(
      borderRadius: BorderRadius.cirular(10),
      child: myContainerWithCircleWidget,
    );
    

提交回复
热议问题