[FIX] Dialog Helper options
This commit is contained in:
@@ -16,14 +16,15 @@ class AstromicDialogHelper {
|
||||
return await showDialog<T>(
|
||||
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: <Widget>[
|
||||
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: <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,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
});
|
||||
//
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
//
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user