底部菜单选项
Bottom menu options
如何在Flutter中实现一个简单的底部菜单?我想显示一定数量的菜单项并对点击做出适当的响应。我没能在 gallery
中找到任何内容
这是我正在尝试实现的示例,其中包含自定义选项(不仅仅是媒体选项)
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(title: const Text('Modal bottom sheet')),
body: new Center(
child: new RaisedButton(
child: const Text('SHOW BOTTOM SHEET'),
onPressed: () {
showModalBottomSheet<void>(context: context, builder: (BuildContext context)
{
return new Container(
child: new Padding(
padding: const EdgeInsets.all(32.0),
child: ListView(
children: <Widget>[
ListTile(title: Text('Map'),onTap:null),//handle on tap here
//build other menu here
],
);
)
textAlign: TextAlign.center,
style: new TextStyle(
color: Theme.of(context).accentColor,
fontSize: 24.0
)
)
)
);
});
}
)
)
);
如何在Flutter中实现一个简单的底部菜单?我想显示一定数量的菜单项并对点击做出适当的响应。我没能在 gallery
中找到任何内容这是我正在尝试实现的示例,其中包含自定义选项(不仅仅是媒体选项)
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(title: const Text('Modal bottom sheet')),
body: new Center(
child: new RaisedButton(
child: const Text('SHOW BOTTOM SHEET'),
onPressed: () {
showModalBottomSheet<void>(context: context, builder: (BuildContext context)
{
return new Container(
child: new Padding(
padding: const EdgeInsets.all(32.0),
child: ListView(
children: <Widget>[
ListTile(title: Text('Map'),onTap:null),//handle on tap here
//build other menu here
],
);
)
textAlign: TextAlign.center,
style: new TextStyle(
color: Theme.of(context).accentColor,
fontSize: 24.0
)
)
)
);
});
}
)
)
);