[SYNC] Altered the dialog helper to center.

This commit is contained in:
2025-08-05 15:03:07 +03:00
parent 06e53f752c
commit dc93c41782
2 changed files with 58 additions and 33 deletions

View File

@@ -11,4 +11,4 @@ Developed, Maintained, and is property of Michael W. Aziz (Micazi)
- Presenting Helper ☑️
- Dialog Helper
- Listing Helper
- SnackBar Helper
- SnackBar Helper

View File

@@ -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: <Widget>[
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
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: <Widget>[
// Row(
// mainAxisSize: MainAxisSize.min,
// children: <Widget>[
// 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,
// ),
// ],
// ),
// ],
// ),
// ],
// ),
// );
});
//
}