flutter card border radius code example

Example 1: card rounded corners flutter

Card(							//Card with circular border
  shape: RoundedRectangleBorder(
    borderRadius: BorderRadius.circular(15.0),	
  ),
  child: Text(
    'Card with circular border',
    textScaleFactor: 1.2,
  ),
),
Card(							//Card with beveled border
  shape: BeveledRectangleBorder(
    borderRadius: BorderRadius.circular(10.0),	
  ),
  child: Text(
    'Card with Beveled border',
    textScaleFactor: 1.2,
  ),
),
Card(
  shape: StadiumBorder(			//Card with stadium border
  side: BorderSide(
    color: Colors.black,
    width: 2.0,
  ),
),
  child: Text(
    'Card with Beveled border',
    textScaleFactor: 1.2,
  ),
),

Example 2: shape property of card in flutter

Card(
  elevation: 5,
  shape: RoundedRectangleBorder(
  borderRadius: BorderRadius.circular(10),
  ),
  child: ListTile(),
)

Example 3: container flutter border radius

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

Example 4: how to give shape to card in flutter

Card(
  color: Colors.grey[900],
  shape: RoundedRectangleBorder(
    side: BorderSide(color: Colors.white70, width: 1),
    borderRadius: BorderRadius.circular(10),
  ),
  margin: EdgeInsets.all(20.0),
  child: Container(
    child: Column(
        children: <Widget>[
        ListTile(
            title: Text(
            'example',
            style: TextStyle(fontSize: 18, color: Colors.white),
            ),
        ),
        ],
    ),
  ),
),

Example 5: card border radius in flutter

Card(
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(15.0),
      ),
      child: Container() )

Example 6: flutter button border radius

shape: RoundedRectangleBorder(
  borderRadius: BorderRadius.circular(18.0),
  side: BorderSide(color: Colors.red)
),

Tags:

Dart Example