[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

@@ -17,43 +17,68 @@ class AstromicDialogHelper {
context: context, context: context,
useSafeArea: configuration.safeAreaAware, useSafeArea: configuration.safeAreaAware,
builder: (BuildContext _) { builder: (BuildContext _) {
return Container( return Dialog(
margin: style.placement, backgroundColor: Colors.transparent,
// insetPadding: style.placement?.resolve(style.textDirection) ?? const EdgeInsets.symmetric(horizontal: 40, vertical: 24),
child: Column( child: Stack(
mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
Row( Container(
mainAxisSize: MainAxisSize.min, width: style.width,
children: <Widget>[ padding: style.contentPadding,
Stack( decoration: BoxDecoration(
children: [ color: style.backgroundColor,
Container( borderRadius: style.radius,
width: (style.width ?? 0) - ((style.placement?.start ?? 0) + (style.placement?.start ?? 0)), ),
// child: contentSection,
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,
),
],
),
],
), ),
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,
// ),
// ],
// ),
// ],
// ),
// ],
// ),
// );
}); });
// //
} }