@@ -249,7 +249,16 @@ class ThemeUtils {
|
|||||||
letterSpacing: 0.1,
|
letterSpacing: 0.1,
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
height: 20 / 14,
|
height: 20 / 14,
|
||||||
color: color ??AppColor.primaryMain,
|
color: color ?? AppColor.primaryMain,
|
||||||
|
);
|
||||||
|
|
||||||
|
static const TextStyle textStyleM3BodyMedium1 = TextStyle(
|
||||||
|
fontFamily: ConstantsUI.fontApp,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
letterSpacing: -0.15,
|
||||||
|
fontSize: 16,
|
||||||
|
height: 24 / 16,
|
||||||
|
color: AppColor.textPrimary,
|
||||||
);
|
);
|
||||||
|
|
||||||
static TextStyle textStyleAppShortcut() => const TextStyle(
|
static TextStyle textStyleAppShortcut() => const TextStyle(
|
||||||
|
|||||||
+3
-11
@@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
import 'package:core/presentation/extensions/color_extension.dart';
|
import 'package:core/presentation/extensions/color_extension.dart';
|
||||||
|
import 'package:core/presentation/utils/theme_utils.dart';
|
||||||
import 'package:core/utils/platform_info.dart';
|
import 'package:core/utils/platform_info.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -19,7 +20,6 @@ class ConfirmationDialogActionSheetBuilder {
|
|||||||
OnCancelActionClick? _onCancelActionClick;
|
OnCancelActionClick? _onCancelActionClick;
|
||||||
TextStyle? _styleConfirmButton;
|
TextStyle? _styleConfirmButton;
|
||||||
TextStyle? _styleCancelButton;
|
TextStyle? _styleCancelButton;
|
||||||
TextStyle? _styleMessage;
|
|
||||||
List<TextSpan>? listTextSpan;
|
List<TextSpan>? listTextSpan;
|
||||||
|
|
||||||
ConfirmationDialogActionSheetBuilder(this._context, {this.listTextSpan});
|
ConfirmationDialogActionSheetBuilder(this._context, {this.listTextSpan});
|
||||||
@@ -38,10 +38,6 @@ class ConfirmationDialogActionSheetBuilder {
|
|||||||
_messageText = message;
|
_messageText = message;
|
||||||
}
|
}
|
||||||
|
|
||||||
void styleMessage(TextStyle? style) {
|
|
||||||
_styleMessage = style;
|
|
||||||
}
|
|
||||||
|
|
||||||
void styleConfirmButton(TextStyle? style) {
|
void styleConfirmButton(TextStyle? style) {
|
||||||
_styleConfirmButton = style;
|
_styleConfirmButton = style;
|
||||||
}
|
}
|
||||||
@@ -66,9 +62,7 @@ class ConfirmationDialogActionSheetBuilder {
|
|||||||
child: Text(
|
child: Text(
|
||||||
_messageText ?? '',
|
_messageText ?? '',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: _styleMessage ?? Theme.of(context).textTheme.bodyLarge?.copyWith(
|
style: ThemeUtils.textStyleM3BodyMedium1,
|
||||||
color: AppColor.steelGrayA540,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
onPressed: () => {},
|
onPressed: () => {},
|
||||||
),
|
),
|
||||||
@@ -82,9 +76,7 @@ class ConfirmationDialogActionSheetBuilder {
|
|||||||
cursor: PlatformInfo.isWeb ? WidgetStateMouseCursor.clickable : MouseCursor.defer,
|
cursor: PlatformInfo.isWeb ? WidgetStateMouseCursor.clickable : MouseCursor.defer,
|
||||||
child: CupertinoActionSheetAction(
|
child: CupertinoActionSheetAction(
|
||||||
child: RichText(text: TextSpan(
|
child: RichText(text: TextSpan(
|
||||||
style: _styleMessage ?? Theme.of(context).textTheme.bodyLarge?.copyWith(
|
style: ThemeUtils.textStyleM3BodyMedium1,
|
||||||
color: AppColor.steelGrayA540,
|
|
||||||
),
|
|
||||||
children: listTextSpan
|
children: listTextSpan
|
||||||
)),
|
)),
|
||||||
onPressed: () => {},
|
onPressed: () => {},
|
||||||
|
|||||||
@@ -1,57 +1,37 @@
|
|||||||
|
import 'package:core/presentation/utils/theme_utils.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class ConfirmDialogButton extends StatelessWidget {
|
class ConfirmDialogButton extends StatelessWidget {
|
||||||
|
|
||||||
final String label;
|
final String label;
|
||||||
final double? borderRadius;
|
final Color? backgroundColor;
|
||||||
final Color backgroundColor;
|
|
||||||
final EdgeInsetsGeometry? padding;
|
|
||||||
final int? maxLines;
|
|
||||||
final TextStyle? textStyle;
|
|
||||||
final Color? textColor;
|
final Color? textColor;
|
||||||
final VoidCallback? onTapAction;
|
final VoidCallback? onTapAction;
|
||||||
|
|
||||||
const ConfirmDialogButton({
|
const ConfirmDialogButton({
|
||||||
super.key,
|
super.key,
|
||||||
required this.label,
|
required this.label,
|
||||||
required this.backgroundColor,
|
this.backgroundColor,
|
||||||
this.textStyle,
|
|
||||||
this.borderRadius,
|
|
||||||
this.padding,
|
|
||||||
this.maxLines,
|
|
||||||
this.textColor,
|
this.textColor,
|
||||||
this.onTapAction
|
this.onTapAction,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Material(
|
return TextButton(
|
||||||
type: MaterialType.transparency,
|
style: TextButton.styleFrom(
|
||||||
child: InkWell(
|
backgroundColor: backgroundColor,
|
||||||
onTap: onTapAction,
|
overlayColor: Theme.of(context).colorScheme.outline.withOpacity(0.08),
|
||||||
borderRadius: BorderRadius.all(Radius.circular(borderRadius ?? 10)),
|
shape: const RoundedRectangleBorder(
|
||||||
child: Container(
|
borderRadius: BorderRadius.all(Radius.circular(100)),
|
||||||
width: double.infinity,
|
|
||||||
height: maxLines == 1 ? 44 : null,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: backgroundColor,
|
|
||||||
borderRadius: BorderRadius.all(Radius.circular(borderRadius ?? 10)),
|
|
||||||
),
|
|
||||||
alignment: Alignment.center,
|
|
||||||
padding: maxLines == 1
|
|
||||||
? const EdgeInsets.symmetric(horizontal: 8)
|
|
||||||
: padding ?? const EdgeInsets.symmetric(horizontal: 8, vertical: 12),
|
|
||||||
child: Text(
|
|
||||||
label,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
maxLines: maxLines,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
style: textStyle ?? Theme.of(context).textTheme.bodyLarge?.copyWith(
|
|
||||||
color: textColor,
|
|
||||||
)
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||||
|
),
|
||||||
|
onPressed: onTapAction,
|
||||||
|
child: Text(
|
||||||
|
label,
|
||||||
|
style: ThemeUtils.textStyleM3LabelLarge(color: textColor),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:core/presentation/extensions/color_extension.dart';
|
import 'package:core/presentation/extensions/color_extension.dart';
|
||||||
import 'package:core/presentation/resources/image_paths.dart';
|
import 'package:core/presentation/resources/image_paths.dart';
|
||||||
|
import 'package:core/presentation/utils/theme_utils.dart';
|
||||||
import 'package:core/presentation/views/button/tmail_button_widget.dart';
|
import 'package:core/presentation/views/button/tmail_button_widget.dart';
|
||||||
import 'package:core/presentation/views/dialog/confirm_dialog_button.dart';
|
import 'package:core/presentation/views/dialog/confirm_dialog_button.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -23,23 +24,12 @@ class ConfirmationDialogBuilder extends StatelessWidget {
|
|||||||
final Color? confirmLabelButtonColor;
|
final Color? confirmLabelButtonColor;
|
||||||
final TextStyle? styleTextCancelButton;
|
final TextStyle? styleTextCancelButton;
|
||||||
final TextStyle? styleTextConfirmButton;
|
final TextStyle? styleTextConfirmButton;
|
||||||
final TextStyle? styleTitle;
|
|
||||||
final TextStyle? styleContent;
|
|
||||||
final double? radiusButton;
|
|
||||||
final EdgeInsetsGeometry? paddingTitle;
|
|
||||||
final EdgeInsetsGeometry? paddingContent;
|
|
||||||
final EdgeInsetsGeometry? paddingButton;
|
|
||||||
final EdgeInsetsGeometry? marginButton;
|
|
||||||
final EdgeInsets? outsideDialogPadding;
|
final EdgeInsets? outsideDialogPadding;
|
||||||
final EdgeInsetsGeometry? marginIcon;
|
|
||||||
final EdgeInsetsGeometry? margin;
|
final EdgeInsetsGeometry? margin;
|
||||||
final double? widthDialog;
|
|
||||||
final double maxWidth;
|
final double maxWidth;
|
||||||
final Alignment? alignment;
|
final Alignment? alignment;
|
||||||
final Color? backgroundColor;
|
|
||||||
final bool showAsBottomSheet;
|
final bool showAsBottomSheet;
|
||||||
final List<TextSpan>? listTextSpan;
|
final List<TextSpan>? listTextSpan;
|
||||||
final int? titleActionButtonMaxLines;
|
|
||||||
final bool isArrangeActionButtonsVertical;
|
final bool isArrangeActionButtonsVertical;
|
||||||
final bool useIconAsBasicLogo;
|
final bool useIconAsBasicLogo;
|
||||||
final OnConfirmButtonAction? onConfirmButtonAction;
|
final OnConfirmButtonAction? onConfirmButtonAction;
|
||||||
@@ -61,25 +51,14 @@ class ConfirmationDialogBuilder extends StatelessWidget {
|
|||||||
this.confirmLabelButtonColor,
|
this.confirmLabelButtonColor,
|
||||||
this.styleTextCancelButton,
|
this.styleTextCancelButton,
|
||||||
this.styleTextConfirmButton,
|
this.styleTextConfirmButton,
|
||||||
this.styleTitle,
|
|
||||||
this.styleContent,
|
|
||||||
this.radiusButton,
|
|
||||||
this.paddingTitle,
|
|
||||||
this.paddingContent,
|
|
||||||
this.paddingButton,
|
|
||||||
this.marginButton,
|
|
||||||
this.outsideDialogPadding,
|
this.outsideDialogPadding,
|
||||||
this.marginIcon,
|
|
||||||
this.margin,
|
this.margin,
|
||||||
this.widthDialog,
|
|
||||||
this.maxWidth = double.infinity,
|
this.maxWidth = double.infinity,
|
||||||
this.alignment,
|
this.alignment,
|
||||||
this.backgroundColor,
|
|
||||||
this.showAsBottomSheet = false,
|
this.showAsBottomSheet = false,
|
||||||
this.listTextSpan,
|
this.listTextSpan,
|
||||||
this.titleActionButtonMaxLines,
|
|
||||||
this.isArrangeActionButtonsVertical = false,
|
this.isArrangeActionButtonsVertical = false,
|
||||||
this.useIconAsBasicLogo = true,
|
this.useIconAsBasicLogo = false,
|
||||||
this.onConfirmButtonAction,
|
this.onConfirmButtonAction,
|
||||||
this.onCancelButtonAction,
|
this.onCancelButtonAction,
|
||||||
this.onCloseButtonAction,
|
this.onCloseButtonAction,
|
||||||
@@ -100,21 +79,9 @@ class ConfirmationDialogBuilder extends StatelessWidget {
|
|||||||
confirmBackgroundButtonColor: confirmBackgroundButtonColor,
|
confirmBackgroundButtonColor: confirmBackgroundButtonColor,
|
||||||
cancelLabelButtonColor: cancelLabelButtonColor,
|
cancelLabelButtonColor: cancelLabelButtonColor,
|
||||||
confirmLabelButtonColor: confirmLabelButtonColor,
|
confirmLabelButtonColor: confirmLabelButtonColor,
|
||||||
styleTextCancelButton: styleTextCancelButton,
|
|
||||||
styleTextConfirmButton: styleTextConfirmButton,
|
|
||||||
styleTitle: styleTitle,
|
|
||||||
styleContent: styleContent,
|
|
||||||
radiusButton: radiusButton,
|
|
||||||
paddingTitle: paddingTitle,
|
|
||||||
paddingContent: paddingContent,
|
|
||||||
paddingButton: paddingButton,
|
|
||||||
marginButton: marginButton,
|
|
||||||
marginIcon: marginIcon,
|
|
||||||
margin: margin,
|
margin: margin,
|
||||||
widthDialog: widthDialog,
|
|
||||||
maxWidth: maxWidth,
|
maxWidth: maxWidth,
|
||||||
listTextSpan: listTextSpan,
|
listTextSpan: listTextSpan,
|
||||||
titleActionButtonMaxLines: titleActionButtonMaxLines,
|
|
||||||
isArrangeActionButtonsVertical: isArrangeActionButtonsVertical,
|
isArrangeActionButtonsVertical: isArrangeActionButtonsVertical,
|
||||||
useIconAsBasicLogo: useIconAsBasicLogo,
|
useIconAsBasicLogo: useIconAsBasicLogo,
|
||||||
onConfirmButtonAction: onConfirmButtonAction,
|
onConfirmButtonAction: onConfirmButtonAction,
|
||||||
@@ -123,10 +90,11 @@ class ConfirmationDialogBuilder extends StatelessWidget {
|
|||||||
)
|
)
|
||||||
: Dialog(
|
: Dialog(
|
||||||
shape: const RoundedRectangleBorder(
|
shape: const RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(18))),
|
borderRadius: BorderRadius.all(Radius.circular(16)),
|
||||||
|
),
|
||||||
insetPadding: outsideDialogPadding,
|
insetPadding: outsideDialogPadding,
|
||||||
alignment: alignment ?? Alignment.center,
|
alignment: alignment ?? Alignment.center,
|
||||||
backgroundColor: backgroundColor,
|
backgroundColor: Colors.white,
|
||||||
child: _BodyContent(
|
child: _BodyContent(
|
||||||
imagePath: imagePath,
|
imagePath: imagePath,
|
||||||
title: title,
|
title: title,
|
||||||
@@ -139,21 +107,9 @@ class ConfirmationDialogBuilder extends StatelessWidget {
|
|||||||
confirmBackgroundButtonColor: confirmBackgroundButtonColor,
|
confirmBackgroundButtonColor: confirmBackgroundButtonColor,
|
||||||
cancelLabelButtonColor: cancelLabelButtonColor,
|
cancelLabelButtonColor: cancelLabelButtonColor,
|
||||||
confirmLabelButtonColor: confirmLabelButtonColor,
|
confirmLabelButtonColor: confirmLabelButtonColor,
|
||||||
styleTextCancelButton: styleTextCancelButton,
|
|
||||||
styleTextConfirmButton: styleTextConfirmButton,
|
|
||||||
styleTitle: styleTitle,
|
|
||||||
styleContent: styleContent,
|
|
||||||
radiusButton: radiusButton,
|
|
||||||
paddingTitle: paddingTitle,
|
|
||||||
paddingContent: paddingContent,
|
|
||||||
paddingButton: paddingButton,
|
|
||||||
marginButton: marginButton,
|
|
||||||
marginIcon: marginIcon,
|
|
||||||
margin: margin,
|
margin: margin,
|
||||||
widthDialog: widthDialog,
|
|
||||||
maxWidth: maxWidth,
|
maxWidth: maxWidth,
|
||||||
listTextSpan: listTextSpan,
|
listTextSpan: listTextSpan,
|
||||||
titleActionButtonMaxLines: titleActionButtonMaxLines,
|
|
||||||
isArrangeActionButtonsVertical: isArrangeActionButtonsVertical,
|
isArrangeActionButtonsVertical: isArrangeActionButtonsVertical,
|
||||||
useIconAsBasicLogo: useIconAsBasicLogo,
|
useIconAsBasicLogo: useIconAsBasicLogo,
|
||||||
onConfirmButtonAction: onConfirmButtonAction,
|
onConfirmButtonAction: onConfirmButtonAction,
|
||||||
@@ -176,21 +132,9 @@ class _BodyContent extends StatelessWidget {
|
|||||||
final Color? confirmBackgroundButtonColor;
|
final Color? confirmBackgroundButtonColor;
|
||||||
final Color? cancelLabelButtonColor;
|
final Color? cancelLabelButtonColor;
|
||||||
final Color? confirmLabelButtonColor;
|
final Color? confirmLabelButtonColor;
|
||||||
final TextStyle? styleTextCancelButton;
|
|
||||||
final TextStyle? styleTextConfirmButton;
|
|
||||||
final TextStyle? styleTitle;
|
|
||||||
final TextStyle? styleContent;
|
|
||||||
final double? radiusButton;
|
|
||||||
final EdgeInsetsGeometry? paddingTitle;
|
|
||||||
final EdgeInsetsGeometry? paddingContent;
|
|
||||||
final EdgeInsetsGeometry? paddingButton;
|
|
||||||
final EdgeInsetsGeometry? marginButton;
|
|
||||||
final EdgeInsetsGeometry? marginIcon;
|
|
||||||
final EdgeInsetsGeometry? margin;
|
final EdgeInsetsGeometry? margin;
|
||||||
final double? widthDialog;
|
|
||||||
final double maxWidth;
|
final double maxWidth;
|
||||||
final List<TextSpan>? listTextSpan;
|
final List<TextSpan>? listTextSpan;
|
||||||
final int? titleActionButtonMaxLines;
|
|
||||||
final bool isArrangeActionButtonsVertical;
|
final bool isArrangeActionButtonsVertical;
|
||||||
final bool useIconAsBasicLogo;
|
final bool useIconAsBasicLogo;
|
||||||
final OnConfirmButtonAction? onConfirmButtonAction;
|
final OnConfirmButtonAction? onConfirmButtonAction;
|
||||||
@@ -209,21 +153,9 @@ class _BodyContent extends StatelessWidget {
|
|||||||
this.confirmBackgroundButtonColor,
|
this.confirmBackgroundButtonColor,
|
||||||
this.cancelLabelButtonColor,
|
this.cancelLabelButtonColor,
|
||||||
this.confirmLabelButtonColor,
|
this.confirmLabelButtonColor,
|
||||||
this.styleTextCancelButton,
|
|
||||||
this.styleTextConfirmButton,
|
|
||||||
this.styleTitle,
|
|
||||||
this.styleContent,
|
|
||||||
this.radiusButton,
|
|
||||||
this.paddingTitle,
|
|
||||||
this.paddingContent,
|
|
||||||
this.paddingButton,
|
|
||||||
this.marginButton,
|
|
||||||
this.marginIcon,
|
|
||||||
this.margin,
|
this.margin,
|
||||||
this.widthDialog,
|
|
||||||
required this.maxWidth,
|
required this.maxWidth,
|
||||||
this.listTextSpan,
|
this.listTextSpan,
|
||||||
this.titleActionButtonMaxLines,
|
|
||||||
required this.isArrangeActionButtonsVertical,
|
required this.isArrangeActionButtonsVertical,
|
||||||
required this.useIconAsBasicLogo,
|
required this.useIconAsBasicLogo,
|
||||||
this.onConfirmButtonAction,
|
this.onConfirmButtonAction,
|
||||||
@@ -234,47 +166,55 @@ class _BodyContent extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
width: widthDialog ?? 400,
|
width: 421,
|
||||||
constraints: BoxConstraints(maxWidth: maxWidth),
|
constraints: BoxConstraints(maxWidth: maxWidth),
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.all(Radius.circular(18)),
|
borderRadius: BorderRadius.all(Radius.circular(16)),
|
||||||
),
|
),
|
||||||
margin: margin,
|
margin: margin,
|
||||||
padding: const EdgeInsetsDirectional.only(
|
child: Stack(
|
||||||
top: 11,
|
|
||||||
end: 11,
|
|
||||||
start: 16,
|
|
||||||
bottom: 24,
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
children: [
|
||||||
_buildCloseButton(),
|
Padding(
|
||||||
_buildIcon(),
|
padding: const EdgeInsetsDirectional.only(
|
||||||
_buildTitle(context),
|
start: 32,
|
||||||
_buildContent(context),
|
end: 32,
|
||||||
_buildAdditionalContent(),
|
top: 24,
|
||||||
_buildActionButtons(context),
|
bottom: 32,
|
||||||
].where((widget) => widget != const SizedBox.shrink()).toList(),
|
),
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
_buildIcon(),
|
||||||
|
_buildTitle(context),
|
||||||
|
_buildContent(context),
|
||||||
|
_buildAdditionalContent(),
|
||||||
|
_buildActionButtons(context),
|
||||||
|
].where((widget) => widget != const SizedBox.shrink()).toList(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (_showCloseButton()) _buildCloseButton(),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool _showCloseButton() => onCloseButtonAction != null;
|
||||||
|
|
||||||
Widget _buildCloseButton() {
|
Widget _buildCloseButton() {
|
||||||
return onCloseButtonAction != null
|
return PositionedDirectional(
|
||||||
? Align(
|
top: 4,
|
||||||
alignment: AlignmentDirectional.topEnd,
|
end: 4,
|
||||||
child: TMailButtonWidget.fromIcon(
|
child: TMailButtonWidget.fromIcon(
|
||||||
icon: imagePath.icCloseDialog,
|
icon: imagePath.icCloseDialog,
|
||||||
iconSize: 29,
|
iconSize: 24,
|
||||||
iconColor: AppColor.steelGrayA540,
|
iconColor: AppColor.m3Tertiary,
|
||||||
padding: const EdgeInsets.all(5),
|
padding: const EdgeInsets.all(10),
|
||||||
backgroundColor: Colors.transparent,
|
borderRadius: 24,
|
||||||
onTapActionCallback: onCloseButtonAction,
|
backgroundColor: Colors.transparent,
|
||||||
),
|
onTapActionCallback: onCloseButtonAction,
|
||||||
)
|
),
|
||||||
: const SizedBox(height: 24);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildIcon() {
|
Widget _buildIcon() {
|
||||||
@@ -289,28 +229,18 @@ class _BodyContent extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else if (iconWidget != null) {
|
} else if (iconWidget != null) {
|
||||||
return Container(
|
return Center(child: iconWidget);
|
||||||
margin: marginIcon ?? EdgeInsets.zero,
|
|
||||||
alignment: Alignment.center,
|
|
||||||
child: iconWidget,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildTitle(BuildContext context) {
|
Widget _buildTitle(BuildContext context) {
|
||||||
return title.trim().isNotEmpty
|
return title.trim().isNotEmpty
|
||||||
? Padding(
|
? Center(
|
||||||
padding: paddingTitle ??
|
child: Text(
|
||||||
const EdgeInsetsDirectional.only(top: 16, end: 5),
|
title,
|
||||||
child: Center(
|
style: ThemeUtils.textStyleM3HeadlineSmall.copyWith(
|
||||||
child: Text(
|
color: AppColor.textPrimary,
|
||||||
title,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: styleTitle ??
|
|
||||||
Theme.of(context).textTheme.titleLarge?.copyWith(
|
|
||||||
color: AppColor.m3SurfaceBackground,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@@ -320,33 +250,19 @@ class _BodyContent extends StatelessWidget {
|
|||||||
Widget _buildContent(BuildContext context) {
|
Widget _buildContent(BuildContext context) {
|
||||||
if (textContent.trim().isNotEmpty) {
|
if (textContent.trim().isNotEmpty) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.only(top: 32),
|
||||||
paddingContent ?? const EdgeInsetsDirectional.only(top: 16, end: 5),
|
child: Text(
|
||||||
child: Center(
|
textContent,
|
||||||
child: Text(
|
style: ThemeUtils.textStyleM3BodyMedium1,
|
||||||
textContent,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: styleContent ??
|
|
||||||
Theme.of(context).textTheme.bodyLarge?.copyWith(
|
|
||||||
color: AppColor.steelGrayA540,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else if (listTextSpan != null) {
|
} else if (listTextSpan != null) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.only(top: 32),
|
||||||
paddingContent ?? const EdgeInsetsDirectional.only(top: 16, end: 5),
|
child: RichText(
|
||||||
child: Center(
|
text: TextSpan(
|
||||||
child: RichText(
|
style: ThemeUtils.textStyleM3BodyMedium1,
|
||||||
textAlign: TextAlign.center,
|
children: listTextSpan,
|
||||||
text: TextSpan(
|
|
||||||
style: styleContent ??
|
|
||||||
Theme.of(context).textTheme.bodyLarge?.copyWith(
|
|
||||||
color: AppColor.steelGrayA540,
|
|
||||||
),
|
|
||||||
children: listTextSpan,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -357,42 +273,45 @@ class _BodyContent extends StatelessWidget {
|
|||||||
Widget _buildAdditionalContent() {
|
Widget _buildAdditionalContent() {
|
||||||
return additionalWidgetContent != null
|
return additionalWidgetContent != null
|
||||||
? Padding(
|
? Padding(
|
||||||
padding: const EdgeInsetsDirectional.only(top: 16, end: 5),
|
padding: const EdgeInsetsDirectional.only(top: 16),
|
||||||
child: additionalWidgetContent!,
|
child: additionalWidgetContent!,
|
||||||
)
|
)
|
||||||
: const SizedBox.shrink();
|
: const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildActionButtons(BuildContext context) {
|
Widget _buildActionButtons(BuildContext context) {
|
||||||
if (isArrangeActionButtonsVertical) {
|
if (isArrangeActionButtonsVertical ||
|
||||||
|
cancelText.isEmpty ||
|
||||||
|
confirmText.isEmpty
|
||||||
|
) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: marginButton ??
|
padding: const EdgeInsetsDirectional.only(top: 44),
|
||||||
const EdgeInsetsDirectional.only(start: 15, end: 20),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
if (cancelText.isNotEmpty)
|
if (cancelText.isNotEmpty)
|
||||||
Padding(
|
SizedBox(
|
||||||
padding: const EdgeInsetsDirectional.only(top: 16),
|
width: double.infinity,
|
||||||
child: _buildButton(
|
height: 48,
|
||||||
context,
|
child: ConfirmDialogButton(
|
||||||
cancelText,
|
label: cancelText,
|
||||||
onCancelButtonAction,
|
backgroundColor: cancelBackgroundButtonColor,
|
||||||
cancelBackgroundButtonColor,
|
textColor: cancelLabelButtonColor,
|
||||||
cancelLabelButtonColor,
|
onTapAction: onCancelButtonAction,
|
||||||
styleTextCancelButton,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
if (confirmText.isNotEmpty && cancelText.isNotEmpty)
|
||||||
|
const SizedBox(height: 8),
|
||||||
if (confirmText.isNotEmpty)
|
if (confirmText.isNotEmpty)
|
||||||
Padding(
|
SizedBox(
|
||||||
padding: const EdgeInsetsDirectional.only(top: 16),
|
width: double.infinity,
|
||||||
child: _buildButton(
|
height: 48,
|
||||||
context,
|
child: ConfirmDialogButton(
|
||||||
confirmText,
|
label: confirmText,
|
||||||
onConfirmButtonAction,
|
backgroundColor: confirmBackgroundButtonColor
|
||||||
confirmBackgroundButtonColor,
|
?? AppColor.primaryMain,
|
||||||
confirmLabelButtonColor,
|
textColor: confirmLabelButtonColor ?? Colors.white,
|
||||||
styleTextConfirmButton,
|
onTapAction: onConfirmButtonAction,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -400,63 +319,43 @@ class _BodyContent extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: marginButton ??
|
padding: const EdgeInsetsDirectional.only(
|
||||||
const EdgeInsetsDirectional.only(top: 16, start: 15, end: 20),
|
top: 44,
|
||||||
|
start: 12,
|
||||||
|
end: 12,
|
||||||
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
if (cancelText.isNotEmpty)
|
Flexible(
|
||||||
Expanded(
|
child: Container(
|
||||||
child: _buildButton(
|
constraints: const BoxConstraints(minWidth: 67),
|
||||||
context,
|
height: 48,
|
||||||
cancelText,
|
child: ConfirmDialogButton(
|
||||||
onCancelButtonAction,
|
label: cancelText,
|
||||||
cancelBackgroundButtonColor,
|
backgroundColor: cancelBackgroundButtonColor,
|
||||||
cancelLabelButtonColor,
|
textColor: cancelLabelButtonColor,
|
||||||
styleTextCancelButton,
|
onTapAction: onCancelButtonAction,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (confirmText.isNotEmpty && cancelText.isNotEmpty)
|
),
|
||||||
const SizedBox(width: 16),
|
const SizedBox(width: 8),
|
||||||
if (confirmText.isNotEmpty)
|
Flexible(
|
||||||
Expanded(
|
child: Container(
|
||||||
child: _buildButton(
|
constraints: const BoxConstraints(minWidth: 135),
|
||||||
context,
|
height: 48,
|
||||||
confirmText,
|
child: ConfirmDialogButton(
|
||||||
onConfirmButtonAction,
|
label: confirmText,
|
||||||
confirmBackgroundButtonColor,
|
backgroundColor: confirmBackgroundButtonColor
|
||||||
confirmLabelButtonColor,
|
?? AppColor.primaryMain,
|
||||||
styleTextConfirmButton,
|
textColor: confirmLabelButtonColor ?? Colors.white,
|
||||||
|
onTapAction: onConfirmButtonAction,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildButton(
|
|
||||||
BuildContext context,
|
|
||||||
String label,
|
|
||||||
VoidCallback? onTapAction,
|
|
||||||
Color? bgColor,
|
|
||||||
Color? textColor,
|
|
||||||
TextStyle? textStyle,
|
|
||||||
) {
|
|
||||||
return ConfirmDialogButton(
|
|
||||||
label: label,
|
|
||||||
backgroundColor: bgColor ??
|
|
||||||
(onTapAction == onConfirmButtonAction
|
|
||||||
? AppColor.blue700
|
|
||||||
: AppColor.grayBackgroundColor),
|
|
||||||
borderRadius: radiusButton,
|
|
||||||
textStyle: textStyle,
|
|
||||||
padding: paddingButton,
|
|
||||||
textColor: textColor ??
|
|
||||||
(onTapAction == onConfirmButtonAction
|
|
||||||
? Colors.white
|
|
||||||
: AppColor.steelGray600),
|
|
||||||
maxLines: titleActionButtonMaxLines,
|
|
||||||
onTapAction: onTapAction,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'dart:async';
|
|||||||
import 'package:core/presentation/extensions/color_extension.dart';
|
import 'package:core/presentation/extensions/color_extension.dart';
|
||||||
import 'package:core/presentation/utils/theme_utils.dart';
|
import 'package:core/presentation/utils/theme_utils.dart';
|
||||||
import 'package:core/presentation/views/button/tmail_button_widget.dart';
|
import 'package:core/presentation/views/button/tmail_button_widget.dart';
|
||||||
|
import 'package:core/presentation/views/dialog/confirm_dialog_button.dart';
|
||||||
import 'package:core/presentation/views/text/text_field_builder.dart';
|
import 'package:core/presentation/views/text/text_field_builder.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
@@ -159,58 +160,25 @@ class _EditTextDialogBuilderState extends State<EditTextDialogBuilder> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
Flexible(
|
Flexible(
|
||||||
child: TextButton(
|
child: Container(
|
||||||
style: TextButton.styleFrom(
|
constraints: const BoxConstraints(minWidth: 67),
|
||||||
overlayColor: Theme.of(context)
|
height: 48,
|
||||||
.colorScheme
|
child: ConfirmDialogButton(
|
||||||
.outline
|
label: widget.negativeText,
|
||||||
.withOpacity(0.08),
|
onTapAction: _onNegativeAction,
|
||||||
minimumSize: const Size(67, 48),
|
|
||||||
shape: const RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(100),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 10,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onPressed: _onNegativeAction,
|
|
||||||
child: Text(
|
|
||||||
widget.negativeText,
|
|
||||||
style: ThemeUtils.textStyleM3LabelLarge(),
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Flexible(
|
Flexible(
|
||||||
child: TextButton(
|
child: Container(
|
||||||
style: TextButton.styleFrom(
|
constraints: const BoxConstraints(minWidth: 119),
|
||||||
|
height: 48,
|
||||||
|
child: ConfirmDialogButton(
|
||||||
|
label: widget.positiveText,
|
||||||
backgroundColor: AppColor.primaryMain,
|
backgroundColor: AppColor.primaryMain,
|
||||||
overlayColor: Theme.of(context)
|
textColor: Colors.white,
|
||||||
.colorScheme
|
onTapAction: _onPositiveAction,
|
||||||
.outline
|
|
||||||
.withOpacity(0.08),
|
|
||||||
minimumSize: const Size(119, 48),
|
|
||||||
shape: const RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(100),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 10,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onPressed: _onPositiveAction,
|
|
||||||
child: Text(
|
|
||||||
widget.positiveText,
|
|
||||||
style: ThemeUtils.textStyleM3LabelLarge(
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -258,13 +226,13 @@ class _EditTextDialogBuilderState extends State<EditTextDialogBuilder> {
|
|||||||
|
|
||||||
Widget _buildCloseButton() {
|
Widget _buildCloseButton() {
|
||||||
return PositionedDirectional(
|
return PositionedDirectional(
|
||||||
top: 0,
|
top: 4,
|
||||||
end: 0,
|
end: 4,
|
||||||
child: TMailButtonWidget.fromIcon(
|
child: TMailButtonWidget.fromIcon(
|
||||||
icon: widget.closeIcon!,
|
icon: widget.closeIcon!,
|
||||||
iconSize: 24,
|
iconSize: 24,
|
||||||
iconColor: AppColor.m3Tertiary,
|
iconColor: AppColor.m3Tertiary,
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const EdgeInsets.all(10),
|
||||||
borderRadius: 24,
|
borderRadius: 24,
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
onTapActionCallback: widget.onCloseButtonAction,
|
onTapActionCallback: widget.onCloseButtonAction,
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'package:core/presentation/extensions/color_extension.dart';
|
|
||||||
import 'package:core/presentation/utils/theme_utils.dart';
|
import 'package:core/presentation/utils/theme_utils.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:tmail_ui_user/features/base/mixin/message_dialog_action_mixin.dart';
|
import 'package:tmail_ui_user/features/base/mixin/message_dialog_action_mixin.dart';
|
||||||
@@ -19,14 +18,11 @@ mixin LogoutMixin implements MessageDialogActionMixin {
|
|||||||
title: appLocalizations.logoutConfirmation,
|
title: appLocalizations.logoutConfirmation,
|
||||||
alignCenter: true,
|
alignCenter: true,
|
||||||
outsideDismissible: false,
|
outsideDismissible: false,
|
||||||
titleActionButtonMaxLines: 1,
|
|
||||||
messageStyle: ThemeUtils.textStyleBodyBody2(color: AppColor.steelGray400),
|
|
||||||
listTextSpan: [
|
listTextSpan: [
|
||||||
TextSpan(text: AppLocalizations.of(context).messageConfirmationLogout),
|
TextSpan(text: AppLocalizations.of(context).messageConfirmationLogout),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: ' $userAddress',
|
text: ' $userAddress',
|
||||||
style: ThemeUtils.textStyleBodyBody2(
|
style: ThemeUtils.textStyleM3BodyMedium1.copyWith(
|
||||||
color: AppColor.steelGray400,
|
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -33,20 +33,13 @@ mixin MessageDialogActionMixin {
|
|||||||
bool usePopScope = false,
|
bool usePopScope = false,
|
||||||
List<TextSpan>? listTextSpan,
|
List<TextSpan>? listTextSpan,
|
||||||
Widget? icon,
|
Widget? icon,
|
||||||
TextStyle? titleStyle,
|
|
||||||
TextStyle? messageStyle,
|
|
||||||
TextStyle? actionStyle,
|
|
||||||
TextStyle? cancelStyle,
|
|
||||||
Color? actionButtonColor,
|
Color? actionButtonColor,
|
||||||
Color? cancelButtonColor,
|
Color? cancelButtonColor,
|
||||||
Color? cancelLabelButtonColor,
|
Color? cancelLabelButtonColor,
|
||||||
Color? confirmLabelButtonColor,
|
Color? confirmLabelButtonColor,
|
||||||
EdgeInsetsGeometry? marginIcon,
|
|
||||||
EdgeInsetsGeometry? paddingButton,
|
|
||||||
PopInvokedWithResultCallback? onPopInvoked,
|
PopInvokedWithResultCallback? onPopInvoked,
|
||||||
bool isArrangeActionButtonsVertical = false,
|
bool isArrangeActionButtonsVertical = false,
|
||||||
int? titleActionButtonMaxLines,
|
bool useIconAsBasicLogo = false,
|
||||||
bool useIconAsBasicLogo = true,
|
|
||||||
EdgeInsetsGeometry? dialogMargin,
|
EdgeInsetsGeometry? dialogMargin,
|
||||||
}
|
}
|
||||||
) async {
|
) async {
|
||||||
@@ -59,7 +52,6 @@ mixin MessageDialogActionMixin {
|
|||||||
key: key,
|
key: key,
|
||||||
imagePath: imagePaths,
|
imagePath: imagePaths,
|
||||||
listTextSpan: listTextSpan,
|
listTextSpan: listTextSpan,
|
||||||
titleActionButtonMaxLines: titleActionButtonMaxLines,
|
|
||||||
isArrangeActionButtonsVertical: isArrangeActionButtonsVertical,
|
isArrangeActionButtonsVertical: isArrangeActionButtonsVertical,
|
||||||
useIconAsBasicLogo: useIconAsBasicLogo,
|
useIconAsBasicLogo: useIconAsBasicLogo,
|
||||||
title: title ?? '',
|
title: title ?? '',
|
||||||
@@ -71,12 +63,6 @@ mixin MessageDialogActionMixin {
|
|||||||
confirmBackgroundButtonColor: actionButtonColor,
|
confirmBackgroundButtonColor: actionButtonColor,
|
||||||
cancelLabelButtonColor: cancelLabelButtonColor,
|
cancelLabelButtonColor: cancelLabelButtonColor,
|
||||||
confirmLabelButtonColor: confirmLabelButtonColor,
|
confirmLabelButtonColor: confirmLabelButtonColor,
|
||||||
styleTextCancelButton: cancelStyle,
|
|
||||||
styleTextConfirmButton: actionStyle,
|
|
||||||
styleTitle: titleStyle,
|
|
||||||
styleContent: messageStyle,
|
|
||||||
paddingButton: paddingButton,
|
|
||||||
marginIcon: marginIcon,
|
|
||||||
onConfirmButtonAction: () {
|
onConfirmButtonAction: () {
|
||||||
if (autoPerformPopBack) {
|
if (autoPerformPopBack) {
|
||||||
popBack();
|
popBack();
|
||||||
@@ -108,21 +94,15 @@ mixin MessageDialogActionMixin {
|
|||||||
showAsBottomSheet: true,
|
showAsBottomSheet: true,
|
||||||
listTextSpan: listTextSpan,
|
listTextSpan: listTextSpan,
|
||||||
maxWidth: responsiveUtils.getSizeScreenShortestSide(context) - 16,
|
maxWidth: responsiveUtils.getSizeScreenShortestSide(context) - 16,
|
||||||
titleActionButtonMaxLines: titleActionButtonMaxLines,
|
|
||||||
isArrangeActionButtonsVertical: isArrangeActionButtonsVertical,
|
isArrangeActionButtonsVertical: isArrangeActionButtonsVertical,
|
||||||
textContent: message,
|
textContent: message,
|
||||||
title: title ?? '',
|
title: title ?? '',
|
||||||
iconWidget: icon,
|
iconWidget: icon,
|
||||||
margin: dialogMargin,
|
margin: dialogMargin,
|
||||||
widthDialog: responsiveUtils.getSizeScreenWidth(context),
|
|
||||||
confirmBackgroundButtonColor: actionButtonColor,
|
confirmBackgroundButtonColor: actionButtonColor,
|
||||||
cancelBackgroundButtonColor: cancelButtonColor,
|
cancelBackgroundButtonColor: cancelButtonColor,
|
||||||
cancelLabelButtonColor: cancelLabelButtonColor,
|
cancelLabelButtonColor: cancelLabelButtonColor,
|
||||||
confirmLabelButtonColor: confirmLabelButtonColor,
|
confirmLabelButtonColor: confirmLabelButtonColor,
|
||||||
styleContent: messageStyle,
|
|
||||||
styleTitle: titleStyle,
|
|
||||||
styleTextCancelButton: cancelStyle,
|
|
||||||
styleTextConfirmButton: actionStyle,
|
|
||||||
confirmText: actionName,
|
confirmText: actionName,
|
||||||
cancelText: hasCancelButton ? cancelTitle ?? AppLocalizations.of(context).cancel : '',
|
cancelText: hasCancelButton ? cancelTitle ?? AppLocalizations.of(context).cancel : '',
|
||||||
useIconAsBasicLogo: useIconAsBasicLogo,
|
useIconAsBasicLogo: useIconAsBasicLogo,
|
||||||
@@ -151,15 +131,12 @@ mixin MessageDialogActionMixin {
|
|||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
isDismissible: outsideDismissible,
|
isDismissible: outsideDismissible,
|
||||||
enableDrag: true,
|
enableDrag: true,
|
||||||
ignoreSafeArea: false,
|
ignoreSafeArea: true,
|
||||||
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(18))),
|
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(18))),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return (ConfirmationDialogActionSheetBuilder(context, listTextSpan: listTextSpan)
|
return (ConfirmationDialogActionSheetBuilder(context, listTextSpan: listTextSpan)
|
||||||
..messageText(message)
|
..messageText(message)
|
||||||
..styleConfirmButton(actionStyle)
|
|
||||||
..styleMessage(messageStyle)
|
|
||||||
..styleCancelButton(cancelStyle)
|
|
||||||
..onCancelAction(
|
..onCancelAction(
|
||||||
cancelTitle ?? AppLocalizations.of(context).cancel,
|
cancelTitle ?? AppLocalizations.of(context).cancel,
|
||||||
() {
|
() {
|
||||||
@@ -182,7 +159,6 @@ mixin MessageDialogActionMixin {
|
|||||||
key: key,
|
key: key,
|
||||||
imagePath: imagePaths,
|
imagePath: imagePaths,
|
||||||
listTextSpan: listTextSpan,
|
listTextSpan: listTextSpan,
|
||||||
titleActionButtonMaxLines: titleActionButtonMaxLines,
|
|
||||||
isArrangeActionButtonsVertical: isArrangeActionButtonsVertical,
|
isArrangeActionButtonsVertical: isArrangeActionButtonsVertical,
|
||||||
useIconAsBasicLogo: useIconAsBasicLogo,
|
useIconAsBasicLogo: useIconAsBasicLogo,
|
||||||
title: title ?? '',
|
title: title ?? '',
|
||||||
@@ -192,10 +168,6 @@ mixin MessageDialogActionMixin {
|
|||||||
cancelBackgroundButtonColor: cancelButtonColor,
|
cancelBackgroundButtonColor: cancelButtonColor,
|
||||||
cancelLabelButtonColor: cancelLabelButtonColor,
|
cancelLabelButtonColor: cancelLabelButtonColor,
|
||||||
confirmLabelButtonColor: confirmLabelButtonColor,
|
confirmLabelButtonColor: confirmLabelButtonColor,
|
||||||
styleContent: messageStyle,
|
|
||||||
styleTitle: titleStyle,
|
|
||||||
styleTextCancelButton: cancelStyle,
|
|
||||||
styleTextConfirmButton: actionStyle,
|
|
||||||
confirmText: actionName,
|
confirmText: actionName,
|
||||||
cancelText: hasCancelButton ? cancelTitle ?? AppLocalizations.of(context).cancel : '',
|
cancelText: hasCancelButton ? cancelTitle ?? AppLocalizations.of(context).cancel : '',
|
||||||
onConfirmButtonAction: () {
|
onConfirmButtonAction: () {
|
||||||
|
|||||||
@@ -784,6 +784,7 @@ class ComposerController extends BaseController
|
|||||||
title: AppLocalizations.of(context).sending_failed,
|
title: AppLocalizations.of(context).sending_failed,
|
||||||
hasCancelButton: false,
|
hasCancelButton: false,
|
||||||
showAsBottomSheet: true,
|
showAsBottomSheet: true,
|
||||||
|
dialogMargin: MediaQuery.paddingOf(context).add(const EdgeInsets.only(bottom: 12)),
|
||||||
).whenComplete(() => _sendButtonState = ButtonState.enabled);
|
).whenComplete(() => _sendButtonState = ButtonState.enabled);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -804,7 +805,8 @@ class ComposerController extends BaseController
|
|||||||
},
|
},
|
||||||
showAsBottomSheet: true,
|
showAsBottomSheet: true,
|
||||||
title: AppLocalizations.of(context).sending_failed,
|
title: AppLocalizations.of(context).sending_failed,
|
||||||
hasCancelButton: false
|
hasCancelButton: false,
|
||||||
|
dialogMargin: MediaQuery.paddingOf(context).add(const EdgeInsets.only(bottom: 12)),
|
||||||
).whenComplete(() => _sendButtonState = ButtonState.enabled);
|
).whenComplete(() => _sendButtonState = ButtonState.enabled);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -819,6 +821,7 @@ class ComposerController extends BaseController
|
|||||||
autoPerformPopBack: false,
|
autoPerformPopBack: false,
|
||||||
title: AppLocalizations.of(context).empty_subject,
|
title: AppLocalizations.of(context).empty_subject,
|
||||||
showAsBottomSheet: true,
|
showAsBottomSheet: true,
|
||||||
|
dialogMargin: MediaQuery.paddingOf(context).add(const EdgeInsets.only(bottom: 12)),
|
||||||
).whenComplete(() => _sendButtonState = ButtonState.enabled);
|
).whenComplete(() => _sendButtonState = ButtonState.enabled);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -830,7 +833,8 @@ class ComposerController extends BaseController
|
|||||||
AppLocalizations.of(context).got_it,
|
AppLocalizations.of(context).got_it,
|
||||||
title: AppLocalizations.of(context).sending_failed,
|
title: AppLocalizations.of(context).sending_failed,
|
||||||
showAsBottomSheet: true,
|
showAsBottomSheet: true,
|
||||||
hasCancelButton: false
|
hasCancelButton: false,
|
||||||
|
dialogMargin: MediaQuery.paddingOf(context).add(const EdgeInsets.only(bottom: 12)),
|
||||||
).whenComplete(() => _sendButtonState = ButtonState.enabled);
|
).whenComplete(() => _sendButtonState = ButtonState.enabled);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1933,7 +1937,6 @@ class ComposerController extends BaseController
|
|||||||
alignCenter: true,
|
alignCenter: true,
|
||||||
outsideDismissible: false,
|
outsideDismissible: false,
|
||||||
autoPerformPopBack: false,
|
autoPerformPopBack: false,
|
||||||
titleActionButtonMaxLines: 1,
|
|
||||||
isArrangeActionButtonsVertical: true,
|
isArrangeActionButtonsVertical: true,
|
||||||
usePopScope: true,
|
usePopScope: true,
|
||||||
onConfirmAction: () => _handleSaveMessageToDraft(context),
|
onConfirmAction: () => _handleSaveMessageToDraft(context),
|
||||||
|
|||||||
@@ -1968,14 +1968,13 @@ class SingleEmailController extends BaseController with AppLoaderMixin {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
showAsBottomSheet: true,
|
showAsBottomSheet: true,
|
||||||
|
dialogMargin: MediaQuery.paddingOf(context).add(const EdgeInsets.only(bottom: 12)),
|
||||||
title: AppLocalizations.of(context).unsubscribeMail,
|
title: AppLocalizations.of(context).unsubscribeMail,
|
||||||
messageStyle: ThemeUtils.textStyleBodyBody2(color: AppColor.steelGray400),
|
|
||||||
listTextSpan: [
|
listTextSpan: [
|
||||||
TextSpan(text: AppLocalizations.of(context).unsubscribeMailDialogMessage),
|
TextSpan(text: AppLocalizations.of(context).unsubscribeMailDialogMessage),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: ' ${presentationEmail.getSenderName()}',
|
text: ' ${presentationEmail.getSenderName()}',
|
||||||
style: ThemeUtils.textStyleBodyBody2(
|
style: ThemeUtils.textStyleM3BodyMedium1.copyWith(
|
||||||
color: AppColor.steelGray400,
|
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -127,6 +127,7 @@ class ForwardController extends BaseController {
|
|||||||
cancelTitle: AppLocalizations.of(context).remove,
|
cancelTitle: AppLocalizations.of(context).remove,
|
||||||
onCancelAction: () => _handleDeleteRecipientAction({emailAddress}),
|
onCancelAction: () => _handleDeleteRecipientAction({emailAddress}),
|
||||||
showAsBottomSheet: true,
|
showAsBottomSheet: true,
|
||||||
|
dialogMargin: MediaQuery.paddingOf(context).add(const EdgeInsets.only(bottom: 12)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -210,6 +211,7 @@ class ForwardController extends BaseController {
|
|||||||
cancelTitle: AppLocalizations.of(context).remove,
|
cancelTitle: AppLocalizations.of(context).remove,
|
||||||
onCancelAction: () => _handleDeleteRecipientAction(listEmailAddress),
|
onCancelAction: () => _handleDeleteRecipientAction(listEmailAddress),
|
||||||
showAsBottomSheet: true,
|
showAsBottomSheet: true,
|
||||||
|
dialogMargin: MediaQuery.paddingOf(context).add(const EdgeInsets.only(bottom: 12)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
-3
@@ -32,7 +32,6 @@ class DeleteIdentityDialogBuilder extends StatelessWidget {
|
|||||||
appLocalizations: appLocalizations,
|
appLocalizations: appLocalizations,
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
outsideDialogPadding: EdgeInsets.only(bottom: PlatformInfo.isWeb ? 42 : 16),
|
outsideDialogPadding: EdgeInsets.only(bottom: PlatformInfo.isWeb ? 42 : 16),
|
||||||
widthDialog: MediaQuery.of(context).size.width - 16,
|
|
||||||
),
|
),
|
||||||
landscapeMobile: _buildDeleteDialog(appLocalizations: appLocalizations),
|
landscapeMobile: _buildDeleteDialog(appLocalizations: appLocalizations),
|
||||||
tablet: _buildDeleteDialog(appLocalizations: appLocalizations),
|
tablet: _buildDeleteDialog(appLocalizations: appLocalizations),
|
||||||
@@ -50,7 +49,6 @@ class DeleteIdentityDialogBuilder extends StatelessWidget {
|
|||||||
required AppLocalizations appLocalizations,
|
required AppLocalizations appLocalizations,
|
||||||
Alignment? alignment,
|
Alignment? alignment,
|
||||||
EdgeInsets? outsideDialogPadding,
|
EdgeInsets? outsideDialogPadding,
|
||||||
double? widthDialog,
|
|
||||||
}) {
|
}) {
|
||||||
return ConfirmationDialogBuilder(
|
return ConfirmationDialogBuilder(
|
||||||
key: const Key('confirm_dialog_delete_identity'),
|
key: const Key('confirm_dialog_delete_identity'),
|
||||||
@@ -61,7 +59,6 @@ class DeleteIdentityDialogBuilder extends StatelessWidget {
|
|||||||
confirmText: appLocalizations.cancel,
|
confirmText: appLocalizations.cancel,
|
||||||
alignment: alignment,
|
alignment: alignment,
|
||||||
outsideDialogPadding: outsideDialogPadding,
|
outsideDialogPadding: outsideDialogPadding,
|
||||||
widthDialog: widthDialog,
|
|
||||||
onCancelButtonAction: onDeleteIdentityAction,
|
onCancelButtonAction: onDeleteIdentityAction,
|
||||||
onConfirmButtonAction: popBack,
|
onConfirmButtonAction: popBack,
|
||||||
onCloseButtonAction: popBack,
|
onCloseButtonAction: popBack,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import 'package:core/presentation/extensions/color_extension.dart';
|
|
||||||
import 'package:core/presentation/extensions/either_view_state_extension.dart';
|
import 'package:core/presentation/extensions/either_view_state_extension.dart';
|
||||||
|
import 'package:core/presentation/utils/theme_utils.dart';
|
||||||
import 'package:core/utils/string_convert.dart';
|
import 'package:core/utils/string_convert.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -127,19 +127,11 @@ mixin OpenAppDeepLinkHandlerMixin on MessageDialogActionMixin {
|
|||||||
title: appLocalizations.switchAccountConfirmation,
|
title: appLocalizations.switchAccountConfirmation,
|
||||||
alignCenter: true,
|
alignCenter: true,
|
||||||
outsideDismissible: false,
|
outsideDismissible: false,
|
||||||
titleActionButtonMaxLines: 1,
|
|
||||||
messageStyle: const TextStyle(
|
|
||||||
color: AppColor.colorTextBody,
|
|
||||||
fontSize: 15,
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
),
|
|
||||||
listTextSpan: [
|
listTextSpan: [
|
||||||
TextSpan(text: appLocalizations.youAreCurrentlyLoggedInWith),
|
TextSpan(text: appLocalizations.youAreCurrentlyLoggedInWith),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: ' $currentUsername',
|
text: ' $currentUsername',
|
||||||
style: const TextStyle(
|
style: ThemeUtils.textStyleM3BodyMedium1.copyWith(
|
||||||
color: AppColor.colorTextBody,
|
|
||||||
fontSize: 15,
|
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -147,9 +139,7 @@ mixin OpenAppDeepLinkHandlerMixin on MessageDialogActionMixin {
|
|||||||
TextSpan(text: appLocalizations.doYouWantToLogOutAndSwitchTo),
|
TextSpan(text: appLocalizations.doYouWantToLogOutAndSwitchTo),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: ' $newUsername',
|
text: ' $newUsername',
|
||||||
style: const TextStyle(
|
style: ThemeUtils.textStyleM3BodyMedium1.copyWith(
|
||||||
color: AppColor.colorTextBody,
|
|
||||||
fontSize: 15,
|
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user