gpt4 book ai didi

dialog - 如何关闭 flutter 对话框?

转载 作者:IT老高 更新时间:2023-10-28 12:36:43 34 4
gpt4 key购买 nike

我是 Flutter 的新手,我想在任务完成后关闭我的对话框。我试过了:

Navigator.pop(context, true); 

但是我的屏幕变黑了,对话框还在上面。这是我的对话代码。

Dialog _dialog = new Dialog(
child: new Row(
mainAxisSize: MainAsixSize.min,
children: <Widget> [
new CircularProgressIndicator(),
new Text("Loading")]),

);

最佳答案

https://docs.flutter.io/flutter/material/showDialog.html

The dialog route created by this method is pushed to the root navigator. If the application has multiple Navigator objects, it may be necessary to call Navigator.of(context, rootNavigator: true).pop(result) to close the dialog rather just Navigator.pop(context, result).

所以我假设这两个中的一个应该做你想做的。

关于dialog - 如何关闭 flutter 对话框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50683524/

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