From dc93c41782537d08d96c0607acf219b6af70e341 Mon Sep 17 00:00:00 2001 From: Michael Aziz Date: Tue, 5 Aug 2025 15:03:07 +0300 Subject: [PATCH] [SYNC] Altered the dialog helper to center. --- README.md | 2 +- lib/src/dialog/dialog_helper.astromic.dart | 89 ++++++++++++++-------- 2 files changed, 58 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 1c6c02f..7b0f296 100644 --- a/README.md +++ b/README.md @@ -11,4 +11,4 @@ Developed, Maintained, and is property of Michael W. Aziz (Micazi) - Presenting Helper ☑️ - Dialog Helper - Listing Helper -- SnackBar Helper +- SnackBar Helper \ No newline at end of file diff --git a/lib/src/dialog/dialog_helper.astromic.dart b/lib/src/dialog/dialog_helper.astromic.dart index 59f9e17..a64085f 100644 --- a/lib/src/dialog/dialog_helper.astromic.dart +++ b/lib/src/dialog/dialog_helper.astromic.dart @@ -17,43 +17,68 @@ class AstromicDialogHelper { context: context, useSafeArea: configuration.safeAreaAware, builder: (BuildContext _) { - return Container( - margin: style.placement, - // - child: Column( - mainAxisSize: MainAxisSize.min, + return Dialog( + backgroundColor: Colors.transparent, + insetPadding: style.placement?.resolve(style.textDirection) ?? const EdgeInsets.symmetric(horizontal: 40, vertical: 24), + child: Stack( children: [ - Row( - mainAxisSize: MainAxisSize.min, - children: [ - Stack( - children: [ - Container( - width: (style.width ?? 0) - ((style.placement?.start ?? 0) + (style.placement?.start ?? 0)), - // - padding: style.contentPadding, - decoration: BoxDecoration( - color: style.backgroundColor, - borderRadius: style.radius, - ), - child: contentSection, - ), - if (stackedCloseWidget != null) - Positioned.directional( - textDirection: style.textDirection, - start: style.closeWidgetPlacement?.start, - end: style.closeWidgetPlacement?.end, - top: style.closeWidgetPlacement?.top, - // - child: stackedCloseWidget, - ), - ], - ), - ], + Container( + width: style.width, + padding: style.contentPadding, + decoration: BoxDecoration( + color: style.backgroundColor, + borderRadius: style.radius, + ), + child: contentSection, ), + if (stackedCloseWidget != null) + Positioned.directional( + textDirection: style.textDirection, + start: style.closeWidgetPlacement?.start, + end: style.closeWidgetPlacement?.end, + top: style.closeWidgetPlacement?.top, + child: stackedCloseWidget, + ), ], ), ); + // Container( + // margin: style.placement, + // // + // child: Column( + // mainAxisSize: MainAxisSize.min, + // children: [ + // Row( + // mainAxisSize: MainAxisSize.min, + // children: [ + // Stack( + // children: [ + // Container( + // width: (style.width ?? 0) - ((style.placement?.start ?? 0) + (style.placement?.start ?? 0)), + // // + // padding: style.contentPadding, + // decoration: BoxDecoration( + // color: style.backgroundColor, + // borderRadius: style.radius, + // ), + // child: contentSection, + // ), + // if (stackedCloseWidget != null) + // Positioned.directional( + // textDirection: style.textDirection, + // start: style.closeWidgetPlacement?.start, + // end: style.closeWidgetPlacement?.end, + // top: style.closeWidgetPlacement?.top, + // // + // child: stackedCloseWidget, + // ), + // ], + // ), + // ], + // ), + // ], + // ), + // ); }); // }