safer navigator.pop

This commit is contained in:
rustdesk
2022-01-29 15:55:00 +08:00
parent b24c997a20
commit eebb7e1f4c
6 changed files with 5 additions and 11 deletions

View File

@@ -32,6 +32,7 @@ void Function() loadingCancelCallback;
void showLoading(String text, BuildContext context) {
if (_hasDialog && context != null) {
Navigator.pop(context);
_hasDialog = false;
}
dismissLoading();
if (isAndroid) {
@@ -122,6 +123,7 @@ void msgbox(String type, String title, String text, BuildContext context,
dismissLoading();
if (_hasDialog) {
Navigator.pop(context);
_hasDialog = false;
}
final buttons = [
Expanded(child: Container()),