TF-248 Update list email, email content for tablet
This commit is contained in:
@@ -161,7 +161,8 @@ class EmailController extends BaseController {
|
||||
if (success is MarkAsEmailReadSuccess
|
||||
&& success.readActions == ReadActions.markAsUnread
|
||||
&& Get.context != null
|
||||
&& !responsiveUtils.isDesktop(Get.context!)) {
|
||||
&& !responsiveUtils.isDesktop(Get.context!)
|
||||
&& !responsiveUtils.isTabletLarge(Get.context!)) {
|
||||
backToThreadView();
|
||||
}
|
||||
}
|
||||
@@ -170,7 +171,8 @@ class EmailController extends BaseController {
|
||||
if (failure is MarkAsEmailReadFailure
|
||||
&& failure.readActions == ReadActions.markAsUnread
|
||||
&& Get.context != null
|
||||
&& !responsiveUtils.isDesktop(Get.context!)) {
|
||||
&& !responsiveUtils.isDesktop(Get.context!)
|
||||
&& !responsiveUtils.isTabletLarge(Get.context!)) {
|
||||
backToThreadView();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:core/core.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -11,7 +10,6 @@ import 'package:tmail_ui_user/features/email/presentation/widgets/app_bar_mail_w
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/attachment_file_tile_builder.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/attachments_place_holder_loading_widget.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/bottom_bar_mail_widget_builder.dart';
|
||||
import 'package:model/extensions/list_attachment_extension.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/email_content_item_builder.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/email_content_place_holder_loading_widget.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/sender_and_receiver_information_tile_builder.dart';
|
||||
@@ -63,14 +61,18 @@ class EmailView extends GetView {
|
||||
Widget _buildBottomBar(BuildContext context) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(left: 6, top: 6, right: 6, bottom: 6),
|
||||
child: (BottomBarMailWidgetBuilder(context, imagePaths, responsiveUtils)
|
||||
child: (BottomBarMailWidgetBuilder(
|
||||
context,
|
||||
imagePaths,
|
||||
responsiveUtils,
|
||||
emailController.mailboxDashBoardController.selectedEmail.value)
|
||||
..addOnPressEmailAction((emailActionType) => emailController.pressEmailAction(emailActionType)))
|
||||
.build());
|
||||
}
|
||||
|
||||
Widget _buildEmailBody(BuildContext context) {
|
||||
return Container(
|
||||
color: AppColor.bgMessenger,
|
||||
color: Colors.white,
|
||||
margin: EdgeInsets.zero,
|
||||
alignment: Alignment.topCenter,
|
||||
child: Obx(() => emailController.mailboxDashBoardController.selectedEmail.value != null
|
||||
@@ -80,14 +82,17 @@ class EmailView extends GetView {
|
||||
margin: EdgeInsets.zero,
|
||||
width: double.infinity,
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.all(16),
|
||||
color: AppColor.bgMessenger,
|
||||
padding: EdgeInsets.only(
|
||||
left: responsiveUtils.isMobile(context) ? 16 : 24,
|
||||
right: responsiveUtils.isMobile(context) ? 16 : 24,
|
||||
bottom: responsiveUtils.isMobile(context) ? 16 : 24,
|
||||
top: responsiveUtils.isMobile(context) ? 10 : 16),
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
_buildEmailSubject(),
|
||||
_buildEmailMessage(context),
|
||||
])
|
||||
))
|
||||
@@ -105,19 +110,31 @@ class EmailView extends GetView {
|
||||
|
||||
Widget _buildEmailSubject() {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(left: 8, top: 4, bottom: 16),
|
||||
padding: EdgeInsets.only(left: 8, top: 25, bottom: 16),
|
||||
child: Text(
|
||||
'${emailController.mailboxDashBoardController.selectedEmail.value?.getEmailTitle()}',
|
||||
style: TextStyle(fontSize: 18, color: AppColor.mailboxTextColor, fontWeight: FontWeight.w500)
|
||||
style: TextStyle(fontSize: 22, color: AppColor.colorNameEmail, fontWeight: FontWeight.w700)
|
||||
));
|
||||
}
|
||||
|
||||
Widget _buildEmailMessage(BuildContext context) {
|
||||
return Container(
|
||||
padding: EdgeInsets.only(left: 12, right: 12, top: 16, bottom: 16),
|
||||
padding: EdgeInsets.only(
|
||||
bottom: responsiveUtils.isMobile(context) ? 16 : 24,
|
||||
left: responsiveUtils.isMobile(context) ? 16 : 24,
|
||||
right: responsiveUtils.isMobile(context) ? 16 : 24,
|
||||
top: 10),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.colorShadowBgContentEmail,
|
||||
spreadRadius: 3,
|
||||
blurRadius: 3,
|
||||
offset: Offset(0, 2), // changes position of shadow
|
||||
),
|
||||
],
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@@ -131,6 +148,10 @@ class EmailView extends GetView {
|
||||
emailController.emailAddressExpandMode.value)
|
||||
.onOpenExpandAddressReceiverActionClick(() => emailController.toggleDisplayEmailAddressAction(expandMode: ExpandMode.EXPAND))
|
||||
.build()),
|
||||
Padding(
|
||||
padding: EdgeInsets.zero,
|
||||
child: Divider(color: AppColor.lineItemListColor, height: 1, thickness: 0.1)),
|
||||
_buildEmailSubject(),
|
||||
_buildAttachments(context),
|
||||
_buildListEmailContent(),
|
||||
],
|
||||
|
||||
@@ -57,12 +57,13 @@ class AppBarMailWidgetBuilder {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
if (!_responsiveUtils.isDesktop(_context) || Get.currentRoute != AppRoutes.MAILBOX_DASHBOARD)
|
||||
if ((!_responsiveUtils.isDesktop(_context) && !_responsiveUtils.isTabletLarge(_context))
|
||||
|| Get.currentRoute != AppRoutes.MAILBOX_DASHBOARD)
|
||||
Expanded(child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children:[_buildBackButton()])),
|
||||
_buildListOptionButton(),
|
||||
if (_presentationEmail != null) _buildListOptionButton(),
|
||||
]
|
||||
)
|
||||
)
|
||||
@@ -94,31 +95,31 @@ class AppBarMailWidgetBuilder {
|
||||
// _onBackActionClick!();
|
||||
// }
|
||||
// }),
|
||||
IconButton(
|
||||
key: Key('button_mark_as_unread_email'),
|
||||
color: AppColor.baseTextColor,
|
||||
icon: SvgPicture.asset(_imagePaths.icEyeDisable, color: AppColor.baseTextColor, fit: BoxFit.fill),
|
||||
onPressed: () {
|
||||
if (_onUnreadEmailActionClick != null && _presentationEmail != null && _presentationEmail!.isReadEmail()) {
|
||||
_onUnreadEmailActionClick!(_presentationEmail!);
|
||||
}
|
||||
}),
|
||||
IconButton(
|
||||
key: Key('button_mark_as_star_email'),
|
||||
icon: SvgPicture.asset(
|
||||
(_presentationEmail != null && _presentationEmail!.isFlaggedEmail())
|
||||
? _imagePaths.icFlagged
|
||||
: _imagePaths.icFlag,
|
||||
fit: BoxFit.fill),
|
||||
(_presentationEmail != null && _presentationEmail!.isFlaggedEmail())
|
||||
? _imagePaths.icStar
|
||||
: _imagePaths.icUnStar,
|
||||
fit: BoxFit.fill),
|
||||
onPressed: () {
|
||||
if (_markAsStarActionClick != null && _presentationEmail != null) {
|
||||
_markAsStarActionClick!(_presentationEmail!);
|
||||
}
|
||||
}),
|
||||
IconButton(
|
||||
key: Key('button_mark_as_unread_email'),
|
||||
color: AppColor.baseTextColor,
|
||||
icon: SvgPicture.asset(_imagePaths.icUnreadEmail, fit: BoxFit.fill),
|
||||
onPressed: () {
|
||||
if (_onUnreadEmailActionClick != null && _presentationEmail != null && _presentationEmail!.isReadEmail()) {
|
||||
_onUnreadEmailActionClick!(_presentationEmail!);
|
||||
}
|
||||
}),
|
||||
IconButton(
|
||||
key: Key('button_move_to_mailbox_email'),
|
||||
color: AppColor.baseTextColor,
|
||||
icon: SvgPicture.asset(_imagePaths.icFolder, color: AppColor.baseTextColor, fit: BoxFit.fill),
|
||||
icon: SvgPicture.asset(_imagePaths.icMoveEmail, fit: BoxFit.fill),
|
||||
onPressed: () {
|
||||
if (_onMoveToMailboxActionClick != null && _presentationEmail != null) {
|
||||
_onMoveToMailboxActionClick!(_presentationEmail!);
|
||||
|
||||
+4
-6
@@ -75,15 +75,13 @@ class _AttachmentsPlaceHolderLoadingState extends State<AttachmentsPlaceHolderLo
|
||||
children: [
|
||||
Row(children: [
|
||||
_placeHolderAttachment(context),
|
||||
SizedBox(width: 16),
|
||||
_placeHolderAttachment(context),
|
||||
if (!widget.responsiveUtils.isMobileDevice(context))
|
||||
if (widget.responsiveUtils.isDesktop(context))
|
||||
SizedBox(width: 16),
|
||||
if (!widget.responsiveUtils.isMobileDevice(context))
|
||||
if (widget.responsiveUtils.isDesktop(context))
|
||||
_placeHolderAttachment(context),
|
||||
if (!widget.responsiveUtils.isMobileDevice(context) && widget.responsiveUtils.isTablet(context))
|
||||
if (widget.responsiveUtils.isDesktop(context))
|
||||
SizedBox(width: 16),
|
||||
if (!widget.responsiveUtils.isMobileDevice(context) && widget.responsiveUtils.isTablet(context))
|
||||
if (widget.responsiveUtils.isDesktop(context))
|
||||
_placeHolderAttachment(context),
|
||||
]),
|
||||
],
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:core/core.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:model/model.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
@@ -11,6 +10,7 @@ class BottomBarMailWidgetBuilder {
|
||||
final BuildContext _context;
|
||||
final ImagePaths _imagePaths;
|
||||
final ResponsiveUtils _responsiveUtils;
|
||||
final PresentationEmail? _presentationEmail;
|
||||
|
||||
OnPressEmailActionClick? _onPressEmailActionClick;
|
||||
|
||||
@@ -18,6 +18,7 @@ class BottomBarMailWidgetBuilder {
|
||||
this._context,
|
||||
this._imagePaths,
|
||||
this._responsiveUtils,
|
||||
this._presentationEmail,
|
||||
);
|
||||
|
||||
void addOnPressEmailAction(OnPressEmailActionClick onPressEmailActionClick) {
|
||||
@@ -31,7 +32,7 @@ class BottomBarMailWidgetBuilder {
|
||||
color: Colors.white,
|
||||
child: MediaQuery(
|
||||
data: MediaQueryData(padding: EdgeInsets.zero),
|
||||
child: _buildListOptionButton()
|
||||
child: _presentationEmail != null ? _buildListOptionButton() : SizedBox.shrink()
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -41,24 +42,51 @@ class BottomBarMailWidgetBuilder {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
(ButtonBuilder(_imagePaths.icReplyAll)
|
||||
(ButtonBuilder(_imagePaths.icReplyAllV2)
|
||||
..key(Key('button_reply_all_message'))
|
||||
..size(20)
|
||||
..paddingIcon(EdgeInsets.only(
|
||||
top: _responsiveUtils.isMobileDevice(_context) ? 10 : 16,
|
||||
bottom: _responsiveUtils.isMobileDevice(_context) ? 8 : 16,
|
||||
right: 5))
|
||||
..textStyle(TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: _responsiveUtils.isMobileDevice(_context) ? 13 : 16,
|
||||
color: AppColor.colorTextButton))
|
||||
..onPressActionClick(() {
|
||||
if (_onPressEmailActionClick != null) {
|
||||
_onPressEmailActionClick!(EmailActionType.replyAll);
|
||||
}})
|
||||
..text(AppLocalizations.of(_context).reply_all, isVertical: _responsiveUtils.isMobile(_context)))
|
||||
.build(),
|
||||
(ButtonBuilder(_imagePaths.icReply)
|
||||
(ButtonBuilder(_imagePaths.icReplyV2)
|
||||
..key(Key('button_reply_message'))
|
||||
..size(20)
|
||||
..paddingIcon(EdgeInsets.only(
|
||||
top: _responsiveUtils.isMobileDevice(_context) ? 10 : 16,
|
||||
bottom: _responsiveUtils.isMobileDevice(_context) ? 8 : 16,
|
||||
right: 5))
|
||||
..textStyle(TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: _responsiveUtils.isMobileDevice(_context) ? 13 : 16,
|
||||
color: AppColor.colorTextButton))
|
||||
..onPressActionClick(() {
|
||||
if (_onPressEmailActionClick != null) {
|
||||
_onPressEmailActionClick!(EmailActionType.reply);
|
||||
}})
|
||||
..text(AppLocalizations.of(_context).reply, isVertical: _responsiveUtils.isMobile(_context)))
|
||||
.build(),
|
||||
(ButtonBuilder(_imagePaths.icForward)
|
||||
(ButtonBuilder(_imagePaths.icForwardV2)
|
||||
..key(Key('button_forward_message'))
|
||||
..size(20)
|
||||
..paddingIcon(EdgeInsets.only(
|
||||
top: _responsiveUtils.isMobileDevice(_context) ? 10 : 16,
|
||||
bottom: _responsiveUtils.isMobileDevice(_context) ? 8 : 16,
|
||||
right: 5))
|
||||
..textStyle(TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: _responsiveUtils.isMobileDevice(_context) ? 13 : 16,
|
||||
color: AppColor.colorTextButton))
|
||||
..onPressActionClick(() {
|
||||
if (_onPressEmailActionClick != null) {
|
||||
_onPressEmailActionClick!(EmailActionType.forward);
|
||||
|
||||
+36
-21
@@ -43,36 +43,51 @@ class SenderAndReceiverInformationTileBuilder {
|
||||
child: MediaQuery(
|
||||
data: MediaQueryData(padding: EdgeInsets.zero),
|
||||
child: ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
leading: Transform(
|
||||
transform: Matrix4.translationValues(-15.0, -8.0, 0.0),
|
||||
transform: Matrix4.translationValues(0.0, 0.0, 0.0),
|
||||
child: (AvatarBuilder()
|
||||
..text('${_presentationEmail!.getAvatarText()}')
|
||||
..textColor(Colors.white)
|
||||
..avatarColor(_presentationEmail?.avatarColors)
|
||||
..size(40))
|
||||
// .iconStatus(_imagePaths.icOffline)
|
||||
.build()),
|
||||
title: Transform(
|
||||
transform: Matrix4.translationValues(-15.0, 0.0, 0.0),
|
||||
child: Text(
|
||||
'${AppLocalizations.of(_context).from_email_address_prefix}: ${_presentationEmail!.getSenderName()}',
|
||||
style: TextStyle(fontSize: 16, color: AppColor.nameUserColor, fontWeight: FontWeight.w500),
|
||||
)),
|
||||
transform: Matrix4.translationValues(0.0, 0.0, 0.0),
|
||||
child: Row(children: [
|
||||
Expanded(child: Text(
|
||||
'${_presentationEmail!.getSenderName()}',
|
||||
style: TextStyle(fontSize: 17, color: AppColor.colorNameEmail, fontWeight: FontWeight.w500),
|
||||
)),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 8),
|
||||
child: Text(
|
||||
'${_presentationEmail!.getReceivedAt(Localizations.localeOf(_context).toLanguageTag())}',
|
||||
maxLines: 1,
|
||||
overflow:TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 15, color: AppColor.colorContentEmail)))
|
||||
])),
|
||||
subtitle: Transform(
|
||||
transform: Matrix4.translationValues(-15.0, 0.0, 0.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (_presentationEmail!.to.numberEmailAddress() > 0) _buildAddressToReceiverWidget(),
|
||||
if (_presentationEmail!.cc.numberEmailAddress() > 0) _buildAddressCcReceiverWidget(),
|
||||
if (_presentationEmail!.bcc.numberEmailAddress() > 0) _buildAddressBccReceiverWidget(),
|
||||
transform: Matrix4.translationValues(0.0, 0.0, 0.0),
|
||||
child: Row(children: [
|
||||
Expanded(child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (_presentationEmail!.to.numberEmailAddress() > 0) _buildAddressToReceiverWidget(),
|
||||
if (_presentationEmail!.cc.numberEmailAddress() > 0) _buildAddressCcReceiverWidget(),
|
||||
if (_presentationEmail!.bcc.numberEmailAddress() > 0) _buildAddressBccReceiverWidget(),
|
||||
],
|
||||
)),
|
||||
if (_presentationEmail?.hasAttachment == true)
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 6),
|
||||
child: Text(
|
||||
'${_presentationEmail!.getReceivedAt(Localizations.localeOf(_context).toLanguageTag(), pattern: 'dd/MM/yyyy h:mm a')}',
|
||||
style: TextStyle(fontSize: 12, color: AppColor.baseTextColor),
|
||||
))
|
||||
],
|
||||
))
|
||||
padding: EdgeInsets.only(left: 8),
|
||||
child: (ButtonBuilder(_imagePaths.icAttachment)
|
||||
..paddingIcon(EdgeInsets.zero)
|
||||
..size(16))
|
||||
.build()),
|
||||
]))
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user