Fix validate email sending dialog position
(cherry picked from commit 8d873b53843a971d3e8e5eb0f80f97f6c5587454)
This commit is contained in:
@@ -155,7 +155,7 @@ class ConfirmDialogBuilder {
|
|||||||
return Dialog(
|
return Dialog(
|
||||||
key: _key,
|
key: _key,
|
||||||
shape: const RoundedRectangleBorder(
|
shape: const RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(16))),
|
borderRadius: BorderRadius.all(Radius.circular(18))),
|
||||||
insetPadding: _outsideDialogPadding ?? const EdgeInsets.symmetric(
|
insetPadding: _outsideDialogPadding ?? const EdgeInsets.symmetric(
|
||||||
horizontal: 24.0,
|
horizontal: 24.0,
|
||||||
vertical: 16.0),
|
vertical: 16.0),
|
||||||
@@ -171,83 +171,89 @@ class ConfirmDialogBuilder {
|
|||||||
width: _widthDialog ?? 400,
|
width: _widthDialog ?? 400,
|
||||||
height: _heightDialog,
|
height: _heightDialog,
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.all(Radius.circular(16))),
|
borderRadius: BorderRadius.all(Radius.circular(18))),
|
||||||
margin: _margin,
|
margin: _margin,
|
||||||
child: Wrap(children: [
|
child: Column(
|
||||||
if (_onCloseButtonAction != null)
|
mainAxisSize: MainAxisSize.min,
|
||||||
Align(
|
children: [
|
||||||
alignment: Alignment.centerRight,
|
if (_onCloseButtonAction != null)
|
||||||
child: Padding(
|
Align(
|
||||||
padding: const EdgeInsets.only(top: 8, right: 8),
|
alignment: AlignmentDirectional.centerEnd,
|
||||||
child: buildIconWeb(
|
child: TMailButtonWidget.fromIcon(
|
||||||
icon: SvgPicture.asset(_imagePath.icCircleClose, fit: BoxFit.fill),
|
icon: _imagePath.icCircleClose,
|
||||||
onTap: () => _onCloseButtonAction?.call())
|
iconSize: 30,
|
||||||
)),
|
padding: const EdgeInsets.all(3),
|
||||||
if (_iconWidget != null)
|
backgroundColor: Colors.transparent,
|
||||||
Container(
|
margin: const EdgeInsetsDirectional.only(top: 16, end: 16),
|
||||||
margin: _marginIcon ?? EdgeInsets.zero,
|
onTapActionCallback: _onCloseButtonAction
|
||||||
alignment: Alignment.center,
|
|
||||||
child: _iconWidget,
|
|
||||||
),
|
|
||||||
if (_title.isNotEmpty)
|
|
||||||
Padding(
|
|
||||||
padding: _paddingTitle ?? const EdgeInsets.only(top: 12),
|
|
||||||
child: Center(
|
|
||||||
child: Text(
|
|
||||||
_title,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: _styleTitle ?? const TextStyle(fontSize: 20.0, color: AppColor.colorActionDeleteConfirmDialog, fontWeight: FontWeight.w500)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
),
|
|
||||||
if (_content.isNotEmpty)
|
|
||||||
Padding(
|
|
||||||
padding: _paddingContent ?? const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
|
|
||||||
child: Center(
|
|
||||||
child: Text(_content,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: _styleContent ?? const TextStyle(fontSize: 17.0, color: AppColor.colorMessageDialog)
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
)
|
if (_iconWidget != null)
|
||||||
else if (listTextSpan != null)
|
Container(
|
||||||
Padding(
|
margin: _marginIcon ?? EdgeInsets.zero,
|
||||||
padding: _paddingContent ?? const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
|
alignment: Alignment.center,
|
||||||
child: Center(
|
child: _iconWidget,
|
||||||
child: RichText(
|
),
|
||||||
textAlign: TextAlign.center,
|
if (_title.isNotEmpty)
|
||||||
text: TextSpan(
|
Padding(
|
||||||
style: _styleContent ?? const TextStyle(fontSize: 17.0, color: AppColor.colorMessageDialog),
|
padding: _paddingTitle ?? const EdgeInsets.only(top: 12),
|
||||||
children: listTextSpan
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
_title,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _styleTitle ?? const TextStyle(fontSize: 20.0, color: AppColor.colorActionDeleteConfirmDialog, fontWeight: FontWeight.w500)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
if (_content.isNotEmpty)
|
||||||
|
Padding(
|
||||||
|
padding: _paddingContent ?? const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
|
||||||
|
child: Center(
|
||||||
|
child: Text(_content,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _styleContent ?? const TextStyle(fontSize: 17.0, color: AppColor.colorMessageDialog)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
else if (listTextSpan != null)
|
||||||
|
Padding(
|
||||||
|
padding: _paddingContent ?? const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
|
||||||
|
child: Center(
|
||||||
|
child: RichText(
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
text: TextSpan(
|
||||||
|
style: _styleContent ?? const TextStyle(fontSize: 17.0, color: AppColor.colorMessageDialog),
|
||||||
|
children: listTextSpan
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Padding(
|
||||||
Padding(
|
padding: _paddingButton ?? const EdgeInsets.only(bottom: 16, left: 16, right: 16),
|
||||||
padding: _paddingButton ?? const EdgeInsets.only(bottom: 16, left: 16, right: 16),
|
child: Row(
|
||||||
child: Row(
|
children: [
|
||||||
children: [
|
if (_cancelText.isNotEmpty)
|
||||||
if (_cancelText.isNotEmpty)
|
Expanded(child: _buildButton(
|
||||||
Expanded(child: _buildButton(
|
name: _cancelText,
|
||||||
name: _cancelText,
|
bgColor: _colorCancelButton,
|
||||||
bgColor: _colorCancelButton,
|
radius: _radiusButton,
|
||||||
radius: _radiusButton,
|
height: heightButton,
|
||||||
height: heightButton,
|
textStyle: _styleTextCancelButton,
|
||||||
textStyle: _styleTextCancelButton,
|
action: _onCancelButtonAction)),
|
||||||
action: _onCancelButtonAction)),
|
if (_confirmText.isNotEmpty && _cancelText.isNotEmpty) const SizedBox(width: 16),
|
||||||
if (_confirmText.isNotEmpty && _cancelText.isNotEmpty) const SizedBox(width: 16),
|
if (_confirmText.isNotEmpty)
|
||||||
if (_confirmText.isNotEmpty)
|
Expanded(child: _buildButton(
|
||||||
Expanded(child: _buildButton(
|
name: _confirmText,
|
||||||
name: _confirmText,
|
bgColor: _colorConfirmButton,
|
||||||
bgColor: _colorConfirmButton,
|
radius: _radiusButton,
|
||||||
radius: _radiusButton,
|
height: heightButton,
|
||||||
height: heightButton,
|
textStyle: _styleTextConfirmButton,
|
||||||
textStyle: _styleTextConfirmButton,
|
action: _onConfirmButtonAction))
|
||||||
action: _onConfirmButtonAction))
|
]
|
||||||
]
|
))
|
||||||
))
|
]
|
||||||
])
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -77,8 +77,7 @@ mixin MessageDialogActionMixin {
|
|||||||
..title(title ?? '')
|
..title(title ?? '')
|
||||||
..content(message)
|
..content(message)
|
||||||
..addIcon(icon)
|
..addIcon(icon)
|
||||||
..margin(const EdgeInsets.symmetric(vertical: 42, horizontal: 16))
|
..margin(const EdgeInsets.only(bottom: 42))
|
||||||
..marginIcon(icon != null ? const EdgeInsets.only(top: 24) : null)
|
|
||||||
..widthDialog(responsiveUtils.getSizeScreenWidth(context))
|
..widthDialog(responsiveUtils.getSizeScreenWidth(context))
|
||||||
..colorConfirmButton(actionButtonColor ?? AppColor.colorTextButton)
|
..colorConfirmButton(actionButtonColor ?? AppColor.colorTextButton)
|
||||||
..colorCancelButton(cancelButtonColor ?? AppColor.colorCancelButton)
|
..colorCancelButton(cancelButtonColor ?? AppColor.colorCancelButton)
|
||||||
@@ -108,6 +107,11 @@ mixin MessageDialogActionMixin {
|
|||||||
barrierColor: AppColor.colorDefaultCupertinoActionSheet,
|
barrierColor: AppColor.colorDefaultCupertinoActionSheet,
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
enableDrag: true,
|
enableDrag: true,
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
maxWidth: responsiveUtils.getSizeScreenShortestSide(context) - 16
|
||||||
|
),
|
||||||
|
useSafeArea: true,
|
||||||
|
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(18))),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return (ConfirmationDialogActionSheetBuilder(context, listTextSpan: listTextSpan)
|
return (ConfirmationDialogActionSheetBuilder(context, listTextSpan: listTextSpan)
|
||||||
|
|||||||
@@ -815,7 +815,7 @@ class ComposerController extends BaseController {
|
|||||||
return 'Team-Mail/${mailboxDashBoardController.appInformation.value?.version} $userAgent';
|
return 'Team-Mail/${mailboxDashBoardController.appInformation.value?.version} $userAgent';
|
||||||
}
|
}
|
||||||
|
|
||||||
void sendEmailAction(BuildContext context) async {
|
void validateInformationBeforeSending(BuildContext context) async {
|
||||||
if (isSendEmailLoading.isTrue) {
|
if (isSendEmailLoading.isTrue) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -838,7 +838,8 @@ class ComposerController extends BaseController {
|
|||||||
onConfirmAction: () => isSendEmailLoading.value = false,
|
onConfirmAction: () => isSendEmailLoading.value = false,
|
||||||
title: AppLocalizations.of(context).sending_failed,
|
title: AppLocalizations.of(context).sending_failed,
|
||||||
icon: SvgPicture.asset(imagePaths.icSendToastError, fit: BoxFit.fill),
|
icon: SvgPicture.asset(imagePaths.icSendToastError, fit: BoxFit.fill),
|
||||||
hasCancelButton: false
|
hasCancelButton: false,
|
||||||
|
showAsBottomSheet: true,
|
||||||
).whenComplete(() => isSendEmailLoading.value = false);
|
).whenComplete(() => isSendEmailLoading.value = false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -857,6 +858,7 @@ class ComposerController extends BaseController {
|
|||||||
bccAddressExpandMode.value = ExpandMode.EXPAND;
|
bccAddressExpandMode.value = ExpandMode.EXPAND;
|
||||||
isSendEmailLoading.value = false;
|
isSendEmailLoading.value = false;
|
||||||
},
|
},
|
||||||
|
showAsBottomSheet: true,
|
||||||
title: AppLocalizations.of(context).sending_failed,
|
title: AppLocalizations.of(context).sending_failed,
|
||||||
icon: SvgPicture.asset(imagePaths.icSendToastError, fit: BoxFit.fill),
|
icon: SvgPicture.asset(imagePaths.icSendToastError, fit: BoxFit.fill),
|
||||||
hasCancelButton: false
|
hasCancelButton: false
|
||||||
@@ -871,6 +873,7 @@ class ComposerController extends BaseController {
|
|||||||
onConfirmAction: () => _handleSendMessages(context),
|
onConfirmAction: () => _handleSendMessages(context),
|
||||||
onCancelAction: () => isSendEmailLoading.value = false,
|
onCancelAction: () => isSendEmailLoading.value = false,
|
||||||
title: AppLocalizations.of(context).empty_subject,
|
title: AppLocalizations.of(context).empty_subject,
|
||||||
|
showAsBottomSheet: true,
|
||||||
icon: SvgPicture.asset(imagePaths.icEmpty, fit: BoxFit.fill),
|
icon: SvgPicture.asset(imagePaths.icEmpty, fit: BoxFit.fill),
|
||||||
).whenComplete(() => isSendEmailLoading.value = false);
|
).whenComplete(() => isSendEmailLoading.value = false);
|
||||||
return;
|
return;
|
||||||
@@ -883,6 +886,7 @@ class ComposerController extends BaseController {
|
|||||||
AppLocalizations.of(context).got_it,
|
AppLocalizations.of(context).got_it,
|
||||||
onConfirmAction: () => isSendEmailLoading.value = false,
|
onConfirmAction: () => isSendEmailLoading.value = false,
|
||||||
title: AppLocalizations.of(context).sending_failed,
|
title: AppLocalizations.of(context).sending_failed,
|
||||||
|
showAsBottomSheet: true,
|
||||||
icon: SvgPicture.asset(imagePaths.icSendToastError, fit: BoxFit.fill),
|
icon: SvgPicture.asset(imagePaths.icSendToastError, fit: BoxFit.fill),
|
||||||
hasCancelButton: false
|
hasCancelButton: false
|
||||||
).whenComplete(() => isSendEmailLoading.value = false);
|
).whenComplete(() => isSendEmailLoading.value = false);
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
Obx(() => LandscapeAppBarComposerWidget(
|
Obx(() => LandscapeAppBarComposerWidget(
|
||||||
isSendButtonEnabled: controller.isEnableEmailSendButton.value,
|
isSendButtonEnabled: controller.isEnableEmailSendButton.value,
|
||||||
onCloseViewAction: () => controller.saveToDraftAndClose(context),
|
onCloseViewAction: () => controller.saveToDraftAndClose(context),
|
||||||
sendMessageAction: () => controller.sendEmailAction(context),
|
sendMessageAction: () => controller.validateInformationBeforeSending(context),
|
||||||
openContextMenuAction: (position) {
|
openContextMenuAction: (position) {
|
||||||
controller.openPopupMenuAction(
|
controller.openPopupMenuAction(
|
||||||
context,
|
context,
|
||||||
@@ -74,7 +74,7 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
Obx(() => AppBarComposerWidget(
|
Obx(() => AppBarComposerWidget(
|
||||||
isSendButtonEnabled: controller.isEnableEmailSendButton.value,
|
isSendButtonEnabled: controller.isEnableEmailSendButton.value,
|
||||||
onCloseViewAction: () => controller.saveToDraftAndClose(context),
|
onCloseViewAction: () => controller.saveToDraftAndClose(context),
|
||||||
sendMessageAction: () => controller.sendEmailAction(context),
|
sendMessageAction: () => controller.validateInformationBeforeSending(context),
|
||||||
openContextMenuAction: (position) {
|
openContextMenuAction: (position) {
|
||||||
controller.openPopupMenuAction(
|
controller.openPopupMenuAction(
|
||||||
context,
|
context,
|
||||||
@@ -362,7 +362,7 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
TabletBottomBarComposerWidget(
|
TabletBottomBarComposerWidget(
|
||||||
deleteComposerAction: () => controller.closeComposer(context),
|
deleteComposerAction: () => controller.closeComposer(context),
|
||||||
saveToDraftAction: () => controller.saveToDraftAction(context),
|
saveToDraftAction: () => controller.saveToDraftAction(context),
|
||||||
sendMessageAction: () => controller.sendEmailAction(context),
|
sendMessageAction: () => controller.validateInformationBeforeSending(context),
|
||||||
requestReadReceiptAction: (position) {
|
requestReadReceiptAction: (position) {
|
||||||
controller.openPopupMenuAction(
|
controller.openPopupMenuAction(
|
||||||
context,
|
context,
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
onCloseViewAction: () => controller.saveToDraftAndClose(context),
|
onCloseViewAction: () => controller.saveToDraftAndClose(context),
|
||||||
attachFileAction: () => controller.openFilePickerByType(context, FileType.any),
|
attachFileAction: () => controller.openFilePickerByType(context, FileType.any),
|
||||||
insertImageAction: () => controller.insertImage(context, constraints.maxWidth),
|
insertImageAction: () => controller.insertImage(context, constraints.maxWidth),
|
||||||
sendMessageAction: () => controller.sendEmailAction(context),
|
sendMessageAction: () => controller.validateInformationBeforeSending(context),
|
||||||
openContextMenuAction: (position) {
|
openContextMenuAction: (position) {
|
||||||
controller.openPopupMenuAction(
|
controller.openPopupMenuAction(
|
||||||
context,
|
context,
|
||||||
@@ -441,7 +441,7 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
showCodeViewAction: controller.richTextWebController.toggleCodeView,
|
showCodeViewAction: controller.richTextWebController.toggleCodeView,
|
||||||
deleteComposerAction: () => controller.closeComposer(context),
|
deleteComposerAction: () => controller.closeComposer(context),
|
||||||
saveToDraftAction: () => controller.saveToDraftAction(context),
|
saveToDraftAction: () => controller.saveToDraftAction(context),
|
||||||
sendMessageAction: () => controller.sendEmailAction(context),
|
sendMessageAction: () => controller.validateInformationBeforeSending(context),
|
||||||
requestReadReceiptAction: (position) {
|
requestReadReceiptAction: (position) {
|
||||||
controller.openPopupMenuAction(
|
controller.openPopupMenuAction(
|
||||||
context,
|
context,
|
||||||
@@ -657,7 +657,7 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
showCodeViewAction: controller.richTextWebController.toggleCodeView,
|
showCodeViewAction: controller.richTextWebController.toggleCodeView,
|
||||||
deleteComposerAction: () => controller.closeComposer(context),
|
deleteComposerAction: () => controller.closeComposer(context),
|
||||||
saveToDraftAction: () => controller.saveToDraftAction(context),
|
saveToDraftAction: () => controller.saveToDraftAction(context),
|
||||||
sendMessageAction: () => controller.sendEmailAction(context),
|
sendMessageAction: () => controller.validateInformationBeforeSending(context),
|
||||||
requestReadReceiptAction: (position) {
|
requestReadReceiptAction: (position) {
|
||||||
controller.openPopupMenuAction(
|
controller.openPopupMenuAction(
|
||||||
context,
|
context,
|
||||||
|
|||||||
Reference in New Issue
Block a user