@@ -16,9 +16,7 @@ import '../config/smart_config.dart';
1616import '../data/animation_param.dart' ;
1717import '../data/notify_info.dart' ;
1818import '../init_dialog.dart' ;
19- import '../widget/helper/smart_overlay.dart' ;
2019import '../widget/helper/smart_overlay_entry.dart' ;
21- import 'show_helper.dart' ;
2220
2321enum CloseType {
2422 // back event
@@ -48,7 +46,6 @@ enum DialogType {
4846class DialogProxy {
4947 late SmartConfig config;
5048 late SmartOverlayEntry entryLoading;
51- late SmartOverlayEntry entryNotify;
5249 late Queue <DialogInfo > dialogQueue;
5350 late Queue <NotifyInfo > notifyQueue;
5451 late CustomLoading loadingWidget;
@@ -62,14 +59,6 @@ class DialogProxy {
6259 static late BuildContext contextNotify;
6360 static late BuildContext contextToast;
6461
65- static BuildContext get timelyContextCustom => contextCustom;
66-
67- static BuildContext get timelyContextAttach => contextAttach;
68-
69- static BuildContext get timelyContextNotify => contextNotify;
70-
71- static BuildContext get timelyContextToast => contextToast;
72-
7362 static BuildContext ? contextNavigator;
7463
7564 ///set default loading widget
@@ -81,14 +70,10 @@ class DialogProxy {
8170 ///set default toast widget
8271 late FlutterSmartNotifyStyle notifyStyle;
8372
84- var smartOverlayController = SmartOverlayController ();
85- late ShowHelper showHelper;
86-
8773 DialogProxy ._internal () {
8874 config = SmartConfig ();
8975 dialogQueue = ListQueue ();
9076 notifyQueue = ListQueue ();
91- showHelper = ShowHelper (smartOverlayController);
9277 }
9378
9479 void initialize (Set <SmartInitType > initType) {
@@ -98,10 +83,6 @@ class DialogProxy {
9883 });
9984 loadingWidget = CustomLoading (overlayEntry: entryLoading);
10085 }
101-
102- if (initType.contains (SmartInitType .notify)) {
103- entryNotify = SmartOverlayEntry (builder: (_) => const SizedBox .shrink ());
104- }
10586 }
10687
10788 Future <T ?> show <T >({
@@ -128,8 +109,7 @@ class DialogProxy {
128109 required bool bindPage,
129110 required BuildContext ? bindWidget,
130111 required Rect ? ignoreArea,
131- }) async {
132- await showHelper.beforeShow ();
112+ }) {
133113 CustomDialog ? dialog;
134114 var entry = SmartOverlayEntry (
135115 builder: (BuildContext context) => dialog! .getWidget (),
@@ -181,8 +161,7 @@ class DialogProxy {
181161 required String ? tag,
182162 required bool keepSingle,
183163 required SmartBackType backType,
184- }) async {
185- await showHelper.beforeShow ();
164+ }) {
186165 CustomNotify ? dialog;
187166 var entry = SmartOverlayEntry (
188167 builder: (BuildContext context) => dialog! .getWidget (),
@@ -239,8 +218,7 @@ class DialogProxy {
239218 required bool useSystem,
240219 required bool bindPage,
241220 required BuildContext ? bindWidget,
242- }) async {
243- await showHelper.beforeShow ();
221+ }) {
244222 CustomDialog ? dialog;
245223 var entry = SmartOverlayEntry (
246224 builder: (BuildContext context) => dialog! .getWidget (),
@@ -294,8 +272,7 @@ class DialogProxy {
294272 required Duration ? displayTime,
295273 required bool backDismiss,
296274 required Widget widget,
297- }) async {
298- await showHelper.beforeShow ();
275+ }) {
299276 return loadingWidget.showLoading <T >(
300277 alignment: alignment,
301278 clickMaskDismiss: clickMaskDismiss,
@@ -333,8 +310,7 @@ class DialogProxy {
333310 required bool debounce,
334311 required SmartToastType displayType,
335312 required Widget widget,
336- }) async {
337- await showHelper.beforeShow ();
313+ }) {
338314 CustomToast ? toast;
339315 var entry = SmartOverlayEntry (
340316 builder: (BuildContext context) => toast! .getWidget (),
@@ -366,8 +342,7 @@ class DialogProxy {
366342 T ? result,
367343 bool force = false ,
368344 CloseType closeType = CloseType .normal,
369- }) async {
370- await showHelper.awaitShow ();
345+ }) {
371346 if (status == SmartStatus .smart) {
372347 var loading = config.loading.isExist;
373348
@@ -423,7 +398,7 @@ class DialogProxy {
423398 }
424399
425400 DialogType ? type = _convertEnum (status);
426- if (type == null ) return ;
401+ if (type == null ) return null ;
427402 return CustomDialog .dismiss <T >(
428403 type: type,
429404 tag: tag,
0 commit comments