如何打开对话框而无需按钮
如果FTP文件下载失败,则将显示一个通知窗口。成功或失败作为布尔变量返回。 (如果失败,返回false)。 Android Standard ShowDialog
成功。
if(context.read<ScoreImageProvider>().bDownloadRes == false){
SchedulerBinding.instance!.addPostFrameCallback((_) {
_ftpErrorAlert(context);
});
}
但是,iOS标准showcupertinodialog
尚未执行。我的对话框函数
就是这样。
_ftpErrorAlert(BuildContext context){
Size size = MediaQuery.of(context).size;
Platform.isAndroid ?
showDialog(
context: context,
barrierDismissible: true,
builder: (_) => AlertDialog(
title: _ftpErrorTitle(size),
content: _ftpErrorContent(size),
actions: <Widget>[_ftpErrorOkButton(size)],
)
) :
showCupertinoDialog(
context: context,
barrierDismissible: true,
builder: (_) => CupertinoAlertDialog(
title: _ftpErrorTitle(size),
content: _ftpErrorContent(size),
actions: <Widget>[_ftpErrorOkButton(size)],
)
);
}
您知道如何在没有按钮的情况下回调showcupertinodialog
吗? 谢谢。
If the FTP file download fails, a notification window is displayed. Success or failure is returned as a bool variable. (return false if failure). The Android standard showDialog
was successful.
if(context.read<ScoreImageProvider>().bDownloadRes == false){
SchedulerBinding.instance!.addPostFrameCallback((_) {
_ftpErrorAlert(context);
});
}
However, the iOS standard showCupertinoDialog
is not executed. My dialog function
is like this.
_ftpErrorAlert(BuildContext context){
Size size = MediaQuery.of(context).size;
Platform.isAndroid ?
showDialog(
context: context,
barrierDismissible: true,
builder: (_) => AlertDialog(
title: _ftpErrorTitle(size),
content: _ftpErrorContent(size),
actions: <Widget>[_ftpErrorOkButton(size)],
)
) :
showCupertinoDialog(
context: context,
barrierDismissible: true,
builder: (_) => CupertinoAlertDialog(
title: _ftpErrorTitle(size),
content: _ftpErrorContent(size),
actions: <Widget>[_ftpErrorOkButton(size)],
)
);
}
Do you know how to callback showCupertinoDialog
without a button?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
已解决
使用计时器检查。如果您
CANCEL()
当调用处置
时,计时器变量正常。Solved
Checked using a timer. If you
cancel()
the timer variable whendispose
is called, it works normally.