gpt4 book ai didi

flutter - 如何以编程方式关闭脚手架抽屉

转载 作者:IT王子 更新时间:2023-10-29 07:16:21 25 4
gpt4 key购买 nike

我想以编程方式从 Scaffold 小部件外部关闭我的抽屉。我使用 _scaffoldkey.currentState.openDrawer 打开抽屉。

有没有类似的关闭抽屉的方法?

最佳答案

为此,您可以使用 Navigator.popdocumentation还指出:

To close the drawer once it is open, use Navigator.pop.

Navigator.of(context).pop();

关于flutter - 如何以编程方式关闭脚手架抽屉,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57267908/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com