flutter rounded corners container code example

Example 1: flutter container rounded corners

Container(
  decoration: BoxDecoration(
    border: Border.all(
      color: Colors.red[500],
    ),
    borderRadius: BorderRadius.all(Radius.circular(20))
  ),
  child: ...
)

Example 2: container flutter border radius

Container(
	decoration: BoxDecoration(
    	color: Colors.blue,
    	borderRadius: BorderRadius.all(
    		Radius.circular(10)
    	)
    )
)

Example 3: column round border flutter

Container(
  decoration: BoxDecoration(
    border: Border.all(
      color: Colors.red[500],
    ),
    color: Colors.green[500],
    borderRadius: BorderRadius.all(Radius.circular(20))
  ),
  child: ...
)

Example 4: flutter container radius

Container(
  child: Text("It's text..."),
  decoration: BoxDecoration(
    borderRadius: BorderRadius.circular(10),  // radius of 10
    color: Colors.green  // green as background color
  )
)

Example 5: flutter rounded container transperent corners

new Container(
          height: 300.0,
          color: Colors.transparent,
          child: new Container(
            decoration: new BoxDecoration(
              color: Colors.green,
              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"),
           )
         ),
        ),

Example 6: round container flutter

Container(
      width: screenWidth / 7,
      decoration: BoxDecoration(
        border: Border.all(
          color: Colors.red[500],
        ),
      ),
      child: Padding(
        padding: EdgeInsets.all(5.0),
        child: Column(
          children: [
            Text(
              '6',
              style: TextStyle(
                  color: Colors.red[500],
                  fontSize: 25),
            ),
            Text(
             'sep',
              style: TextStyle(
                  color: Colors.red[500]),
            )
          ],
        ),
      ),
    );

Tags:

Misc Example