When I try to set the border radius of the top two corners of my container that is nested inside a card, the whole content of the container goes disappears. Here is my code, if you uncomment the commented line your whole content inside the container will go away.
Widget build(BuildContext context) {
return Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0),
),
margin: new EdgeInsets.symmetric(horizontal: 10.0, vertical: 6.0),
child: Container(
decoration: BoxDecoration(
border: new Border(
top: BorderSide(
color: Theme.of(context).primaryColor,
width: 3.0,
)),
//borderRadius: BorderRadius.only(topLeft: const Radius.circular(5.0)),
),
child: makeListTile(widget.flight),
),
);
}
To set border radius for Container widget, set its decoration property with BoxDecoration where the borderRadius property is set with required value.
To add a border radius or create a rounded border around the ListTile, you can define the shape parameter with the RoundedRectangleBorder widget. Inside the RoundedRectangleBorder you can add side parameter with BorderSide(width: 2) and borderRadius with BorderRadius. circular(50).
Just add
clipBehavior: Clip.antiAlias
To Card
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With