From 03778c4366625984d847e212d36bc77dcadb48ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=91=86=E5=91=86666?= Date: Sat, 30 Dec 2023 17:57:52 +0800 Subject: [PATCH] break change: "AlignmentGeometry" adjust to "Alignment" --- CHANGELOG.md | 1 + docs/Attach Chapter.md | 2 +- docs/Dialog Chapter.md | 4 ++-- lib/src/compatible/compatible_smart_dialog.dart | 4 ++-- lib/src/compatible/smart_config_compatible.dart | 2 +- lib/src/config/smart_config_custom.dart | 2 +- lib/src/config/smart_config_loading.dart | 2 +- lib/src/config/smart_config_notify.dart | 2 +- lib/src/config/smart_config_toast.dart | 2 +- lib/src/custom/custom_dialog.dart | 4 ++-- lib/src/custom/custom_loading.dart | 2 +- lib/src/custom/custom_notify.dart | 2 +- lib/src/custom/main_dialog.dart | 4 ++-- lib/src/custom/toast/custom_toast.dart | 2 +- lib/src/data/animation_param.dart | 2 +- lib/src/helper/dialog_proxy.dart | 10 +++++----- lib/src/smart_dialog.dart | 10 +++++----- lib/src/widget/animation/size_animation.dart | 2 +- lib/src/widget/animation/slide_animation.dart | 4 ++-- lib/src/widget/attach_dialog_widget.dart | 2 +- lib/src/widget/helper/attach_widget.dart | 4 ++-- lib/src/widget/smart_dialog_widget.dart | 2 +- pubspec.yaml | 2 +- 23 files changed, 37 insertions(+), 36 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c69d99c..fcca223 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * fix [#142](https://github.com/fluttercandies/flutter_smart_dialog/issues/142) * add checkExist * fix [#162](https://github.com/fluttercandies/flutter_smart_dialog/issues/162) +* break change: "AlignmentGeometry" adjust to "Alignment" # [4.9.0] diff --git a/docs/Attach Chapter.md b/docs/Attach Chapter.md index 96a3467..ccedf17 100644 --- a/docs/Attach Chapter.md +++ b/docs/Attach Chapter.md @@ -18,7 +18,7 @@ It is not difficult to locate the coordinates of the target widget; but it is ne ````dart void _attachLocation() { - attachDialog(BuildContext context, AlignmentGeometry alignment) async { + attachDialog(BuildContext context, Alignment alignment) async { SmartDialog.showAttach( targetContext: context, usePenetrate: true, diff --git a/docs/Dialog Chapter.md b/docs/Dialog Chapter.md index 2d5cdbd..5433553 100644 --- a/docs/Dialog Chapter.md +++ b/docs/Dialog Chapter.md @@ -11,7 +11,7 @@ ````dart void _dialogLocation() async { locationDialog({ - required AlignmentGeometry alignment, + required Alignment alignment, double width = double.infinity, double height = double.infinity, }) async { @@ -63,7 +63,7 @@ SmartDialog.show( ````dart void _dialogStack() async { stackDialog({ - required AlignmentGeometry alignment, + required Alignment alignment, required String tag, double width = double.infinity, double height = double.infinity, diff --git a/lib/src/compatible/compatible_smart_dialog.dart b/lib/src/compatible/compatible_smart_dialog.dart index 894dee3..fc46123 100644 --- a/lib/src/compatible/compatible_smart_dialog.dart +++ b/lib/src/compatible/compatible_smart_dialog.dart @@ -94,7 +94,7 @@ class CompatibleSmartDialog { /// false(使用SmartDialog),此参数可彻底解决在弹窗上跳转页面问题 Future show({ required Widget widget, - AlignmentGeometry? alignmentTemp, + Alignment? alignmentTemp, bool? clickBgDismissTemp, bool? isLoadingTemp, bool? isPenetrateTemp, @@ -244,7 +244,7 @@ class CompatibleSmartDialog { required BuildContext? targetContext, required Widget widget, Offset? target, - AlignmentGeometry? alignmentTemp, + Alignment? alignmentTemp, bool? clickBgDismissTemp, bool? isLoadingTemp, bool? isPenetrateTemp, diff --git a/lib/src/compatible/smart_config_compatible.dart b/lib/src/compatible/smart_config_compatible.dart index c60188b..72b1d04 100644 --- a/lib/src/compatible/smart_config_compatible.dart +++ b/lib/src/compatible/smart_config_compatible.dart @@ -31,7 +31,7 @@ class SmartConfigCompatible { /// centerLeft:dialog位于屏幕左边,动画默认为位移动画,自左而右, /// /// centerRight:dialog位于屏幕左边,动画默认为位移动画,自右而左, - AlignmentGeometry alignment = Alignment.center; + Alignment alignment = Alignment.center; /// the animation duration can be adjusted by the [animationDuration] param; /// default(true),true(use the opacity animation),false(use the scale transition animation) diff --git a/lib/src/config/smart_config_custom.dart b/lib/src/config/smart_config_custom.dart index 3719695..427d41d 100644 --- a/lib/src/config/smart_config_custom.dart +++ b/lib/src/config/smart_config_custom.dart @@ -52,7 +52,7 @@ class SmartConfigCustom { /// centerLeft:dialog位于屏幕左边,动画默认为位移动画,自左而右 /// /// centerRight:dialog位于屏幕左边,动画默认为位移动画,自右而左 - final AlignmentGeometry alignment; + final Alignment alignment; /// [animationTime]:The animation time can be set /// diff --git a/lib/src/config/smart_config_loading.dart b/lib/src/config/smart_config_loading.dart index 365dea1..1cae51b 100644 --- a/lib/src/config/smart_config_loading.dart +++ b/lib/src/config/smart_config_loading.dart @@ -51,7 +51,7 @@ class SmartConfigLoading { /// centerLeft:dialog位于屏幕左边,动画默认为位移动画,自左而右 /// /// centerRight:dialog位于屏幕左边,动画默认为位移动画,自右而左 - final AlignmentGeometry alignment; + final Alignment alignment; /// [animationTime]:The animation time can be set /// diff --git a/lib/src/config/smart_config_notify.dart b/lib/src/config/smart_config_notify.dart index f6edda8..52566a1 100644 --- a/lib/src/config/smart_config_notify.dart +++ b/lib/src/config/smart_config_notify.dart @@ -50,7 +50,7 @@ class SmartConfigNotify { /// centerLeft:dialog位于屏幕左边,动画默认为位移动画,自左而右 /// /// centerRight:dialog位于屏幕左边,动画默认为位移动画,自右而左 - final AlignmentGeometry alignment; + final Alignment alignment; /// [animationTime]:The animation time can be set /// diff --git a/lib/src/config/smart_config_toast.dart b/lib/src/config/smart_config_toast.dart index abc7a6a..80d21d4 100644 --- a/lib/src/config/smart_config_toast.dart +++ b/lib/src/config/smart_config_toast.dart @@ -52,7 +52,7 @@ class SmartConfigToast { /// centerLeft:dialog位于屏幕左边,动画默认为位移动画,自左而右 /// /// centerRight:dialog位于屏幕左边,动画默认为位移动画,自右而左 - final AlignmentGeometry alignment; + final Alignment alignment; /// [animationTime]:The animation time can be set /// diff --git a/lib/src/custom/custom_dialog.dart b/lib/src/custom/custom_dialog.dart index d9a5a43..34ef9b5 100644 --- a/lib/src/custom/custom_dialog.dart +++ b/lib/src/custom/custom_dialog.dart @@ -24,7 +24,7 @@ class CustomDialog extends BaseDialog { Future show({ required Widget widget, - required AlignmentGeometry alignment, + required Alignment alignment, required bool usePenetrate, required bool useAnimation, required Duration animationTime, @@ -98,7 +98,7 @@ class CustomDialog extends BaseDialog { required Widget widget, required TargetBuilder? targetBuilder, required ReplaceBuilder? replaceBuilder, - required AlignmentGeometry alignment, + required Alignment alignment, required bool usePenetrate, required bool useAnimation, required Duration animationTime, diff --git a/lib/src/custom/custom_loading.dart b/lib/src/custom/custom_loading.dart index 358d197..70c6975 100644 --- a/lib/src/custom/custom_loading.dart +++ b/lib/src/custom/custom_loading.dart @@ -20,7 +20,7 @@ class CustomLoading extends BaseDialog { Future showLoading({ required Widget widget, - required AlignmentGeometry alignment, + required Alignment alignment, required bool clickMaskDismiss, required SmartAnimationType animationType, required List nonAnimationTypes, diff --git a/lib/src/custom/custom_notify.dart b/lib/src/custom/custom_notify.dart index 0f5c413..2805834 100644 --- a/lib/src/custom/custom_notify.dart +++ b/lib/src/custom/custom_notify.dart @@ -20,7 +20,7 @@ class CustomNotify extends BaseDialog { Future showNotify({ required Widget widget, - required AlignmentGeometry alignment, + required Alignment alignment, required bool usePenetrate, required bool useAnimation, required Duration animationTime, diff --git a/lib/src/custom/main_dialog.dart b/lib/src/custom/main_dialog.dart index a02f8fa..f7cf429 100644 --- a/lib/src/custom/main_dialog.dart +++ b/lib/src/custom/main_dialog.dart @@ -29,7 +29,7 @@ class MainDialog { Future show({ required Widget widget, - required AlignmentGeometry alignment, + required Alignment alignment, required bool usePenetrate, required bool useAnimation, required Duration animationTime, @@ -86,7 +86,7 @@ class MainDialog { required Widget widget, required TargetBuilder? targetBuilder, required ReplaceBuilder? replaceBuilder, - required AlignmentGeometry alignment, + required Alignment alignment, required bool usePenetrate, required bool useAnimation, required Duration animationTime, diff --git a/lib/src/custom/toast/custom_toast.dart b/lib/src/custom/toast/custom_toast.dart index b15ce37..00b0b8b 100644 --- a/lib/src/custom/toast/custom_toast.dart +++ b/lib/src/custom/toast/custom_toast.dart @@ -20,7 +20,7 @@ class CustomToast extends BaseDialog { CustomToast({required SmartOverlayEntry overlayEntry}) : super(overlayEntry); Future showToast({ - required AlignmentGeometry alignment, + required Alignment alignment, required bool clickMaskDismiss, required SmartAnimationType animationType, required List nonAnimationTypes, diff --git a/lib/src/data/animation_param.dart b/lib/src/data/animation_param.dart index 6f21112..9dfbd74 100644 --- a/lib/src/data/animation_param.dart +++ b/lib/src/data/animation_param.dart @@ -110,7 +110,7 @@ class AnimationParam { }); /// showXxx#alignment - AlignmentGeometry alignment; + Alignment alignment; /// showXxx#animationTime Duration animationTime; diff --git a/lib/src/helper/dialog_proxy.dart b/lib/src/helper/dialog_proxy.dart index 2e6e864..51b5481 100644 --- a/lib/src/helper/dialog_proxy.dart +++ b/lib/src/helper/dialog_proxy.dart @@ -88,7 +88,7 @@ class DialogProxy { Future show({ required Widget widget, - required AlignmentGeometry alignment, + required Alignment alignment, required bool usePenetrate, required bool useAnimation, required Duration animationTime, @@ -145,7 +145,7 @@ class DialogProxy { Future showNotify({ required Widget widget, - required AlignmentGeometry alignment, + required Alignment alignment, required bool usePenetrate, required bool useAnimation, required Duration animationTime, @@ -195,7 +195,7 @@ class DialogProxy { required Widget widget, required TargetBuilder? targetBuilder, required ReplaceBuilder? replaceBuilder, - required AlignmentGeometry alignment, + required Alignment alignment, required bool usePenetrate, required bool useAnimation, required Duration animationTime, @@ -258,7 +258,7 @@ class DialogProxy { } Future showLoading({ - required AlignmentGeometry alignment, + required Alignment alignment, required bool clickMaskDismiss, required SmartAnimationType animationType, required List nonAnimationTypes, @@ -294,7 +294,7 @@ class DialogProxy { } Future showToast({ - required AlignmentGeometry alignment, + required Alignment alignment, required bool clickMaskDismiss, required SmartAnimationType animationType, required List nonAnimationTypes, diff --git a/lib/src/smart_dialog.dart b/lib/src/smart_dialog.dart index 141c714..7071e2b 100644 --- a/lib/src/smart_dialog.dart +++ b/lib/src/smart_dialog.dart @@ -153,7 +153,7 @@ class SmartDialog { static Future show({ required WidgetBuilder builder, SmartDialogController? controller, - AlignmentGeometry? alignment, + Alignment? alignment, bool? clickMaskDismiss, bool? usePenetrate, bool? useAnimation, @@ -383,7 +383,7 @@ class SmartDialog { ReplaceBuilder? replaceBuilder, SmartDialogController? controller, TargetBuilder? targetBuilder, - AlignmentGeometry? alignment, + Alignment? alignment, bool? clickMaskDismiss, SmartAnimationType? animationType, List? nonAnimationTypes, @@ -554,7 +554,7 @@ class SmartDialog { required NotifyType notifyType, WidgetBuilder? builder, SmartDialogController? controller, - AlignmentGeometry? alignment, + Alignment? alignment, bool? clickMaskDismiss, bool? usePenetrate, bool? useAnimation, @@ -698,7 +698,7 @@ class SmartDialog { static Future showLoading({ String msg = 'loading...', SmartDialogController? controller, - AlignmentGeometry? alignment, + Alignment? alignment, bool? clickMaskDismiss, SmartAnimationType? animationType, List? nonAnimationTypes, @@ -829,7 +829,7 @@ class SmartDialog { String msg, { SmartDialogController? controller, Duration? displayTime, - AlignmentGeometry? alignment, + Alignment? alignment, bool? clickMaskDismiss, SmartAnimationType? animationType, List? nonAnimationTypes, diff --git a/lib/src/widget/animation/size_animation.dart b/lib/src/widget/animation/size_animation.dart index bda24ab..857f4a1 100644 --- a/lib/src/widget/animation/size_animation.dart +++ b/lib/src/widget/animation/size_animation.dart @@ -10,7 +10,7 @@ class SizeAnimation extends StatelessWidget { final AnimationController controller; - final AlignmentGeometry alignment; + final Alignment alignment; final Widget child; diff --git a/lib/src/widget/animation/slide_animation.dart b/lib/src/widget/animation/slide_animation.dart index 70e9261..6046ca8 100644 --- a/lib/src/widget/animation/slide_animation.dart +++ b/lib/src/widget/animation/slide_animation.dart @@ -8,7 +8,7 @@ class SlideAnimation extends StatefulWidget { required this.child, }) : super(key: key); - final AlignmentGeometry alignment; + final Alignment alignment; final Widget child; @@ -44,7 +44,7 @@ class _SlideAnimationState extends State ///处理下内容widget动画方向 void _dealContentAnimate() { - AlignmentGeometry? alignment = widget.alignment; + Alignment? alignment = widget.alignment; var offset = const Offset(0, 0); if (alignment == Alignment.bottomCenter || diff --git a/lib/src/widget/attach_dialog_widget.dart b/lib/src/widget/attach_dialog_widget.dart index e0b43fb..35c9789 100644 --- a/lib/src/widget/attach_dialog_widget.dart +++ b/lib/src/widget/attach_dialog_widget.dart @@ -80,7 +80,7 @@ class AttachDialogWidget extends StatefulWidget { final VoidCallback onMask; /// 内容控件方向 - final AlignmentGeometry alignment; + final Alignment alignment; /// 是否穿透背景,交互背景之后控件 final bool usePenetrate; diff --git a/lib/src/widget/helper/attach_widget.dart b/lib/src/widget/helper/attach_widget.dart index 3c19194..1701a3f 100644 --- a/lib/src/widget/helper/attach_widget.dart +++ b/lib/src/widget/helper/attach_widget.dart @@ -39,7 +39,7 @@ class AttachWidget extends StatefulWidget { final BeforeBuilder? beforeBuilder; - final AlignmentGeometry alignment; + final Alignment alignment; final Widget originChild; @@ -215,7 +215,7 @@ class _AttachWidgetState extends State { } /// 计算attach alignment类型的偏移量 - double _calculateDx(AlignmentGeometry alignment, Size selfSize) { + double _calculateDx(Alignment alignment, Size selfSize) { double offset = 0; var type = SmartDialog.config.attach.attachAlignmentType; diff --git a/lib/src/widget/smart_dialog_widget.dart b/lib/src/widget/smart_dialog_widget.dart index 1362357..ca18b6d 100644 --- a/lib/src/widget/smart_dialog_widget.dart +++ b/lib/src/widget/smart_dialog_widget.dart @@ -42,7 +42,7 @@ class SmartDialogWidget extends StatefulWidget { final VoidCallback onMask; /// 内容控件方向 - final AlignmentGeometry alignment; + final Alignment alignment; /// 是否穿透背景,交互背景之后控件 final bool usePenetrate; diff --git a/pubspec.yaml b/pubspec.yaml index 532143f..138e222 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.5+2 +version: 4.9.6 homepage: https://github.com/fluttercandies/flutter_smart_dialog # flutter pub publish --server=https://pub.dartlang.org