flutter corner radius with transparent background

后端 未结 11 1022
鱼传尺愫
鱼传尺愫 2021-01-30 15:28

Below is my code which I expect to render a round-corner container with a transparent background.

return new Container(
                //padding: const EdgeIn         


        
11条回答
  •  说谎
    说谎 (楼主)
    2021-01-30 16:19

    If you want to round corners with transparent background, the best approach is using ClipRRect.

    return ClipRRect(
      borderRadius: BorderRadius.circular(40.0),
      child: Container(
        height: 800.0,
        width: double.infinity,
        color: Colors.blue,
        child: Center(
          child: new Text("Hi modal sheet"),
        ),
      ),
    );
    

提交回复
热议问题