Here is a simple way you can achieve solid border in your widget
.
Container(
width: 200,
height: 200,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
border: Border.all(
width: 5,
color: Colors.red,
),
),
),
Please Refer Below code:
Padding(
padding: const EdgeInsets.all(15.0),
child: Container(
height: 100,
width: double.infinity,
decoration: BoxDecoration(
border: Border.all(
width: 4,
color: Colors.black,),
borderRadius:BorderRadius.circular(10.0),),
child: Center(
child: Text('Custom Border'),),),
),
Wrap the widget with Container
Container(
decoration: BoxDecoration(
border: Border.all(width: 5.0, color: Colors.black),
borderRadius: BorderRadius.circular(20.0) )// change value as per your needs
child: //your widget
)
Try below code hope its help to you.
If you want only Top corner are rounded:
Container(
width: double.infinity,
height: 100,
decoration: BoxDecoration(
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(10),
topRight: Radius.circular(10),
),
border: Border.all(
width: 3,
color: Colors.black,
),
),
),
If you want all container rounded:
Container(
width: double.infinity,
height: 100,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
border: Border.all(
width: 5,
color: Colors.black,
),
),
),
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.