From 2b3d7589871dbd80694cfdf53f0172a5a9a0f31a Mon Sep 17 00:00:00 2001 From: Michael Aziz Date: Sat, 24 Jan 2026 11:12:08 +0200 Subject: [PATCH] [FIX] Dialog Helper options --- lib/src/dialog/dialog_helper.astromic.dart | 42 ++----------------- .../src/models/configuration.model.dart | 8 +--- lib/src/dialog/src/models/style.model.dart | 21 +++++----- 3 files changed, 15 insertions(+), 56 deletions(-) diff --git a/lib/src/dialog/dialog_helper.astromic.dart b/lib/src/dialog/dialog_helper.astromic.dart index a64085f..c2c0ed8 100644 --- a/lib/src/dialog/dialog_helper.astromic.dart +++ b/lib/src/dialog/dialog_helper.astromic.dart @@ -16,14 +16,15 @@ class AstromicDialogHelper { return await showDialog( context: context, useSafeArea: configuration.safeAreaAware, - builder: (BuildContext _) { + builder: (_) { return Dialog( backgroundColor: Colors.transparent, - insetPadding: style.placement?.resolve(style.textDirection) ?? const EdgeInsets.symmetric(horizontal: 40, vertical: 24), + insetPadding: style.margin?.resolve(style.textDirection) ?? const EdgeInsets.symmetric(horizontal: 40, vertical: 24), child: Stack( children: [ Container( width: style.width, + height: style.height, padding: style.contentPadding, decoration: BoxDecoration( color: style.backgroundColor, @@ -42,43 +43,6 @@ class AstromicDialogHelper { ], ), ); - // 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, - // ), - // ], - // ), - // ], - // ), - // ], - // ), - // ); }); // } diff --git a/lib/src/dialog/src/models/configuration.model.dart b/lib/src/dialog/src/models/configuration.model.dart index 3bb65b7..14919cd 100644 --- a/lib/src/dialog/src/models/configuration.model.dart +++ b/lib/src/dialog/src/models/configuration.model.dart @@ -1,19 +1,15 @@ class AstromicDialogConfiguration { - // - final bool isCentered; - final bool safeAreaAware; const AstromicDialogConfiguration({ - this.isCentered = true, this.safeAreaAware = true, }); - // + + final bool safeAreaAware; AstromicDialogConfiguration copyWith({ bool? isCentered, bool? safeAreaAware, }) { return AstromicDialogConfiguration( - isCentered: isCentered ?? this.isCentered, safeAreaAware: safeAreaAware ?? this.safeAreaAware, ); } diff --git a/lib/src/dialog/src/models/style.model.dart b/lib/src/dialog/src/models/style.model.dart index 4af7c51..3d1eb15 100644 --- a/lib/src/dialog/src/models/style.model.dart +++ b/lib/src/dialog/src/models/style.model.dart @@ -1,16 +1,6 @@ import 'package:flutter/material.dart'; class AstromicDialogStyle { - // - final Color? backgroundColor; - final BorderRadius? radius; - final EdgeInsets? contentPadding; - final double? width; - final double? height; - final TextDirection textDirection; - final EdgeInsetsDirectional? placement; - final EdgeInsetsDirectional? closeWidgetPlacement; - const AstromicDialogStyle({ this.backgroundColor = Colors.white, this.radius, @@ -18,8 +8,17 @@ class AstromicDialogStyle { this.width = 300, this.height, this.textDirection = TextDirection.ltr, - this.placement, + this.margin, this.closeWidgetPlacement, }); + + final Color? backgroundColor; + final BorderRadius? radius; + final EdgeInsets? contentPadding; + final double? width; + final double? height; + final TextDirection textDirection; + final EdgeInsetsDirectional? margin; + final EdgeInsetsDirectional? closeWidgetPlacement; // }