@@ -165,7 +165,7 @@ class CustomDialog extends BaseDialog {
165165
166166 if (keepSingle) {
167167 DialogInfo dialogInfo;
168- if (proxy.dialogMap[ SmartTag .keepSingle] == null ) {
168+ if (_getDialog ( DialogType .dialog, false , SmartTag .keepSingle) == null ) {
169169 dialogInfo = DialogInfo (
170170 dialog: this ,
171171 backDismiss: backDismiss,
@@ -174,7 +174,6 @@ class CustomDialog extends BaseDialog {
174174 useSystem: useSystem,
175175 );
176176 proxy.dialogQueue.add (dialogInfo);
177- proxy.dialogMap[SmartTag .keepSingle] = dialogInfo;
178177 Overlay .of (DialogProxy .contextOverlay)! .insert (
179178 overlayEntry,
180179 below: proxy.entryLoading,
@@ -195,7 +194,6 @@ class CustomDialog extends BaseDialog {
195194 useSystem: useSystem,
196195 );
197196 proxy.dialogQueue.add (dialogInfo);
198- if (tag != null ) proxy.dialogMap[tag] = dialogInfo;
199197 // insert the dialog carrier into the page
200198 Overlay .of (DialogProxy .contextOverlay)! .insert (
201199 overlayEntry,
@@ -262,7 +260,6 @@ class CustomDialog extends BaseDialog {
262260
263261 //handle close dialog
264262 var proxy = DialogProxy .instance;
265- if (info.tag != null ) proxy.dialogMap.remove (info.tag);
266263 proxy.dialogQueue.remove (info);
267264 var customDialog = info.dialog;
268265 await customDialog.mainDialog.dismiss (useSystem: info.useSystem);
@@ -287,7 +284,8 @@ class CustomDialog extends BaseDialog {
287284 if (tag != null && item.tag == tag) {
288285 info = item;
289286 break ;
290- }else if (type == DialogType .dialog || item.type == type) {
287+ } else if (tag == null &&
288+ (type == DialogType .dialog || item.type == type)) {
291289 info = item;
292290 break ;
293291 }
0 commit comments