Skip to content

Commit

Permalink
break change: "AlignmentGeometry" adjust to "Alignment"
Browse files Browse the repository at this point in the history
  • Loading branch information
xdd666t committed Dec 30, 2023
1 parent 107d70f commit 03778c4
Show file tree
Hide file tree
Showing 23 changed files with 37 additions and 36 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion docs/Attach Chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions docs/Dialog Chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
````dart
void _dialogLocation() async {
locationDialog({
required AlignmentGeometry alignment,
required Alignment alignment,
double width = double.infinity,
double height = double.infinity,
}) async {
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions lib/src/compatible/compatible_smart_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class CompatibleSmartDialog {
/// false(使用SmartDialog),此参数可彻底解决在弹窗上跳转页面问题
Future<void> show({
required Widget widget,
AlignmentGeometry? alignmentTemp,
Alignment? alignmentTemp,
bool? clickBgDismissTemp,
bool? isLoadingTemp,
bool? isPenetrateTemp,
Expand Down Expand Up @@ -244,7 +244,7 @@ class CompatibleSmartDialog {
required BuildContext? targetContext,
required Widget widget,
Offset? target,
AlignmentGeometry? alignmentTemp,
Alignment? alignmentTemp,
bool? clickBgDismissTemp,
bool? isLoadingTemp,
bool? isPenetrateTemp,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/compatible/smart_config_compatible.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/src/config/smart_config_custom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class SmartConfigCustom {
/// centerLeft:dialog位于屏幕左边,动画默认为位移动画,自左而右
///
/// centerRight:dialog位于屏幕左边,动画默认为位移动画,自右而左
final AlignmentGeometry alignment;
final Alignment alignment;

/// [animationTime]:The animation time can be set
///
Expand Down
2 changes: 1 addition & 1 deletion lib/src/config/smart_config_loading.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class SmartConfigLoading {
/// centerLeft:dialog位于屏幕左边,动画默认为位移动画,自左而右
///
/// centerRight:dialog位于屏幕左边,动画默认为位移动画,自右而左
final AlignmentGeometry alignment;
final Alignment alignment;

/// [animationTime]:The animation time can be set
///
Expand Down
2 changes: 1 addition & 1 deletion lib/src/config/smart_config_notify.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class SmartConfigNotify {
/// centerLeft:dialog位于屏幕左边,动画默认为位移动画,自左而右
///
/// centerRight:dialog位于屏幕左边,动画默认为位移动画,自右而左
final AlignmentGeometry alignment;
final Alignment alignment;

/// [animationTime]:The animation time can be set
///
Expand Down
2 changes: 1 addition & 1 deletion lib/src/config/smart_config_toast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class SmartConfigToast {
/// centerLeft:dialog位于屏幕左边,动画默认为位移动画,自左而右
///
/// centerRight:dialog位于屏幕左边,动画默认为位移动画,自右而左
final AlignmentGeometry alignment;
final Alignment alignment;

/// [animationTime]:The animation time can be set
///
Expand Down
4 changes: 2 additions & 2 deletions lib/src/custom/custom_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class CustomDialog extends BaseDialog {

Future<T?> show<T>({
required Widget widget,
required AlignmentGeometry alignment,
required Alignment alignment,
required bool usePenetrate,
required bool useAnimation,
required Duration animationTime,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/custom/custom_loading.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CustomLoading extends BaseDialog {

Future<T?> showLoading<T>({
required Widget widget,
required AlignmentGeometry alignment,
required Alignment alignment,
required bool clickMaskDismiss,
required SmartAnimationType animationType,
required List<SmartNonAnimationType> nonAnimationTypes,
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 @@ -20,7 +20,7 @@ class CustomNotify extends BaseDialog {

Future<T?> showNotify<T>({
required Widget widget,
required AlignmentGeometry alignment,
required Alignment alignment,
required bool usePenetrate,
required bool useAnimation,
required Duration animationTime,
Expand Down
4 changes: 2 additions & 2 deletions lib/src/custom/main_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class MainDialog {

Future<T?> show<T>({
required Widget widget,
required AlignmentGeometry alignment,
required Alignment alignment,
required bool usePenetrate,
required bool useAnimation,
required Duration animationTime,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/custom/toast/custom_toast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CustomToast extends BaseDialog {
CustomToast({required SmartOverlayEntry overlayEntry}) : super(overlayEntry);

Future<void> showToast({
required AlignmentGeometry alignment,
required Alignment alignment,
required bool clickMaskDismiss,
required SmartAnimationType animationType,
required List<SmartNonAnimationType> nonAnimationTypes,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/data/animation_param.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class AnimationParam {
});

/// showXxx#alignment
AlignmentGeometry alignment;
Alignment alignment;

/// showXxx#animationTime
Duration animationTime;
Expand Down
10 changes: 5 additions & 5 deletions lib/src/helper/dialog_proxy.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class DialogProxy {

Future<T?> show<T>({
required Widget widget,
required AlignmentGeometry alignment,
required Alignment alignment,
required bool usePenetrate,
required bool useAnimation,
required Duration animationTime,
Expand Down Expand Up @@ -145,7 +145,7 @@ class DialogProxy {

Future<T?> showNotify<T>({
required Widget widget,
required AlignmentGeometry alignment,
required Alignment alignment,
required bool usePenetrate,
required bool useAnimation,
required Duration animationTime,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -258,7 +258,7 @@ class DialogProxy {
}

Future<T?> showLoading<T>({
required AlignmentGeometry alignment,
required Alignment alignment,
required bool clickMaskDismiss,
required SmartAnimationType animationType,
required List<SmartNonAnimationType> nonAnimationTypes,
Expand Down Expand Up @@ -294,7 +294,7 @@ class DialogProxy {
}

Future<void> showToast({
required AlignmentGeometry alignment,
required Alignment alignment,
required bool clickMaskDismiss,
required SmartAnimationType animationType,
required List<SmartNonAnimationType> nonAnimationTypes,
Expand Down
10 changes: 5 additions & 5 deletions lib/src/smart_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class SmartDialog {
static Future<T?> show<T>({
required WidgetBuilder builder,
SmartDialogController? controller,
AlignmentGeometry? alignment,
Alignment? alignment,
bool? clickMaskDismiss,
bool? usePenetrate,
bool? useAnimation,
Expand Down Expand Up @@ -383,7 +383,7 @@ class SmartDialog {
ReplaceBuilder? replaceBuilder,
SmartDialogController? controller,
TargetBuilder? targetBuilder,
AlignmentGeometry? alignment,
Alignment? alignment,
bool? clickMaskDismiss,
SmartAnimationType? animationType,
List<SmartNonAnimationType>? nonAnimationTypes,
Expand Down Expand Up @@ -554,7 +554,7 @@ class SmartDialog {
required NotifyType notifyType,
WidgetBuilder? builder,
SmartDialogController? controller,
AlignmentGeometry? alignment,
Alignment? alignment,
bool? clickMaskDismiss,
bool? usePenetrate,
bool? useAnimation,
Expand Down Expand Up @@ -698,7 +698,7 @@ class SmartDialog {
static Future<T?> showLoading<T>({
String msg = 'loading...',
SmartDialogController? controller,
AlignmentGeometry? alignment,
Alignment? alignment,
bool? clickMaskDismiss,
SmartAnimationType? animationType,
List<SmartNonAnimationType>? nonAnimationTypes,
Expand Down Expand Up @@ -829,7 +829,7 @@ class SmartDialog {
String msg, {
SmartDialogController? controller,
Duration? displayTime,
AlignmentGeometry? alignment,
Alignment? alignment,
bool? clickMaskDismiss,
SmartAnimationType? animationType,
List<SmartNonAnimationType>? nonAnimationTypes,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/widget/animation/size_animation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class SizeAnimation extends StatelessWidget {

final AnimationController controller;

final AlignmentGeometry alignment;
final Alignment alignment;

final Widget child;

Expand Down
4 changes: 2 additions & 2 deletions lib/src/widget/animation/slide_animation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class SlideAnimation extends StatefulWidget {
required this.child,
}) : super(key: key);

final AlignmentGeometry alignment;
final Alignment alignment;

final Widget child;

Expand Down Expand Up @@ -44,7 +44,7 @@ class _SlideAnimationState extends State<SlideAnimation>

///处理下内容widget动画方向
void _dealContentAnimate() {
AlignmentGeometry? alignment = widget.alignment;
Alignment? alignment = widget.alignment;
var offset = const Offset(0, 0);

if (alignment == Alignment.bottomCenter ||
Expand Down
2 changes: 1 addition & 1 deletion lib/src/widget/attach_dialog_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class AttachDialogWidget extends StatefulWidget {
final VoidCallback onMask;

/// 内容控件方向
final AlignmentGeometry alignment;
final Alignment alignment;

/// 是否穿透背景,交互背景之后控件
final bool usePenetrate;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/widget/helper/attach_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class AttachWidget extends StatefulWidget {

final BeforeBuilder? beforeBuilder;

final AlignmentGeometry alignment;
final Alignment alignment;

final Widget originChild;

Expand Down Expand Up @@ -215,7 +215,7 @@ class _AttachWidgetState extends State<AttachWidget> {
}

/// 计算attach alignment类型的偏移量
double _calculateDx(AlignmentGeometry alignment, Size selfSize) {
double _calculateDx(Alignment alignment, Size selfSize) {
double offset = 0;
var type = SmartDialog.config.attach.attachAlignmentType;

Expand Down
2 changes: 1 addition & 1 deletion lib/src/widget/smart_dialog_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class SmartDialogWidget extends StatefulWidget {
final VoidCallback onMask;

/// 内容控件方向
final AlignmentGeometry alignment;
final Alignment alignment;

/// 是否穿透背景,交互背景之后控件
final bool usePenetrate;
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.5+2
version: 4.9.6
homepage: https://github.com/fluttercandies/flutter_smart_dialog
# flutter pub publish --server=https://pub.dartlang.org

Expand Down

0 comments on commit 03778c4

Please sign in to comment.