TF-1100: Support display answered and forwarded
(cherry picked from commit cb67c81998264efbb75ae4543621a20522f3dbc4)
This commit is contained in:
@@ -14,6 +14,7 @@ import 'package:model/extensions/presentation_email_extension.dart';
|
||||
import 'package:model/mailbox/presentation_mailbox.dart';
|
||||
import 'package:model/mailbox/select_mode.dart';
|
||||
import 'package:tmail_ui_user/features/thread/domain/model/search_query.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
typedef OnPressEmailActionClick = void Function(EmailActionType, PresentationEmail);
|
||||
typedef OnMoreActionClick = void Function(PresentationEmail, RelativeRect?);
|
||||
@@ -274,4 +275,57 @@ mixin BaseEmailItemTile {
|
||||
width: 24, height: 24));
|
||||
}
|
||||
}
|
||||
|
||||
Widget buildIconAnsweredOrForwarded({
|
||||
required PresentationEmail presentationEmail,
|
||||
double? width,
|
||||
double? height
|
||||
}) {
|
||||
if (presentationEmail.isAnsweredAndForwarded) {
|
||||
return _iconAnsweredOrForwardedWidget(
|
||||
iconPath: imagePaths.icReplyAndForward,
|
||||
width: width,
|
||||
height: height
|
||||
);
|
||||
} else if (presentationEmail.isAnswered) {
|
||||
return _iconAnsweredOrForwardedWidget(
|
||||
iconPath: imagePaths.icReply,
|
||||
width: width,
|
||||
height: height
|
||||
);
|
||||
} else if (presentationEmail.isForwarded) {
|
||||
return _iconAnsweredOrForwardedWidget(
|
||||
iconPath: imagePaths.icForwarded,
|
||||
width: width,
|
||||
height: height
|
||||
);
|
||||
} else {
|
||||
return const SizedBox(width: 16, height: 16);
|
||||
}
|
||||
}
|
||||
|
||||
Widget _iconAnsweredOrForwardedWidget({
|
||||
required String iconPath,
|
||||
double? width,
|
||||
double? height
|
||||
}) {
|
||||
return SvgPicture.asset(
|
||||
iconPath,
|
||||
width: width ?? 20,
|
||||
height: height ?? 20,
|
||||
colorFilter: AppColor.colorAttachmentIcon.asFilter(),
|
||||
fit: BoxFit.fill);
|
||||
}
|
||||
|
||||
String? messageToolTipForAnsweredOrForwarded(BuildContext context, PresentationEmail presentationEmail) {
|
||||
if (presentationEmail.isAnsweredAndForwarded) {
|
||||
return AppLocalizations.of(context).repliedAndForwardedMessage;
|
||||
} else if (presentationEmail.isAnswered) {
|
||||
return AppLocalizations.of(context).repliedMessage;
|
||||
} else if (presentationEmail.isForwarded){
|
||||
return AppLocalizations.of(context).forwardedMessage;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,6 +86,7 @@ class EmailTileBuilder with BaseEmailItemTile {
|
||||
mailboxContain,
|
||||
isSearchEmailRunning,
|
||||
_searchQuery)),
|
||||
buildIconAnsweredOrForwarded(width: 16, height: 16, presentationEmail: _presentationEmail),
|
||||
if (_presentationEmail.hasAttachment == true)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8),
|
||||
|
||||
@@ -153,6 +153,7 @@ class EmailTileBuilder with BaseEmailItemTile {
|
||||
isSearchEmailRunning,
|
||||
_searchQuery
|
||||
)),
|
||||
buildIconAnsweredOrForwarded(width: 16, height: 16, presentationEmail: _presentationEmail),
|
||||
if (_presentationEmail.hasAttachment == true)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8),
|
||||
@@ -345,6 +346,11 @@ class EmailTileBuilder with BaseEmailItemTile {
|
||||
? EmailActionType.unMarkAsStarred
|
||||
: EmailActionType.markAsStarred,
|
||||
_presentationEmail)),
|
||||
buildIconWeb(
|
||||
icon: buildIconAnsweredOrForwarded(presentationEmail: _presentationEmail),
|
||||
tooltip: messageToolTipForAnsweredOrForwarded(context, _presentationEmail),
|
||||
iconPadding: const EdgeInsets.only(right: 12),
|
||||
splashRadius: 1),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
if (isHoverIcon) {
|
||||
@@ -382,7 +388,7 @@ class EmailTileBuilder with BaseEmailItemTile {
|
||||
Transform(
|
||||
transform: Matrix4.translationValues(0.0, 10, 0.0),
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.only(left: 80),
|
||||
padding: EdgeInsets.only(left: 120),
|
||||
child: Divider(
|
||||
color: AppColor.lineItemListColor,
|
||||
height: 1,
|
||||
@@ -497,6 +503,7 @@ class EmailTileBuilder with BaseEmailItemTile {
|
||||
|
||||
Widget _buildDateTimeForMobileTabletScreen() {
|
||||
return Row(children: [
|
||||
buildIconAnsweredOrForwarded(width: 16, height: 16, presentationEmail: _presentationEmail),
|
||||
if (_presentationEmail.hasAttachment == true)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8),
|
||||
|
||||
Reference in New Issue
Block a user