Skip to content

Commit

Permalink
optimize bindWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
xdd666t committed May 18, 2024
1 parent ed6142f commit 3b98040
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* fix [#162](https://github.com/fluttercandies/flutter_smart_dialog/issues/162)
* break change: "AlignmentGeometry" adjust to "Alignment"
* fix [#185](https://github.com/fluttercandies/flutter_smart_dialog/issues/185)
* optimize bindWidget, when bindWidget is not null, bindPage will be automatically set to false.


# [4.9.0]
Expand Down
12 changes: 6 additions & 6 deletions lib/src/smart_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class SmartDialog {
/// [bindWidget]:bind the dialog to a Widget, when the widget is not visible, the dialog is automatically hidden,
/// and when the widget is visible, the dialog is automatically displayed; Applicable to PageView, TabView, etc., bind its sub-pages,
/// and when switching pages, the dialog can also interact reasonably
/// Note: [bindPage] handles routing logic higher than [bindWidget]; if not expected, [bindPage] can be set to false
/// Note: The processing logic of [bindWidget] takes precedence over [bindPage]. When [bindWidget] is not null, [bindPage] will be automatically set to false.
///
/// [ignoreArea]: dialog placeholder ignores area, supports up, down, left and right areas, set area, dialog will not occupy space in this area;
/// Example: ignoreArea: Rect.fromLTRB (0,0,0,30), there will be 30 gaps at the bottom, and neither dialog nor mask will occupy this area;
Expand Down Expand Up @@ -145,7 +145,7 @@ class SmartDialog {
///
/// [bindWidget]:将dialog与某个Widget绑定, 当该widget不可见时, dialog自动隐藏, 该widget可见时, dialog自动显示;
/// 适用于PageView, TabView之类, 绑定其子页面, 切换页面时, dialog也能合理交互
/// 注意: [bindPage]处理路由逻辑高于[bindWidget]; 如不符合预期, 可将[bindPage]设置为false
/// 注意: [bindWidget]处理逻辑高于[bindPage], 当[bindWidget]不为null, [bindPage]将自动被设置为false
///
/// [ignoreArea]:dialog占位忽略区域, 支持上下左右区域, 设置的区域, dialog将不会在此区域占位;
/// 例: ignoreArea: Rect.fromLTRB(0, 0, 0, 30), 底部会有30空隙, dialog和mask都不会占位该区域;
Expand Down Expand Up @@ -209,7 +209,7 @@ class SmartDialog {
keepSingle: keepSingle ?? false,
permanent: permanent ?? false,
useSystem: useSystem ?? false,
bindPage: bindPage ?? config.custom.bindPage,
bindPage: (bindPage ?? config.custom.bindPage) && bindWidget == null,
bindWidget: bindWidget,
ignoreArea: ignoreArea,
);
Expand Down Expand Up @@ -300,7 +300,7 @@ class SmartDialog {
/// [bindWidget]:bind the dialog to a Widget, when the widget is not visible, the dialog is automatically hidden,
/// and when the widget is visible, the dialog is automatically displayed; Applicable to PageView, TabView, etc., bind its sub-pages,
/// and when switching pages, the dialog can also interact reasonably
/// Note: [bindPage] handles routing logic higher than [bindWidget]; if not expected, [bindPage] can be set to false
/// Note: The processing logic of [bindWidget] takes precedence over [bindPage]. When [bindWidget] is not null, [bindPage] will be automatically set to false.
/// -------------------------------------------------------------------------------
///
/// 定位弹窗
Expand Down Expand Up @@ -376,7 +376,7 @@ class SmartDialog {
///
/// [bindWidget]:将dialog与某个Widget绑定, 当该widget不可见时, dialog自动隐藏, 该widget可见时, dialog自动显示;
/// 适用于PageView, TabView之类, 绑定其子页面, 切换页面时, dialog也能合理交互
/// 注意: [bindPage]处理路由逻辑高于[bindWidget]; 如不符合预期, 可将[bindPage]设置为false
/// 注意: [bindWidget]处理路由逻辑高于[bindPage], 当[bindWidget]不为null, [bindPage]将自动被设置为false
static Future<T?> showAttach<T>({
required BuildContext? targetContext,
required WidgetBuilder builder,
Expand Down Expand Up @@ -451,7 +451,7 @@ class SmartDialog {
keepSingle: keepSingle ?? false,
permanent: permanent ?? false,
useSystem: useSystem ?? false,
bindPage: bindPage ?? config.attach.bindPage,
bindPage: (bindPage ?? config.attach.bindPage) && bindWidget == null,
bindWidget: bindWidget,
);
}
Expand Down
8 changes: 4 additions & 4 deletions macos/Flutter/ephemeral/Flutter-Generated.xcconfig
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=/Users/xdd666/Develop/SDK/flutter_sdk
FLUTTER_APPLICATION_PATH=/Users/xdd666/Develop/Github/flutter_smart_dialog
FLUTTER_ROOT=D:\Develop\SDK\flutter_sdk
FLUTTER_APPLICATION_PATH=D:\Develop\GitHub\flutter_smart_dialog
COCOAPODS_PARALLEL_CODE_SIGN=true
FLUTTER_BUILD_DIR=build
FLUTTER_BUILD_NAME=4.9.4
FLUTTER_BUILD_NUMBER=4.9.4
FLUTTER_BUILD_NAME=4.9.6
FLUTTER_BUILD_NUMBER=1
DART_OBFUSCATION=false
TRACK_WIDGET_CREATION=true
TREE_SHAKE_ICONS=false
Expand Down
8 changes: 4 additions & 4 deletions macos/Flutter/ephemeral/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/xdd666/Develop/SDK/flutter_sdk"
export "FLUTTER_APPLICATION_PATH=/Users/xdd666/Develop/Github/flutter_smart_dialog"
export "FLUTTER_ROOT=D:\Develop\SDK\flutter_sdk"
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.4"
export "FLUTTER_BUILD_NUMBER=4.9.4"
export "FLUTTER_BUILD_NAME=4.9.6"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.6+1
version: 4.9.6+2
homepage: https://github.com/fluttercandies/flutter_smart_dialog
# flutter pub publish --server=https://pub.dartlang.org

Expand Down

0 comments on commit 3b98040

Please sign in to comment.