Reputation: 11
i want to make my bottom sheet don't take infinity width how to make that i tried nested container and the nested one with width 100 and it also take the whole width ?
Upvotes: 0
Views: 1020
Reputation: 1441
You can check the below code.
RaisedButton(
child: Text("abc"),
onPressed: () {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (BuildContext bc) {
return Container(
width: MediaQuery.of(context).size.width,
color: Colors.transparent,
child: Padding(
padding: const EdgeInsets.fromLTRB(100, 0, 100, 0),
child: Container(
color: Colors.white,
width: MediaQuery.of(context).size.width - 200,
child: new Wrap(
children: <Widget>[
new ListTile(
leading: new Icon(Icons.music_note),
title: new Text('Music'),
onTap: () => {}),
new ListTile(
leading: new Icon(Icons.videocam),
title: new Text('Video'),
onTap: () => {},
),
],
),
),
),
);
});
})
Upvotes: 1