bottom sheet rounded corners flutter code example
Example 1: showmodalbottomsheet rounded corners
showModalBottomSheet(
context: context,
backgroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(topLeft: Radius.circular(15.0), topRight: Radius.circular(15.0)),
),
builder: (context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
ListTile(
leading: Icon(Icons.email),
title: Text('Send email'),
onTap: () {
print('Send email');
},
),
ListTile(
leading: Icon(Icons.phone),
title: Text('Call phone'),
onTap: () {
print('Call phone');
},
),
],
);
});
Example 2: flutter rounded bottom sheet
void startAddNewMoodCheckin(BuildContext ctx) {
showModalBottomSheet(
shape: RoundedRectangleBorder( //the rounded corner is created here
borderRadius: BorderRadius.circular(10.0),
),
context: ctx,
builder: (_) {
return Container(
child: Text("This is a modal sheet"),
);
});
}