简体   繁体   English

如何?:Flutter RaisedButton onPressed 打开一个表单

[英]How to?: Flutter RaisedButton onPressed opens a Form

Flutter: I would like to open a Form after a RaisedButton is pressed. Flutter:我想在按下 RaisedButton 后打开一个表单。 How do I have to compose the onPressed function of the RaisedButton to achieve this?我如何编写 RaisedButton 的 onPressed function 来实现这一点? Thanks for your support.谢谢你的支持。

As you have not mentioned more detail, i hope you need something to show or input.由于您没有提到更多细节,我希望您需要一些东西来展示或输入。 You can use showBottomSheet to fulfill this like this:您可以使用showBottomSheet来实现这一点:

RaisedButton(
  onPressed: () {
    showModalBottomSheet(
      context: context,
      builder: (BuildContext bc) {
        return Container(
          child: Text('Implement your form here')
        );
    });
  },
  child: Text('BottomSheet Demo')
)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM