flutter corner radius with transparent background

后端 未结 11 1002
鱼传尺愫
鱼传尺愫 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:10

    showModalBottomSheet(
       context: context,
       builder: (context) => Container(
                color: Color(0xff757575), //background color 
                child:  new Container(
                    decoration: new BoxDecoration(
                        color: Colors.blue,
                        borderRadius: new BorderRadius.only(
                            topLeft:  const  Radius.circular(40.0),
                            topRight: const  Radius.circular(40.0))
                    ),
                  child: new Center(
                    child: new Text("Hi modal sheet"),
                  )
    
         
    
     ),
    
    )
    

    This is will make your container color the same as the background color. And there will be a child container of the same height-width with blue color. This will make the corner with the same color as the background color.

提交回复
热议问题