【问题标题】:Bottom menu options底部菜单选项
【发布时间】:2019-01-25 15:13:45
【问题描述】:

如何在 Flutter 中实现一个简单的底部菜单?我想显示一组菜单项并适当地响应点击。我在gallery中找不到任何东西

这是我尝试实现的示例,带有自定义选项(不仅仅是媒体选项)

【问题讨论】:

标签: material-design flutter material-ui flutter-layout


【解决方案1】:

也许这可以帮助https://github.com/flutter/flutter/blob/master/examples/flutter_gallery/lib/demo/material/modal_bottom_sheet_demo.dart

@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
                )
              )
            )
          );
        });
      }
    )
  )
);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-20
    • 1970-01-01
    • 2018-03-02
    • 2020-04-08
    相关资源
    最近更新 更多