Fix horizontal padding bottom sheet modal

Signed-off-by: dab246 <tdvu@linagora.com>
(cherry picked from commit 324fc75901b9f966a7eb3c4bbd0ff977dd4150c1)
This commit is contained in:
dab246
2023-12-19 11:59:52 +07:00
committed by Dat H. Pham
parent 3f3a918a00
commit 34465dc8f7
2 changed files with 10 additions and 5 deletions
@@ -31,6 +31,7 @@ class ConfirmDialogBuilder {
EdgeInsets? _margin; EdgeInsets? _margin;
double? _widthDialog; double? _widthDialog;
double? _heightDialog; double? _heightDialog;
double maxWith;
Alignment? _alignment; Alignment? _alignment;
Color? _backgroundColor; Color? _backgroundColor;
bool showAsBottomSheet; bool showAsBottomSheet;
@@ -46,6 +47,7 @@ class ConfirmDialogBuilder {
this.showAsBottomSheet = false, this.showAsBottomSheet = false,
this.listTextSpan, this.listTextSpan,
this.heightButton, this.heightButton,
this.maxWith = double.infinity,
} }
); );
@@ -169,6 +171,7 @@ class ConfirmDialogBuilder {
return Container( return Container(
width: _widthDialog ?? 400, width: _widthDialog ?? 400,
height: _heightDialog, height: _heightDialog,
constraints: BoxConstraints(maxWidth: maxWith),
decoration: const BoxDecoration( decoration: const BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(18))), borderRadius: BorderRadius.all(Radius.circular(18))),
@@ -72,7 +72,12 @@ mixin MessageDialogActionMixin {
if (showAsBottomSheet) { if (showAsBottomSheet) {
return await Get.bottomSheet( return await Get.bottomSheet(
PointerInterceptor( PointerInterceptor(
child: (ConfirmDialogBuilder(imagePaths, showAsBottomSheet: true, listTextSpan: listTextSpan) child: (ConfirmDialogBuilder(
imagePaths,
showAsBottomSheet: true,
listTextSpan: listTextSpan,
maxWith: responsiveUtils.getSizeScreenShortestSide(context) - 16
)
..key(const Key('confirm_dialog_action')) ..key(const Key('confirm_dialog_action'))
..title(title ?? '') ..title(title ?? '')
..content(message) ..content(message)
@@ -107,10 +112,7 @@ mixin MessageDialogActionMixin {
barrierColor: AppColor.colorDefaultCupertinoActionSheet, barrierColor: AppColor.colorDefaultCupertinoActionSheet,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
enableDrag: true, enableDrag: true,
constraints: BoxConstraints( ignoreSafeArea: false,
maxWidth: responsiveUtils.getSizeScreenShortestSide(context) - 16
),
useSafeArea: true,
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(18))), shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(18))),
); );
} else { } else {