diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d68756..27835e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ -# [4.9.7+x] +# [4.9.8+x] +* SmartDialog.config.checkExist() adjust to SmartDialog.checkExist() + +* # [4.9.7+x] * optimize bindWidget, when bindWidget is not null, bindPage will be automatically set to false. * Reconstruct the implementation of initialization * Show Debug Paint: fix [#109](https://github.com/fluttercandies/flutter_smart_dialog/issues/109), [#115](https://github.com/fluttercandies/flutter_smart_dialog/issues/115) diff --git a/lib/src/config/smart_config.dart b/lib/src/config/smart_config.dart index e7c4934..bbdf199 100644 --- a/lib/src/config/smart_config.dart +++ b/lib/src/config/smart_config.dart @@ -36,6 +36,7 @@ class SmartConfig { /// if the tag attribute is used, dialogTypes will be invalid /// /// 检查相关dialog是否存在于界面上,如果使用tag属性,dialogTypes将失效 + @Deprecated("please use SmartDialog.checkExist()") bool checkExist({ String? tag, Set dialogTypes = const { diff --git a/lib/src/helper/navigator_observer.dart b/lib/src/helper/navigator_observer.dart index 4e8c2d3..67be230 100644 --- a/lib/src/helper/navigator_observer.dart +++ b/lib/src/helper/navigator_observer.dart @@ -39,7 +39,7 @@ class SmartNavigatorObserver extends NavigatorObserver { return; } - var checkDialog = SmartDialog.config.checkExist(dialogTypes: { + var checkDialog = SmartDialog.checkExist(dialogTypes: { SmartAllDialogType.custom, SmartAllDialogType.attach, SmartAllDialogType.loading, diff --git a/lib/src/smart_dialog.dart b/lib/src/smart_dialog.dart index adc8487..ef03c68 100644 --- a/lib/src/smart_dialog.dart +++ b/lib/src/smart_dialog.dart @@ -7,6 +7,7 @@ import 'compatible/compatible_smart_dialog.dart'; import 'config/smart_config.dart'; import 'data/animation_param.dart'; import 'helper/dialog_proxy.dart'; +import 'kit/dialog_kit.dart'; import 'widget/attach_dialog_widget.dart'; import 'widget/helper/dialog_scope.dart'; @@ -908,4 +909,19 @@ class SmartDialog { force: force, ); } + + /// Check whether the relevant dialog exists on the interface, + /// if the tag attribute is used, dialogTypes will be invalid + /// + /// 检查相关dialog是否存在于界面上,如果使用tag属性,dialogTypes将失效 + static bool checkExist({ + String? tag, + Set dialogTypes = const { + SmartAllDialogType.custom, + SmartAllDialogType.attach, + SmartAllDialogType.loading, + }, + }) { + return DialogKit.instance.checkExist(tag: tag, dialogTypes: dialogTypes); + } } diff --git a/lib/src/widget/helper/smart_overlay.dart b/lib/src/widget/helper/smart_overlay.dart index 1381897..15a8eff 100644 --- a/lib/src/widget/helper/smart_overlay.dart +++ b/lib/src/widget/helper/smart_overlay.dart @@ -66,7 +66,7 @@ class _SmartOverlayState extends State { } await showCompleter?.future; - var dialogExist = SmartDialog.config.checkExist(dialogTypes: { + var dialogExist = SmartDialog.checkExist(dialogTypes: { SmartAllDialogType.custom, SmartAllDialogType.attach, SmartAllDialogType.notify, diff --git a/macos/Flutter/ephemeral/Flutter-Generated.xcconfig b/macos/Flutter/ephemeral/Flutter-Generated.xcconfig index c5240fb..237add8 100644 --- a/macos/Flutter/ephemeral/Flutter-Generated.xcconfig +++ b/macos/Flutter/ephemeral/Flutter-Generated.xcconfig @@ -4,7 +4,7 @@ FLUTTER_APPLICATION_PATH=D:\Develop\GitHub\flutter_smart_dialog COCOAPODS_PARALLEL_CODE_SIGN=true FLUTTER_BUILD_DIR=build FLUTTER_BUILD_NAME=4.9.7 -FLUTTER_BUILD_NUMBER=4 +FLUTTER_BUILD_NUMBER=10 DART_OBFUSCATION=false TRACK_WIDGET_CREATION=true TREE_SHAKE_ICONS=false diff --git a/macos/Flutter/ephemeral/flutter_export_environment.sh b/macos/Flutter/ephemeral/flutter_export_environment.sh index 6976cb1..599883b 100755 --- a/macos/Flutter/ephemeral/flutter_export_environment.sh +++ b/macos/Flutter/ephemeral/flutter_export_environment.sh @@ -5,7 +5,7 @@ export "FLUTTER_APPLICATION_PATH=D:\Develop\GitHub\flutter_smart_dialog" export "COCOAPODS_PARALLEL_CODE_SIGN=true" export "FLUTTER_BUILD_DIR=build" export "FLUTTER_BUILD_NAME=4.9.7" -export "FLUTTER_BUILD_NUMBER=4" +export "FLUTTER_BUILD_NUMBER=10" export "DART_OBFUSCATION=false" export "TRACK_WIDGET_CREATION=true" export "TREE_SHAKE_ICONS=false" diff --git a/pubspec.yaml b/pubspec.yaml index ffd2621..37ef2bc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: An elegant Flutter Dialog solution, Easily implement Toast, Loading and custom Dialog, Make the use of the dialog easier! -version: 4.9.7+9 +version: 4.9.8 homepage: https://github.com/fluttercandies/flutter_smart_dialog # flutter pub publish --server=https://pub.dartlang.org # flutter build web --release --base-href="/flutter_smart_dialog/web/"