TF-2116 Add RequestReadReceipt and more option
(cherry picked from commit 5f9eb6b9c78239ffb586eea98feaf3e6c30981f9)
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M10.2169 12.1327L10.7011 12.2574L10.2169 12.1328C10.0792 12.668 10.4014 13.2135 10.9366 13.3513L11.0612 12.8671L10.9366 13.3513C11.1006 13.3935 11.2656 13.3925 11.4195 13.3555C11.2882 13.5686 11.1754 13.8353 11.128 14.1666C11.0854 14.4648 11.179 14.7511 11.3615 14.9625C11.1383 15.1682 10.9985 15.4631 10.9985 15.7905C10.9985 16.4123 11.5026 16.9164 12.1243 16.9164C12.7461 16.9164 13.2502 16.4123 13.2502 15.7905C13.2502 15.46 13.1077 15.1627 12.8809 14.9567C12.9996 14.8175 13.0815 14.6442 13.1093 14.4497C13.1126 14.4263 13.1161 14.4175 13.1168 14.416L13.1168 14.4159C13.1173 14.4147 13.1191 14.4102 13.1273 14.3991C13.1373 14.3855 13.1551 14.3643 13.1896 14.3294C13.2248 14.2938 13.268 14.2531 13.3281 14.1971C13.5829 13.9593 14.0823 13.4928 14.0823 12.6229C14.0823 11.5384 13.2032 10.6593 12.1187 10.6593C11.2019 10.6593 10.4348 11.2864 10.2169 12.1327ZM11.9995 10.345C13.9009 10.345 15.4424 11.8864 15.4424 13.7878C15.4424 15.6893 13.9009 17.2307 11.9995 17.2307C10.0981 17.2307 8.55664 15.6893 8.55664 13.7878C8.55664 11.8864 10.0981 10.345 11.9995 10.345Z"
|
||||
fill="#007AFF" stroke="#007AFF" />
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M18.6861 21.4287H5.31564C3.80267 21.4287 2.57234 20.2081 2.57234 18.7078V10.5194C2.56634 9.72157 2.94628 8.9922 3.52367 8.46551L10.3005 3.15913C11.3016 2.37626 12.7002 2.37507 13.7012 3.15913C13.7012 3.15913 20.5444 8.54078 20.5894 8.56353C21.1229 9.06839 21.4294 9.78116 21.4294 10.5194V18.7078C21.4294 20.2081 20.199 21.4287 18.6861 21.4287ZM12.5613 4.59172C12.232 4.33275 11.7698 4.33275 11.4405 4.59172L5.57787 9.18126L7.12519 10.3941L4.41157 10.5927V18.7078C4.41157 19.2019 4.81688 19.604 5.31564 19.604H18.6861C19.1848 19.604 19.5902 19.2019 19.5902 18.7078V10.5927L18.0071 11.8383L16.8763 10.3941L18.4239 9.18125L12.5613 4.59172Z"
|
||||
fill="#007AFF" />
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M19.5902 10.5927L18.0071 11.8383C17.6083 12.1506 17.0318 12.0804 16.7196 11.6816C16.4073 11.2828 16.4775 10.7063 16.8763 10.3941L18.4239 9.18125L19.5902 10.5927Z"
|
||||
fill="#007AFF" />
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M4.41157 10.5927L5.99437 11.8383C6.39319 12.1506 6.96964 12.0804 7.2819 11.6816C7.59417 11.2828 7.52401 10.7063 7.12519 10.3941L4.41157 10.5927Z"
|
||||
fill="#007AFF" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.4 KiB |
@@ -202,6 +202,7 @@ class ImagePaths {
|
||||
String get icAttachmentFile => _getImagePath('ic_attachment_file.svg');
|
||||
String get icAttachFile => _getImagePath('ic_attach_file.svg');
|
||||
String get icSend => _getImagePath('ic_send.svg');
|
||||
String get icReadReceipt => _getImagePath('ic_read_receipt.svg');
|
||||
|
||||
String _getImagePath(String imageName) {
|
||||
return AssetsPaths.images + imageName;
|
||||
|
||||
@@ -16,14 +16,24 @@ mixin PopupContextMenuActionMixin {
|
||||
.show();
|
||||
}
|
||||
|
||||
void openPopupMenuAction(BuildContext context, RelativeRect? position, List<PopupMenuEntry> popupMenuItems) async {
|
||||
void openPopupMenuAction(
|
||||
BuildContext context,
|
||||
RelativeRect? position,
|
||||
List<PopupMenuEntry> popupMenuItems,
|
||||
{
|
||||
double? radius,
|
||||
}
|
||||
) async {
|
||||
await showMenu(
|
||||
context: context,
|
||||
position: position ?? const RelativeRect.fromLTRB(16, 40, 16, 16),
|
||||
color: Colors.white,
|
||||
elevation: 4,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
||||
items: popupMenuItems);
|
||||
context: context,
|
||||
position: position ?? const RelativeRect.fromLTRB(16, 40, 16, 16),
|
||||
color: Colors.white,
|
||||
elevation: 4,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(radius ?? 16))
|
||||
),
|
||||
items: popupMenuItems
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildCancelButton(BuildContext context) {
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class PopupItemWidgetStyle {
|
||||
static const double iconSize = 20;
|
||||
static const double selectedIconSize = 16;
|
||||
static const double space = 12;
|
||||
static const double height = 48;
|
||||
|
||||
static const EdgeInsetsGeometry padding = EdgeInsets.symmetric(horizontal: 20, vertical: 16);
|
||||
static const EdgeInsetsGeometry iconSelectedPadding = EdgeInsetsDirectional.only(start: 12);
|
||||
|
||||
static const TextStyle labelTextStyle = TextStyle(
|
||||
fontSize: 17,
|
||||
fontWeight: FontWeight.normal,
|
||||
color: Colors.black
|
||||
);
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
import 'package:core/core.dart';
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:pointer_interceptor/pointer_interceptor.dart';
|
||||
import 'package:tmail_ui_user/features/base/styles/popup_item_widget_style.dart';
|
||||
|
||||
class PopupItemWidget extends StatelessWidget {
|
||||
|
||||
@@ -11,7 +11,9 @@ class PopupItemWidget extends StatelessWidget {
|
||||
final Color? colorIcon;
|
||||
final double? iconSize;
|
||||
final TextStyle? styleName;
|
||||
final EdgeInsets? padding;
|
||||
final bool? isSelected;
|
||||
final String? selectedIcon;
|
||||
final EdgeInsetsGeometry? padding;
|
||||
final VoidCallback? onCallbackAction;
|
||||
|
||||
const PopupItemWidget(
|
||||
@@ -22,7 +24,9 @@ class PopupItemWidget extends StatelessWidget {
|
||||
this.colorIcon,
|
||||
this.iconSize,
|
||||
this.styleName,
|
||||
this.isSelected,
|
||||
this.padding,
|
||||
this.selectedIcon,
|
||||
this.onCallbackAction
|
||||
}
|
||||
) : super(key: key);
|
||||
@@ -32,28 +36,33 @@ class PopupItemWidget extends StatelessWidget {
|
||||
return PointerInterceptor(
|
||||
child: InkWell(
|
||||
onTap: onCallbackAction,
|
||||
child: Padding(
|
||||
padding: padding ?? const EdgeInsets.symmetric(horizontal: 20, vertical: 16),
|
||||
child: SizedBox(
|
||||
child: Row(children: [
|
||||
SvgPicture.asset(
|
||||
_iconAction,
|
||||
width: iconSize ?? 20,
|
||||
height: iconSize ?? 20,
|
||||
fit: BoxFit.fill,
|
||||
colorFilter: colorIcon.asFilter()
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(child: Text(
|
||||
_nameAction,
|
||||
style: styleName ?? const TextStyle(
|
||||
fontSize: 17,
|
||||
fontWeight: FontWeight.normal,
|
||||
color: Colors.black
|
||||
)
|
||||
)),
|
||||
])
|
||||
),
|
||||
child: Container(
|
||||
height: PopupItemWidgetStyle.height,
|
||||
padding: padding,
|
||||
child: Row(children: [
|
||||
SvgPicture.asset(
|
||||
_iconAction,
|
||||
width: iconSize ?? PopupItemWidgetStyle.iconSize,
|
||||
height: iconSize ?? PopupItemWidgetStyle.iconSize,
|
||||
fit: BoxFit.fill,
|
||||
colorFilter: colorIcon?.asFilter()
|
||||
),
|
||||
const SizedBox(width: PopupItemWidgetStyle.space),
|
||||
Expanded(child: Text(
|
||||
_nameAction,
|
||||
style: styleName ?? PopupItemWidgetStyle.labelTextStyle
|
||||
)),
|
||||
if (isSelected == true && selectedIcon != null)
|
||||
Padding(
|
||||
padding: PopupItemWidgetStyle.iconSelectedPadding,
|
||||
child: SvgPicture.asset(
|
||||
selectedIcon!,
|
||||
width: PopupItemWidgetStyle.selectedIconSize,
|
||||
height: PopupItemWidgetStyle.selectedIconSize,
|
||||
fit: BoxFit.fill
|
||||
),
|
||||
)
|
||||
]),
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:model/email/prefix_email_address.dart';
|
||||
import 'package:tmail_ui_user/features/base/widget/popup_item_widget.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/composer_controller.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/model/prefix_recipient_state.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/styles/composer_style.dart';
|
||||
@@ -22,6 +23,7 @@ import 'package:tmail_ui_user/features/composer/presentation/widgets/recipient_c
|
||||
import 'package:tmail_ui_user/features/composer/presentation/widgets/subject_composer_widget.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/widgets/web/desktop_app_bar_composer_widget.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
import 'package:tmail_ui_user/main/routes/route_navigation.dart';
|
||||
|
||||
class ComposerView extends GetWidget<ComposerController> {
|
||||
|
||||
@@ -59,14 +61,28 @@ class ComposerView extends GetWidget<ComposerController> {
|
||||
isSendButtonEnabled: controller.isEnableEmailSendButton.value,
|
||||
onCloseViewAction: () => controller.saveToDraftAndClose(context),
|
||||
sendMessageAction: () => controller.sendEmailAction(context),
|
||||
openContextMenuAction: () => {},
|
||||
openContextMenuAction: (position) {
|
||||
controller.openPopupMenuAction(
|
||||
context,
|
||||
position,
|
||||
_createMoreOptionPopupItems(context),
|
||||
radius: ComposerStyle.popupMenuRadius
|
||||
);
|
||||
},
|
||||
))
|
||||
else
|
||||
Obx(() => AppBarComposerWidget(
|
||||
isSendButtonEnabled: controller.isEnableEmailSendButton.value,
|
||||
onCloseViewAction: () => controller.saveToDraftAndClose(context),
|
||||
sendMessageAction: () => controller.sendEmailAction(context),
|
||||
openContextMenuAction: () => {},
|
||||
openContextMenuAction: (position) {
|
||||
controller.openPopupMenuAction(
|
||||
context,
|
||||
position,
|
||||
_createMoreOptionPopupItems(context),
|
||||
radius: ComposerStyle.popupMenuRadius
|
||||
);
|
||||
},
|
||||
)),
|
||||
Expanded(
|
||||
child: SafeArea(
|
||||
@@ -317,6 +333,14 @@ class ComposerView extends GetWidget<ComposerController> {
|
||||
deleteComposerAction: () => controller.closeComposer(context),
|
||||
saveToDraftAction: () => controller.saveToDraftAction(context),
|
||||
sendMessageAction: () => controller.sendEmailAction(context),
|
||||
requestReadReceiptAction: (position) {
|
||||
controller.openPopupMenuAction(
|
||||
context,
|
||||
position,
|
||||
_createReadReceiptPopupItems(context),
|
||||
radius: ComposerStyle.popupMenuRadius
|
||||
);
|
||||
},
|
||||
),
|
||||
]
|
||||
)
|
||||
@@ -350,4 +374,72 @@ class ComposerView extends GetWidget<ComposerController> {
|
||||
..onActionClick((_) => controller.openFilePickerByType(context, FileType.any)))
|
||||
.build();
|
||||
}
|
||||
|
||||
List<PopupMenuEntry> _createReadReceiptPopupItems(BuildContext context) {
|
||||
return [
|
||||
PopupMenuItem(
|
||||
padding: EdgeInsets.zero,
|
||||
child: PopupItemWidget(
|
||||
_imagePaths.icReadReceipt,
|
||||
AppLocalizations.of(context).requestReadReceipt,
|
||||
styleName: ComposerStyle.popupItemTextStyle,
|
||||
padding: ComposerStyle.popupItemPadding,
|
||||
selectedIcon: _imagePaths.icFilterSelected,
|
||||
isSelected: controller.hasRequestReadReceipt.value,
|
||||
onCallbackAction: () {
|
||||
popBack();
|
||||
controller.toggleRequestReadReceipt();
|
||||
}
|
||||
)
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
List<PopupMenuEntry> _createMoreOptionPopupItems(BuildContext context) {
|
||||
return [
|
||||
PopupMenuItem(
|
||||
padding: EdgeInsets.zero,
|
||||
child: PopupItemWidget(
|
||||
_imagePaths.icReadReceipt,
|
||||
AppLocalizations.of(context).requestReadReceipt,
|
||||
styleName: ComposerStyle.popupItemTextStyle,
|
||||
padding: ComposerStyle.popupItemPadding,
|
||||
colorIcon: ComposerStyle.popupItemIconColor,
|
||||
selectedIcon: _imagePaths.icFilterSelected,
|
||||
isSelected: controller.hasRequestReadReceipt.value,
|
||||
onCallbackAction: () {
|
||||
popBack();
|
||||
controller.toggleRequestReadReceipt();
|
||||
}
|
||||
)
|
||||
),
|
||||
PopupMenuItem(
|
||||
padding: EdgeInsets.zero,
|
||||
child: PopupItemWidget(
|
||||
_imagePaths.icSaveToDraft,
|
||||
AppLocalizations.of(context).saveAsDraft,
|
||||
colorIcon: ComposerStyle.popupItemIconColor,
|
||||
styleName: ComposerStyle.popupItemTextStyle,
|
||||
padding: ComposerStyle.popupItemPadding,
|
||||
onCallbackAction: () {
|
||||
popBack();
|
||||
controller.saveToDraftAction(context);
|
||||
}
|
||||
)
|
||||
),
|
||||
PopupMenuItem(
|
||||
padding: EdgeInsets.zero,
|
||||
child: PopupItemWidget(
|
||||
_imagePaths.icDeleteMailbox,
|
||||
AppLocalizations.of(context).delete,
|
||||
styleName: ComposerStyle.popupItemTextStyle,
|
||||
padding: ComposerStyle.popupItemPadding,
|
||||
onCallbackAction: () {
|
||||
popBack();
|
||||
controller.closeComposer(context);
|
||||
},
|
||||
)
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||
import 'package:core/presentation/views/responsive/responsive_widget.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:model/email/prefix_email_address.dart';
|
||||
import 'package:tmail_ui_user/features/base/widget/popup_item_widget.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/composer_controller.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/model/prefix_recipient_state.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/styles/composer_style.dart';
|
||||
@@ -18,10 +20,13 @@ import 'package:tmail_ui_user/features/composer/presentation/widgets/web/mobile_
|
||||
import 'package:tmail_ui_user/features/composer/presentation/widgets/recipient_composer_widget.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/widgets/subject_composer_widget.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/widgets/web/toolbar_rich_text_builder.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
import 'package:tmail_ui_user/main/routes/route_navigation.dart';
|
||||
|
||||
class ComposerView extends GetWidget<ComposerController> {
|
||||
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
ComposerView({Key? key}) : super(key: key);
|
||||
|
||||
@@ -43,7 +48,14 @@ class ComposerView extends GetWidget<ComposerController> {
|
||||
attachFileAction: () => controller.openFilePickerByType(context, FileType.any),
|
||||
insertImageAction: () => controller.insertImage(context, constraints.maxWidth),
|
||||
sendMessageAction: () => controller.sendEmailAction(context),
|
||||
openContextMenuAction: () => {},
|
||||
openContextMenuAction: (position) {
|
||||
controller.openPopupMenuAction(
|
||||
context,
|
||||
position,
|
||||
_createMoreOptionPopupItems(context),
|
||||
radius: ComposerStyle.popupMenuRadius
|
||||
);
|
||||
},
|
||||
)),
|
||||
ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
@@ -340,6 +352,14 @@ class ComposerView extends GetWidget<ComposerController> {
|
||||
deleteComposerAction: () => controller.closeComposer(context),
|
||||
saveToDraftAction: () => controller.saveToDraftAction(context),
|
||||
sendMessageAction: () => controller.sendEmailAction(context),
|
||||
requestReadReceiptAction: (position) {
|
||||
controller.openPopupMenuAction(
|
||||
context,
|
||||
position,
|
||||
_createReadReceiptPopupItems(context),
|
||||
radius: ComposerStyle.popupMenuRadius
|
||||
);
|
||||
},
|
||||
)),
|
||||
]);
|
||||
},
|
||||
@@ -510,10 +530,102 @@ class ComposerView extends GetWidget<ComposerController> {
|
||||
deleteComposerAction: () => controller.closeComposer(context),
|
||||
saveToDraftAction: () => controller.saveToDraftAction(context),
|
||||
sendMessageAction: () => controller.sendEmailAction(context),
|
||||
requestReadReceiptAction: (position) {
|
||||
controller.openPopupMenuAction(
|
||||
context,
|
||||
position,
|
||||
_createReadReceiptPopupItems(context),
|
||||
radius: ComposerStyle.popupMenuRadius
|
||||
);
|
||||
},
|
||||
)),
|
||||
]);
|
||||
},
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
List<PopupMenuEntry> _createReadReceiptPopupItems(BuildContext context) {
|
||||
return [
|
||||
PopupMenuItem(
|
||||
padding: EdgeInsets.zero,
|
||||
child: PopupItemWidget(
|
||||
_imagePaths.icReadReceipt,
|
||||
AppLocalizations.of(context).requestReadReceipt,
|
||||
styleName: ComposerStyle.popupItemTextStyle,
|
||||
padding: ComposerStyle.popupItemPadding,
|
||||
selectedIcon: _imagePaths.icFilterSelected,
|
||||
isSelected: controller.hasRequestReadReceipt.value,
|
||||
onCallbackAction: () {
|
||||
popBack();
|
||||
controller.toggleRequestReadReceipt();
|
||||
}
|
||||
)
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
List<PopupMenuEntry> _createMoreOptionPopupItems(BuildContext context) {
|
||||
return [
|
||||
PopupMenuItem(
|
||||
padding: EdgeInsets.zero,
|
||||
child: PopupItemWidget(
|
||||
_imagePaths.icStyleCodeView,
|
||||
AppLocalizations.of(context).embedCode,
|
||||
styleName: ComposerStyle.popupItemTextStyle,
|
||||
colorIcon: ComposerStyle.popupItemIconColor,
|
||||
padding: ComposerStyle.popupItemPadding,
|
||||
selectedIcon: _imagePaths.icFilterSelected,
|
||||
isSelected: controller.richTextWebController.codeViewEnabled,
|
||||
onCallbackAction: () {
|
||||
popBack();
|
||||
controller.richTextWebController.toggleCodeView();
|
||||
}
|
||||
)
|
||||
),
|
||||
PopupMenuItem(
|
||||
padding: EdgeInsets.zero,
|
||||
child: PopupItemWidget(
|
||||
_imagePaths.icReadReceipt,
|
||||
AppLocalizations.of(context).requestReadReceipt,
|
||||
styleName: ComposerStyle.popupItemTextStyle,
|
||||
padding: ComposerStyle.popupItemPadding,
|
||||
colorIcon: ComposerStyle.popupItemIconColor,
|
||||
selectedIcon: _imagePaths.icFilterSelected,
|
||||
isSelected: controller.hasRequestReadReceipt.value,
|
||||
onCallbackAction: () {
|
||||
popBack();
|
||||
controller.toggleRequestReadReceipt();
|
||||
}
|
||||
)
|
||||
),
|
||||
PopupMenuItem(
|
||||
padding: EdgeInsets.zero,
|
||||
child: PopupItemWidget(
|
||||
_imagePaths.icSaveToDraft,
|
||||
AppLocalizations.of(context).saveAsDraft,
|
||||
colorIcon: ComposerStyle.popupItemIconColor,
|
||||
styleName: ComposerStyle.popupItemTextStyle,
|
||||
padding: ComposerStyle.popupItemPadding,
|
||||
onCallbackAction: () {
|
||||
popBack();
|
||||
controller.saveToDraftAction(context);
|
||||
}
|
||||
)
|
||||
),
|
||||
PopupMenuItem(
|
||||
padding: EdgeInsets.zero,
|
||||
child: PopupItemWidget(
|
||||
_imagePaths.icDeleteMailbox,
|
||||
AppLocalizations.of(context).delete,
|
||||
styleName: ComposerStyle.popupItemTextStyle,
|
||||
padding: ComposerStyle.popupItemPadding,
|
||||
onCallbackAction: () {
|
||||
popBack();
|
||||
controller.closeComposer(context);
|
||||
},
|
||||
)
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -8,11 +8,13 @@ class ComposerStyle {
|
||||
static const double radius = 28;
|
||||
static const double keyboardMaxHeight = 500;
|
||||
static const double keyboardToolBarHeight = 200;
|
||||
static const double popupMenuRadius = 8;
|
||||
|
||||
static const Color borderColor = AppColor.colorLineComposer;
|
||||
static const Color backgroundEditorColor = Colors.white;
|
||||
static const Color richToolbarColor = Colors.white;
|
||||
static const Color mobileBackgroundColor = Colors.white;
|
||||
static const Color popupItemIconColor = AppColor.primaryColor;
|
||||
|
||||
static const EdgeInsetsGeometry richToolbarPadding = EdgeInsetsDirectional.symmetric(horizontal: 24, vertical: 8);
|
||||
static const EdgeInsetsGeometry desktopRecipientPadding = EdgeInsetsDirectional.only(end: 24);
|
||||
@@ -30,6 +32,13 @@ class ComposerStyle {
|
||||
static const EdgeInsetsGeometry mobileSubjectMargin = EdgeInsetsDirectional.only(start: 16);
|
||||
static const EdgeInsetsGeometry mobileSubjectPadding = EdgeInsetsDirectional.only(end: 16, top: 12, bottom: 12);
|
||||
static const EdgeInsetsGeometry mobileEditorPadding = EdgeInsetsDirectional.symmetric(horizontal: 12);
|
||||
static const EdgeInsetsGeometry popupItemPadding = EdgeInsetsDirectional.symmetric(horizontal: 12);
|
||||
|
||||
static const TextStyle popupItemTextStyle = TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500
|
||||
);
|
||||
|
||||
static const List<BoxShadow> richToolbarShadow = [
|
||||
BoxShadow(
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:core/presentation/views/button/tmail_button_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/styles/mobile_app_bar_composer_widget_style.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/widgets/web/mobile_responsive_app_bar_composer_widget.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
class AppBarComposerWidget extends StatelessWidget {
|
||||
@@ -10,7 +11,7 @@ class AppBarComposerWidget extends StatelessWidget {
|
||||
final bool isSendButtonEnabled;
|
||||
final VoidCallback onCloseViewAction;
|
||||
final VoidCallback sendMessageAction;
|
||||
final VoidCallback openContextMenuAction;
|
||||
final OnOpenContextMenuAction openContextMenuAction;
|
||||
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
@@ -59,7 +60,7 @@ class AppBarComposerWidget extends StatelessWidget {
|
||||
padding: MobileAppBarComposerWidgetStyle.iconPadding,
|
||||
iconSize: MobileAppBarComposerWidgetStyle.iconSize,
|
||||
tooltipMessage: AppLocalizations.of(context).more,
|
||||
onTapActionCallback: openContextMenuAction,
|
||||
onTapActionAtPositionCallback: openContextMenuAction,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
+3
-2
@@ -3,6 +3,7 @@ import 'package:core/presentation/views/button/tmail_button_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/styles/mobile_app_bar_composer_widget_style.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/widgets/web/mobile_responsive_app_bar_composer_widget.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
class LandscapeAppBarComposerWidget extends StatelessWidget {
|
||||
@@ -10,7 +11,7 @@ class LandscapeAppBarComposerWidget extends StatelessWidget {
|
||||
final bool isSendButtonEnabled;
|
||||
final VoidCallback onCloseViewAction;
|
||||
final VoidCallback sendMessageAction;
|
||||
final VoidCallback openContextMenuAction;
|
||||
final OnOpenContextMenuAction openContextMenuAction;
|
||||
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
@@ -62,7 +63,7 @@ class LandscapeAppBarComposerWidget extends StatelessWidget {
|
||||
padding: MobileAppBarComposerWidgetStyle.iconPadding,
|
||||
iconSize: MobileAppBarComposerWidgetStyle.iconSize,
|
||||
tooltipMessage: AppLocalizations.of(context).more,
|
||||
onTapActionCallback: openContextMenuAction,
|
||||
onTapActionAtPositionCallback: openContextMenuAction,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
+13
-1
@@ -3,6 +3,7 @@ import 'package:core/presentation/views/button/tmail_button_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/styles/mobile/tablet_bottom_bar_composer_widget_style.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/widgets/web/bottom_bar_composer_widget.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
class TabletBottomBarComposerWidget extends StatelessWidget {
|
||||
@@ -10,6 +11,7 @@ class TabletBottomBarComposerWidget extends StatelessWidget {
|
||||
final VoidCallback deleteComposerAction;
|
||||
final VoidCallback saveToDraftAction;
|
||||
final VoidCallback sendMessageAction;
|
||||
final OnRequestReadReceiptAction? requestReadReceiptAction;
|
||||
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
@@ -18,6 +20,7 @@ class TabletBottomBarComposerWidget extends StatelessWidget {
|
||||
required this.deleteComposerAction,
|
||||
required this.saveToDraftAction,
|
||||
required this.sendMessageAction,
|
||||
this.requestReadReceiptAction,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -37,12 +40,21 @@ class TabletBottomBarComposerWidget extends StatelessWidget {
|
||||
onTapActionCallback: deleteComposerAction,
|
||||
),
|
||||
const SizedBox(width: TabletBottomBarComposerWidgetStyle.space),
|
||||
TMailButtonWidget.fromIcon(
|
||||
icon: _imagePaths.icReadReceipt,
|
||||
borderRadius: TabletBottomBarComposerWidgetStyle.iconRadius,
|
||||
padding: TabletBottomBarComposerWidgetStyle.iconPadding,
|
||||
iconSize: TabletBottomBarComposerWidgetStyle.iconSize,
|
||||
tooltipMessage: AppLocalizations.of(context).requestReadReceipt,
|
||||
onTapActionAtPositionCallback: requestReadReceiptAction,
|
||||
),
|
||||
const SizedBox(width: TabletBottomBarComposerWidgetStyle.space),
|
||||
TMailButtonWidget.fromIcon(
|
||||
icon: _imagePaths.icSaveToDraft,
|
||||
borderRadius: TabletBottomBarComposerWidgetStyle.iconRadius,
|
||||
padding: TabletBottomBarComposerWidgetStyle.iconPadding,
|
||||
iconSize: TabletBottomBarComposerWidgetStyle.iconSize,
|
||||
tooltipMessage: AppLocalizations.of(context).save_to_drafts,
|
||||
tooltipMessage: AppLocalizations.of(context).saveAsDraft,
|
||||
onTapActionCallback: saveToDraftAction,
|
||||
),
|
||||
const SizedBox(width: TabletBottomBarComposerWidgetStyle.sendButtonSpace),
|
||||
|
||||
@@ -5,6 +5,8 @@ import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/styles/web/bottom_bar_composer_widget_style.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
typedef OnRequestReadReceiptAction = Function(RelativeRect position);
|
||||
|
||||
class BottomBarComposerWidget extends StatelessWidget {
|
||||
|
||||
final bool isCodeViewEnabled;
|
||||
@@ -16,6 +18,7 @@ class BottomBarComposerWidget extends StatelessWidget {
|
||||
final VoidCallback deleteComposerAction;
|
||||
final VoidCallback saveToDraftAction;
|
||||
final VoidCallback sendMessageAction;
|
||||
final OnRequestReadReceiptAction? requestReadReceiptAction;
|
||||
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
@@ -30,6 +33,7 @@ class BottomBarComposerWidget extends StatelessWidget {
|
||||
required this.deleteComposerAction,
|
||||
required this.saveToDraftAction,
|
||||
required this.sendMessageAction,
|
||||
this.requestReadReceiptAction,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -103,12 +107,21 @@ class BottomBarComposerWidget extends StatelessWidget {
|
||||
onTapActionCallback: deleteComposerAction,
|
||||
),
|
||||
const SizedBox(width: BottomBarComposerWidgetStyle.space),
|
||||
TMailButtonWidget.fromIcon(
|
||||
icon: _imagePaths.icReadReceipt,
|
||||
borderRadius: BottomBarComposerWidgetStyle.iconRadius,
|
||||
padding: BottomBarComposerWidgetStyle.iconPadding,
|
||||
iconSize: BottomBarComposerWidgetStyle.iconSize,
|
||||
tooltipMessage: AppLocalizations.of(context).requestReadReceipt,
|
||||
onTapActionAtPositionCallback: requestReadReceiptAction,
|
||||
),
|
||||
const SizedBox(width: BottomBarComposerWidgetStyle.space),
|
||||
TMailButtonWidget.fromIcon(
|
||||
icon: _imagePaths.icSaveToDraft,
|
||||
borderRadius: BottomBarComposerWidgetStyle.iconRadius,
|
||||
padding: BottomBarComposerWidgetStyle.iconPadding,
|
||||
iconSize: BottomBarComposerWidgetStyle.iconSize,
|
||||
tooltipMessage: AppLocalizations.of(context).save_to_drafts,
|
||||
tooltipMessage: AppLocalizations.of(context).saveAsDraft,
|
||||
onTapActionCallback: saveToDraftAction,
|
||||
),
|
||||
const SizedBox(width: BottomBarComposerWidgetStyle.sendButtonSpace),
|
||||
|
||||
+4
-2
@@ -5,6 +5,8 @@ import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/styles/mobile_app_bar_composer_widget_style.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
typedef OnOpenContextMenuAction = Function(RelativeRect position);
|
||||
|
||||
class MobileResponsiveAppBarComposerWidget extends StatelessWidget {
|
||||
|
||||
final bool isCodeViewEnabled;
|
||||
@@ -14,7 +16,7 @@ class MobileResponsiveAppBarComposerWidget extends StatelessWidget {
|
||||
final VoidCallback attachFileAction;
|
||||
final VoidCallback insertImageAction;
|
||||
final VoidCallback sendMessageAction;
|
||||
final VoidCallback openContextMenuAction;
|
||||
final OnOpenContextMenuAction openContextMenuAction;
|
||||
final VoidCallback openRichToolbarAction;
|
||||
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
@@ -109,7 +111,7 @@ class MobileResponsiveAppBarComposerWidget extends StatelessWidget {
|
||||
padding: MobileAppBarComposerWidgetStyle.iconPadding,
|
||||
iconSize: MobileAppBarComposerWidgetStyle.iconSize,
|
||||
tooltipMessage: AppLocalizations.of(context).more,
|
||||
onTapActionCallback: openContextMenuAction,
|
||||
onTapActionAtPositionCallback: openContextMenuAction,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -504,6 +504,7 @@ class EmailView extends GetWidget<SingleEmailController> {
|
||||
imagePaths.icUnreadEmail,
|
||||
AppLocalizations.of(context).mark_as_unread,
|
||||
colorIcon: AppColor.colorTextButton,
|
||||
padding: const EdgeInsetsDirectional.only(start: 12),
|
||||
styleName: const TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 16,
|
||||
@@ -531,6 +532,7 @@ class EmailView extends GetWidget<SingleEmailController> {
|
||||
? AppLocalizations.of(context).remove_from_spam
|
||||
: AppLocalizations.of(context).mark_as_spam,
|
||||
colorIcon: AppColor.colorTextButton,
|
||||
padding: const EdgeInsetsDirectional.only(start: 12),
|
||||
styleName: const TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 16,
|
||||
@@ -552,6 +554,7 @@ class EmailView extends GetWidget<SingleEmailController> {
|
||||
imagePaths.icQuickCreatingRule,
|
||||
AppLocalizations.of(context).quickCreatingRule,
|
||||
colorIcon: AppColor.colorTextButton,
|
||||
padding: const EdgeInsetsDirectional.only(start: 12),
|
||||
styleName: const TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 16,
|
||||
|
||||
@@ -264,6 +264,7 @@ mixin MailboxWidgetMixin {
|
||||
contextMenuItem.action.getContextMenuIcon(imagePaths),
|
||||
contextMenuItem.action.getTitleContextMenu(context),
|
||||
colorIcon: contextMenuItem.action.getColorContextMenuIcon(),
|
||||
padding: const EdgeInsetsDirectional.only(start: 12),
|
||||
iconSize: 24,
|
||||
styleName: TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"@@last_modified": "2023-09-07T09:30:18.682623",
|
||||
"@@last_modified": "2023-09-07T19:09:09.089986",
|
||||
"initializing_data": "Initializing data...",
|
||||
"@initializing_data": {
|
||||
"type": "text",
|
||||
@@ -3233,5 +3233,11 @@
|
||||
"placeholders": {
|
||||
"count": {}
|
||||
}
|
||||
},
|
||||
"saveAsDraft": "Save as draft",
|
||||
"@saveAsDraft": {
|
||||
"type": "text",
|
||||
"placeholders_order": [],
|
||||
"placeholders": {}
|
||||
}
|
||||
}
|
||||
@@ -3333,4 +3333,11 @@ class AppLocalizations {
|
||||
args: [count]
|
||||
);
|
||||
}
|
||||
|
||||
String get saveAsDraft {
|
||||
return Intl.message(
|
||||
'Save as draft',
|
||||
name: 'saveAsDraft',
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user