Skip to content

Commit

Permalink
process #147,#148
Browse files Browse the repository at this point in the history
  • Loading branch information
xdd666t committed Aug 5, 2023
1 parent be0572d commit a8b7aef
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* optimize loading [#137](https://github.com/fluttercandies/flutter_smart_dialog/issues/137)
* optimize 'show debug point'
* fix [#142](https://github.com/fluttercandies/flutter_smart_dialog/issues/142)
* add checkExist


# [4.9.0]
Expand Down
1 change: 1 addition & 0 deletions lib/src/config/smart_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class SmartConfig {
Set<SmartAllDialogType> dialogTypes = const {
SmartAllDialogType.custom,
SmartAllDialogType.attach,
SmartAllDialogType.loading,
},
}) {
return DialogKit.instance.checkExist(tag: tag, dialogTypes: dialogTypes);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/custom/custom_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import '../config/enum_config.dart';
import '../data/animation_param.dart';
import '../data/base_dialog.dart';
import '../data/notify_info.dart';
import '../kit/debounce_utils.dart';
import '../smart_dialog.dart';
import '../kit/debounce_utils.dart';
import '../widget/helper/smart_overlay_entry.dart';

///main function : custom dialog
Expand Down
2 changes: 1 addition & 1 deletion lib/src/custom/custom_notify.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import '../config/enum_config.dart';
import '../data/animation_param.dart';
import '../data/base_dialog.dart';
import '../data/notify_info.dart';
import '../kit/debounce_utils.dart';
import '../smart_dialog.dart';
import '../kit/debounce_utils.dart';
import '../widget/helper/smart_overlay_entry.dart';

///main function : notify dialog
Expand Down
2 changes: 1 addition & 1 deletion lib/src/helper/dialog_proxy.dart
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ class DialogProxy {
CloseType closeType = CloseType.normal,
}) {
if (status == SmartStatus.smart) {
var loading = config.isExistLoading;
var loading = config.loading.isExist;

if (loading &&
(tag == null || (dialogQueue.isEmpty && notifyQueue.isEmpty))) {
Expand Down
10 changes: 7 additions & 3 deletions lib/src/helper/navigator_observer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ class SmartNavigatorObserver extends NavigatorObserver {
RouteRecord.curRoute = previousRoute;
RouteRecord.instance.pop(route, previousRoute);

if (!SmartDialog.config.isExist ||
route.settings.name == SmartTag.systemDialog) {
var checkDialog = SmartDialog.config.checkExist(dialogTypes: {
SmartAllDialogType.custom,
SmartAllDialogType.attach,
SmartAllDialogType.loading,
});
if (!checkDialog || route.settings.name == SmartTag.systemDialog) {
return;
}

if (SmartDialog.config.isExistLoading) {
if (SmartDialog.config.loading.isExist) {
DialogProxy.instance.dismiss(
status: SmartStatus.loading,
closeType: CloseType.route,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/helper/pop_monitor/boost_route_monitor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class BoostRouteMonitor {
bool shouldHandle = false;
try {
//handle loading
if (SmartDialog.config.isExistLoading) {
if (SmartDialog.config.loading.isExist) {
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/helper/pop_monitor/monitor_pop_route.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class MonitorPopRoute with WidgetsBindingObserver {
@override
Future<bool> didPopRoute() async {
//loading
if (SmartDialog.config.isExistLoading) {
if (SmartDialog.config.loading.isExist) {
DialogProxy.instance.dismiss(
status: SmartStatus.loading,
closeType: CloseType.back,
Expand Down
1 change: 1 addition & 0 deletions lib/src/smart_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class SmartDialog {
/// Compatible with older versions
///
/// 兼容老版本
@Deprecated("5.0 will be deleted and is not recommended for continued use")
static CompatibleSmartDialog compatible = CompatibleSmartDialog.instance;

/// SmartDialog global config
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ homepage: https://github.com/fluttercandies/flutter_smart_dialog
# flutter pub publish --server=https://pub.dartlang.org

environment:
sdk: '>=2.12.0 <3.0.0'
sdk: '>=2.12.0 <4.0.0'
flutter: ">=3.0.0"

dependencies:
Expand Down

0 comments on commit a8b7aef

Please sign in to comment.