TF-694 Fixed took a long time to select all emails at once
This commit is contained in:
@@ -553,6 +553,7 @@ class ThreadView extends GetWidget<ThreadController> with AppLoaderMixin,
|
|||||||
physics: const AlwaysScrollableScrollPhysics(),
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
key: const PageStorageKey('list_presentation_email_in_threads'),
|
key: const PageStorageKey('list_presentation_email_in_threads'),
|
||||||
|
itemExtent: _getItemExtent(context),
|
||||||
itemCount: listPresentationEmail.length,
|
itemCount: listPresentationEmail.length,
|
||||||
itemBuilder: (context, index) => Obx(() => (EmailTileBuilder(
|
itemBuilder: (context, index) => Obx(() => (EmailTileBuilder(
|
||||||
context,
|
context,
|
||||||
@@ -560,17 +561,23 @@ class ThreadView extends GetWidget<ThreadController> with AppLoaderMixin,
|
|||||||
controller.currentMailbox?.role,
|
controller.currentMailbox?.role,
|
||||||
controller.mailboxDashBoardController.currentSelectMode.value,
|
controller.mailboxDashBoardController.currentSelectMode.value,
|
||||||
controller.searchController.searchState.value.searchStatus,
|
controller.searchController.searchState.value.searchStatus,
|
||||||
controller.searchQuery,
|
controller.searchQuery)
|
||||||
)
|
|
||||||
..addOnPressEmailActionClick((action, email) => controller.pressEmailAction(context, action, email))
|
..addOnPressEmailActionClick((action, email) => controller.pressEmailAction(context, action, email))
|
||||||
..addOnMoreActionClick((email, position) => _responsiveUtils.isMobile(context)
|
..addOnMoreActionClick((email, position) => _responsiveUtils.isMobile(context)
|
||||||
? controller.openContextMenuAction(context, _contextMenuActionTile(context, email))
|
? controller.openContextMenuAction(context, _contextMenuActionTile(context, email))
|
||||||
: controller.openPopupMenuAction(context, position, _popupMenuActionTile(context, email))))
|
: controller.openPopupMenuAction(context, position, _popupMenuActionTile(context, email))))
|
||||||
.build()),
|
.build()))
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double? _getItemExtent(BuildContext context) {
|
||||||
|
if (BuildUtils.isWeb) {
|
||||||
|
return _responsiveUtils.isDesktop(context) ? 52 : 85;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Widget _buildEmptyEmail(BuildContext context) {
|
Widget _buildEmptyEmail(BuildContext context) {
|
||||||
return Obx(() => controller.viewState.value.fold(
|
return Obx(() => controller.viewState.value.fold(
|
||||||
(failure) => const SizedBox.shrink(),
|
(failure) => const SizedBox.shrink(),
|
||||||
|
|||||||
@@ -22,10 +22,6 @@ class EmailTileBuilder {
|
|||||||
final SearchQuery? _searchQuery;
|
final SearchQuery? _searchQuery;
|
||||||
|
|
||||||
OnPressEmailActionClick? _emailActionClick;
|
OnPressEmailActionClick? _emailActionClick;
|
||||||
OnMoreActionClick? _onMoreActionClick;
|
|
||||||
|
|
||||||
bool isHoverItem = false;
|
|
||||||
bool isHoverItemSelected = false;
|
|
||||||
|
|
||||||
EmailTileBuilder(
|
EmailTileBuilder(
|
||||||
this._context,
|
this._context,
|
||||||
@@ -40,24 +36,26 @@ class EmailTileBuilder {
|
|||||||
_emailActionClick = actionClick;
|
_emailActionClick = actionClick;
|
||||||
}
|
}
|
||||||
|
|
||||||
void addOnMoreActionClick(OnMoreActionClick onMoreActionClick) {
|
void addOnMoreActionClick(OnMoreActionClick onMoreActionClick) {}
|
||||||
_onMoreActionClick = onMoreActionClick;
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget build() {
|
Widget build() {
|
||||||
return Theme(
|
return Material(
|
||||||
key: const Key('thread_tile'),
|
color: Colors.transparent,
|
||||||
data: ThemeData(splashColor: Colors.transparent, highlightColor: Colors.transparent),
|
child: Column(
|
||||||
child: Padding(
|
children: [
|
||||||
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 4),
|
|
||||||
child: Column(children: [
|
|
||||||
ListTile(
|
ListTile(
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 5),
|
||||||
onTap: () => _emailActionClick?.call(EmailActionType.preview, _presentationEmail),
|
onTap: () => _emailActionClick?.call(
|
||||||
onLongPress: () => _emailActionClick?.call(EmailActionType.selection, _presentationEmail),
|
EmailActionType.preview,
|
||||||
|
_presentationEmail),
|
||||||
|
onLongPress: () => _emailActionClick?.call(
|
||||||
|
EmailActionType.selection,
|
||||||
|
_presentationEmail),
|
||||||
leading: GestureDetector(
|
leading: GestureDetector(
|
||||||
onTap: () => _emailActionClick?.call(
|
onTap: () => _emailActionClick?.call(
|
||||||
_selectModeAll == SelectMode.ACTIVE ? EmailActionType.selection : EmailActionType.preview,
|
_selectModeAll == SelectMode.ACTIVE
|
||||||
|
? EmailActionType.selection
|
||||||
|
: EmailActionType.preview,
|
||||||
_presentationEmail),
|
_presentationEmail),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 56,
|
width: 56,
|
||||||
@@ -71,32 +69,61 @@ class EmailTileBuilder {
|
|||||||
if (!_presentationEmail.hasRead)
|
if (!_presentationEmail.hasRead)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(right: 5),
|
padding: const EdgeInsets.only(right: 5),
|
||||||
child: SvgPicture.asset(_imagePaths.icUnreadStatus, width: 9, height: 9, fit: BoxFit.fill)),
|
child: SvgPicture.asset(
|
||||||
|
_imagePaths.icUnreadStatus,
|
||||||
|
width: 9,
|
||||||
|
height: 9,
|
||||||
|
fit: BoxFit.fill)),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: _searchStatus == SearchStatus.ACTIVE && _searchQuery != null && _searchQuery!.value.isNotEmpty
|
child: _searchStatus == SearchStatus.ACTIVE &&
|
||||||
|
_searchQuery != null &&
|
||||||
|
_searchQuery!.value.isNotEmpty
|
||||||
? RichTextBuilder(
|
? RichTextBuilder(
|
||||||
_getInformationSender(),
|
_getInformationSender(),
|
||||||
_searchQuery!.value,
|
_searchQuery!.value,
|
||||||
const TextStyle(fontSize: 15, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600),
|
const TextStyle(
|
||||||
TextStyle(fontSize: 15, color: _buildTextColorForReadEmail(), backgroundColor: AppColor.bgWordSearch, fontWeight: _buildFontForReadEmail())).build()
|
fontSize: 15,
|
||||||
|
color: AppColor.colorNameEmail,
|
||||||
|
fontWeight: FontWeight.w600),
|
||||||
|
TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
color: _buildTextColorForReadEmail(),
|
||||||
|
backgroundColor: AppColor.bgWordSearch,
|
||||||
|
fontWeight: _buildFontForReadEmail())).build()
|
||||||
: Text(
|
: Text(
|
||||||
_getInformationSender(),
|
_getInformationSender(),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow:TextOverflow.ellipsis,
|
overflow:TextOverflow.ellipsis,
|
||||||
style: TextStyle(fontSize: 15, color: _buildTextColorForReadEmail(), fontWeight: _buildFontForReadEmail()))
|
style: TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
color: _buildTextColorForReadEmail(),
|
||||||
|
fontWeight: _buildFontForReadEmail()))
|
||||||
),
|
),
|
||||||
if (_presentationEmail.hasAttachment == true)
|
if (_presentationEmail.hasAttachment == true)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 8),
|
padding: const EdgeInsets.only(left: 8),
|
||||||
child: SvgPicture.asset(_imagePaths.icAttachment, width: 16, height: 16, fit: BoxFit.fill)),
|
child: SvgPicture.asset(
|
||||||
|
_imagePaths.icAttachment,
|
||||||
|
width: 16,
|
||||||
|
height: 16,
|
||||||
|
fit: BoxFit.fill)),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(right: 4, left: 8),
|
padding: const EdgeInsets.only(right: 4, left: 8),
|
||||||
child: Text(
|
child: Text(
|
||||||
_presentationEmail.getReceivedAt(Localizations.localeOf(_context).toLanguageTag()),
|
_presentationEmail
|
||||||
|
.getReceivedAt(Localizations.localeOf(_context)
|
||||||
|
.toLanguageTag()),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow:TextOverflow.ellipsis,
|
overflow:TextOverflow.ellipsis,
|
||||||
style: TextStyle(fontSize: 13, color: _buildTextColorForReadEmail(), fontWeight: _buildFontForReadEmail()))),
|
style: TextStyle(
|
||||||
SvgPicture.asset(_imagePaths.icChevron, width: 16, height: 16, fit: BoxFit.fill),
|
fontSize: 13,
|
||||||
|
color: _buildTextColorForReadEmail(),
|
||||||
|
fontWeight: _buildFontForReadEmail()))),
|
||||||
|
SvgPicture.asset(
|
||||||
|
_imagePaths.icChevron,
|
||||||
|
width: 16,
|
||||||
|
height: 16,
|
||||||
|
fit: BoxFit.fill),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
subtitle: Column(
|
subtitle: Column(
|
||||||
@@ -108,22 +135,37 @@ class EmailTileBuilder {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: _searchStatus == SearchStatus.ACTIVE && _searchQuery != null && _searchQuery!.value.isNotEmpty
|
Expanded(child: _searchStatus == SearchStatus.ACTIVE &&
|
||||||
|
_searchQuery != null &&
|
||||||
|
_searchQuery!.value.isNotEmpty
|
||||||
? RichTextBuilder(
|
? RichTextBuilder(
|
||||||
_presentationEmail.getEmailTitle(),
|
_presentationEmail.getEmailTitle(),
|
||||||
_searchQuery!.value,
|
_searchQuery!.value,
|
||||||
TextStyle(fontSize: 13, color: _buildTextColorForReadEmail(), fontWeight: _buildFontForReadEmail()),
|
TextStyle(
|
||||||
TextStyle(fontSize: 13, backgroundColor: AppColor.bgWordSearch, color: _buildTextColorForReadEmail(), fontWeight: _buildFontForReadEmail())).build()
|
fontSize: 13,
|
||||||
|
color: _buildTextColorForReadEmail(),
|
||||||
|
fontWeight: _buildFontForReadEmail()),
|
||||||
|
TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
backgroundColor: AppColor.bgWordSearch,
|
||||||
|
color: _buildTextColorForReadEmail(),
|
||||||
|
fontWeight: _buildFontForReadEmail())).build()
|
||||||
: Text(
|
: Text(
|
||||||
_presentationEmail.getEmailTitle(),
|
_presentationEmail.getEmailTitle(),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(fontSize: 13, color: _buildTextColorForReadEmail(), fontWeight: _buildFontForReadEmail()))
|
style: TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: _buildTextColorForReadEmail(),
|
||||||
|
fontWeight: _buildFontForReadEmail()))
|
||||||
),
|
),
|
||||||
if (_searchStatus == SearchStatus.ACTIVE && _presentationEmail.mailboxName.isNotEmpty)
|
if (_searchStatus == SearchStatus.ACTIVE &&
|
||||||
|
_presentationEmail.mailboxName.isNotEmpty)
|
||||||
Container(
|
Container(
|
||||||
margin: const EdgeInsets.only(left: 8),
|
margin: const EdgeInsets.only(left: 8),
|
||||||
padding: const EdgeInsets.only(left: 8, right: 8, top: 3, bottom: 3),
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 8,
|
||||||
|
vertical: 3),
|
||||||
constraints: const BoxConstraints(maxWidth: 100),
|
constraints: const BoxConstraints(maxWidth: 100),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
@@ -132,27 +174,43 @@ class EmailTileBuilder {
|
|||||||
_presentationEmail.mailboxName,
|
_presentationEmail.mailboxName,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: const TextStyle(fontSize: 10, color: AppColor.mailboxTextColor, fontWeight: FontWeight.bold),
|
style: const TextStyle(
|
||||||
|
fontSize: 10,
|
||||||
|
color: AppColor.mailboxTextColor,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
if (_presentationEmail.hasStarred)
|
if (_presentationEmail.hasStarred)
|
||||||
SvgPicture.asset(_imagePaths.icStar, width: 15, height: 15, fit: BoxFit.fill)
|
SvgPicture.asset(
|
||||||
|
_imagePaths.icStar,
|
||||||
|
width: 15,
|
||||||
|
height: 15,
|
||||||
|
fit: BoxFit.fill)
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 6),
|
padding: const EdgeInsets.only(top: 6),
|
||||||
child: Row(children: [
|
child: Row(children: [
|
||||||
Expanded(child: _searchStatus == SearchStatus.ACTIVE && _searchQuery != null && _searchQuery!.value.isNotEmpty
|
Expanded(child: _searchStatus == SearchStatus.ACTIVE &&
|
||||||
|
_searchQuery != null &&
|
||||||
|
_searchQuery!.value.isNotEmpty
|
||||||
? RichTextBuilder(
|
? RichTextBuilder(
|
||||||
_presentationEmail.getPartialContent(),
|
_presentationEmail.getPartialContent(),
|
||||||
_searchQuery!.value,
|
_searchQuery!.value,
|
||||||
const TextStyle(fontSize: 13, color: AppColor.colorContentEmail),
|
const TextStyle(
|
||||||
const TextStyle(fontSize: 13, color: AppColor.colorContentEmail, backgroundColor: AppColor.bgWordSearch)).build()
|
fontSize: 13,
|
||||||
|
color: AppColor.colorContentEmail),
|
||||||
|
const TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: AppColor.colorContentEmail,
|
||||||
|
backgroundColor: AppColor.bgWordSearch)).build()
|
||||||
: Text(
|
: Text(
|
||||||
_presentationEmail.getPartialContent(),
|
_presentationEmail.getPartialContent(),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: const TextStyle(fontSize: 13, color: AppColor.colorContentEmail))
|
style: const TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: AppColor.colorContentEmail))
|
||||||
),
|
),
|
||||||
])
|
])
|
||||||
),
|
),
|
||||||
@@ -160,10 +218,13 @@ class EmailTileBuilder {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Padding(
|
const Padding(
|
||||||
padding: EdgeInsets.only(top: 4),
|
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||||
child: Divider(color: AppColor.lineItemListColor, height: 1, thickness: 0.2)),
|
child: Divider(
|
||||||
]),
|
color: AppColor.lineItemListColor,
|
||||||
)
|
height: 1,
|
||||||
|
thickness: 0.2)),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,7 +257,10 @@ class EmailTileBuilder {
|
|||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
_presentationEmail.getAvatarText(),
|
_presentationEmail.getAvatarText(),
|
||||||
style: textStyle ?? const TextStyle(fontSize: 20, color: Colors.white, fontWeight: FontWeight.w500)
|
style: textStyle ?? const TextStyle(
|
||||||
|
fontSize: 20,
|
||||||
|
color: Colors.white,
|
||||||
|
fontWeight: FontWeight.w500)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -207,7 +271,9 @@ class EmailTileBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Color _buildTextColorForReadEmail() {
|
Color _buildTextColorForReadEmail() {
|
||||||
return _presentationEmail.hasRead ? AppColor.colorContentEmail : AppColor.colorNameEmail;
|
return _presentationEmail.hasRead
|
||||||
|
? AppColor.colorContentEmail
|
||||||
|
: AppColor.colorNameEmail;
|
||||||
}
|
}
|
||||||
|
|
||||||
String _getInformationSender() {
|
String _getInformationSender() {
|
||||||
|
|||||||
@@ -69,7 +69,8 @@ class EmailTileBuilder {
|
|||||||
return Container(
|
return Container(
|
||||||
margin: const EdgeInsets.only(top: 3),
|
margin: const EdgeInsets.only(top: 3),
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||||
decoration: _selectModeAll == SelectMode.ACTIVE && _presentationEmail.selectMode == SelectMode.ACTIVE
|
decoration: _selectModeAll == SelectMode.ACTIVE &&
|
||||||
|
_presentationEmail.selectMode == SelectMode.ACTIVE
|
||||||
? BoxDecoration(
|
? BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(14),
|
borderRadius: BorderRadius.circular(14),
|
||||||
color: AppColor.colorItemEmailSelectedDesktop)
|
color: AppColor.colorItemEmailSelectedDesktop)
|
||||||
@@ -80,9 +81,14 @@ class EmailTileBuilder {
|
|||||||
return Container(
|
return Container(
|
||||||
margin: const EdgeInsets.only(top: 3, left: 16, right: 16),
|
margin: const EdgeInsets.only(top: 3, left: 16, right: 16),
|
||||||
padding: const EdgeInsets.only(bottom: 8, right: 8, top: 8),
|
padding: const EdgeInsets.only(bottom: 8, right: 8, top: 8),
|
||||||
decoration: _selectModeAll == SelectMode.ACTIVE && _presentationEmail.selectMode == SelectMode.ACTIVE
|
decoration: _selectModeAll == SelectMode.ACTIVE &&
|
||||||
? BoxDecoration(borderRadius: BorderRadius.circular(14), color: AppColor.colorItemEmailSelectedDesktop)
|
_presentationEmail.selectMode == SelectMode.ACTIVE
|
||||||
: BoxDecoration(borderRadius: BorderRadius.circular(0), color: Colors.white),
|
? BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(14),
|
||||||
|
color: AppColor.colorItemEmailSelectedDesktop)
|
||||||
|
: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(0),
|
||||||
|
color: Colors.white),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: tile);
|
child: tile);
|
||||||
}
|
}
|
||||||
@@ -92,12 +98,18 @@ class EmailTileBuilder {
|
|||||||
return Stack(alignment: Alignment.bottomCenter,
|
return Stack(alignment: Alignment.bottomCenter,
|
||||||
children: [
|
children: [
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () => _emailActionClick?.call(EmailActionType.preview, _presentationEmail),
|
onTap: () => _emailActionClick?.call(
|
||||||
onLongPress: () => _emailActionClick?.call(EmailActionType.selection, _presentationEmail),
|
EmailActionType.preview,
|
||||||
|
_presentationEmail),
|
||||||
|
onLongPress: () => _emailActionClick?.call(
|
||||||
|
EmailActionType.selection,
|
||||||
|
_presentationEmail),
|
||||||
child: Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
child: Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () => _emailActionClick?.call(
|
onTap: () => _emailActionClick?.call(
|
||||||
_selectModeAll == SelectMode.ACTIVE ? EmailActionType.selection : EmailActionType.preview,
|
_selectModeAll == SelectMode.ACTIVE
|
||||||
|
? EmailActionType.selection
|
||||||
|
: EmailActionType.preview,
|
||||||
_presentationEmail),
|
_presentationEmail),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(top: 8, right: 12),
|
padding: const EdgeInsets.only(top: 8, right: 12),
|
||||||
@@ -110,68 +122,90 @@ class EmailTileBuilder {
|
|||||||
if (!_presentationEmail.hasRead)
|
if (!_presentationEmail.hasRead)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(right: 5),
|
padding: const EdgeInsets.only(right: 5),
|
||||||
child: SvgPicture.asset(_imagePaths.icUnreadStatus, width: 9, height: 9, fit: BoxFit.fill)),
|
child: SvgPicture.asset(
|
||||||
|
_imagePaths.icUnreadStatus,
|
||||||
|
width: 9,
|
||||||
|
height: 9,
|
||||||
|
fit: BoxFit.fill)),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: _searchStatus == SearchStatus.ACTIVE && _searchQuery != null && _searchQuery!.value.isNotEmpty
|
child: _searchStatus == SearchStatus.ACTIVE &&
|
||||||
|
_searchQuery != null &&
|
||||||
|
_searchQuery!.value.isNotEmpty
|
||||||
? RichTextBuilder(
|
? RichTextBuilder(
|
||||||
_getInformationSender(),
|
_getInformationSender(),
|
||||||
_searchQuery!.value,
|
_searchQuery!.value,
|
||||||
TextStyle(
|
TextStyle(
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
color: _buildTextColorForReadEmail(),
|
color: _buildTextColorForReadEmail(),
|
||||||
fontWeight: _buildFontForReadEmail()),
|
fontWeight: _buildFontForReadEmail()),
|
||||||
TextStyle(
|
TextStyle(
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
color: _buildTextColorForReadEmail(),
|
color: _buildTextColorForReadEmail(),
|
||||||
backgroundColor: AppColor.bgWordSearch,
|
backgroundColor: AppColor.bgWordSearch,
|
||||||
fontWeight: _buildFontForReadEmail())).build()
|
fontWeight: _buildFontForReadEmail())).build()
|
||||||
: Text(
|
: Text(
|
||||||
_getInformationSender(),
|
_getInformationSender(),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
color: _buildTextColorForReadEmail(),
|
color: _buildTextColorForReadEmail(),
|
||||||
fontWeight: _buildFontForReadEmail()))
|
fontWeight: _buildFontForReadEmail()))
|
||||||
),
|
),
|
||||||
if (_presentationEmail.hasAttachment == true)
|
if (_presentationEmail.hasAttachment == true)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 8),
|
padding: const EdgeInsets.only(left: 8),
|
||||||
child: SvgPicture.asset(_imagePaths.icAttachment, width: 16, height: 16, fit: BoxFit.fill)),
|
child: SvgPicture.asset(
|
||||||
|
_imagePaths.icAttachment,
|
||||||
|
width: 16,
|
||||||
|
height: 16,
|
||||||
|
fit: BoxFit.fill)),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(right: 4, left: 8),
|
padding: const EdgeInsets.only(right: 4, left: 8),
|
||||||
child: Text(
|
child: Text(
|
||||||
_presentationEmail.getReceivedAt(Localizations.localeOf(_context).toLanguageTag()),
|
_presentationEmail
|
||||||
|
.getReceivedAt(Localizations.localeOf(_context)
|
||||||
|
.toLanguageTag()),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: const TextStyle(fontSize: 13, color: AppColor.colorContentEmail))),
|
style: const TextStyle(
|
||||||
SvgPicture.asset(_imagePaths.icChevron, width: 16, height: 16, fit: BoxFit.fill)
|
fontSize: 13,
|
||||||
|
color: AppColor.colorContentEmail))),
|
||||||
|
SvgPicture.asset(
|
||||||
|
_imagePaths.icChevron,
|
||||||
|
width: 16,
|
||||||
|
height: 16,
|
||||||
|
fit: BoxFit.fill)
|
||||||
]),
|
]),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
Row(
|
Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: _searchStatus == SearchStatus.ACTIVE && _searchQuery != null && _searchQuery!.value.isNotEmpty
|
Expanded(child: _searchStatus == SearchStatus.ACTIVE &&
|
||||||
|
_searchQuery != null &&
|
||||||
|
_searchQuery!.value.isNotEmpty
|
||||||
? RichTextBuilder(
|
? RichTextBuilder(
|
||||||
_presentationEmail.getEmailTitle(),
|
_presentationEmail.getEmailTitle(),
|
||||||
_searchQuery!.value,
|
_searchQuery!.value,
|
||||||
TextStyle(
|
TextStyle(
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
color: _buildTextColorForReadEmail()),
|
color: _buildTextColorForReadEmail()),
|
||||||
TextStyle(
|
TextStyle(
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
backgroundColor: AppColor.bgWordSearch,
|
backgroundColor: AppColor.bgWordSearch,
|
||||||
color: _buildTextColorForReadEmail())
|
color: _buildTextColorForReadEmail())).build()
|
||||||
).build()
|
|
||||||
: Text(
|
: Text(
|
||||||
_presentationEmail.getEmailTitle(),
|
_presentationEmail.getEmailTitle(),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
color: _buildTextColorForReadEmail()))
|
color: _buildTextColorForReadEmail()))
|
||||||
),
|
),
|
||||||
if (_searchStatus == SearchStatus.ACTIVE && _presentationEmail.mailboxName.isNotEmpty)
|
if (_searchStatus == SearchStatus.ACTIVE &&
|
||||||
|
_presentationEmail.mailboxName.isNotEmpty)
|
||||||
Container(
|
Container(
|
||||||
margin: const EdgeInsets.only(left: 8),
|
margin: const EdgeInsets.only(left: 8),
|
||||||
padding: const EdgeInsets.only(left: 8, right: 8, top: 3, bottom: 3),
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 8,
|
||||||
|
vertical: 3),
|
||||||
constraints: const BoxConstraints(maxWidth: 100),
|
constraints: const BoxConstraints(maxWidth: 100),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
@@ -179,26 +213,42 @@ class EmailTileBuilder {
|
|||||||
child: Text(
|
child: Text(
|
||||||
_presentationEmail.mailboxName,
|
_presentationEmail.mailboxName,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: const TextStyle(fontSize: 10, color: AppColor.mailboxTextColor, fontWeight: FontWeight.bold),
|
style: const TextStyle(
|
||||||
|
fontSize: 10,
|
||||||
|
color: AppColor.mailboxTextColor,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
if (_presentationEmail.hasStarred)
|
if (_presentationEmail.hasStarred)
|
||||||
SvgPicture.asset(_imagePaths.icStar, width: 15, height: 15, fit: BoxFit.fill),
|
SvgPicture.asset(
|
||||||
|
_imagePaths.icStar,
|
||||||
|
width: 15,
|
||||||
|
height: 15,
|
||||||
|
fit: BoxFit.fill),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
Row(children: [
|
Row(children: [
|
||||||
Expanded(child: _searchStatus == SearchStatus.ACTIVE && _searchQuery != null && _searchQuery!.value.isNotEmpty
|
Expanded(child: _searchStatus == SearchStatus.ACTIVE &&
|
||||||
|
_searchQuery != null &&
|
||||||
|
_searchQuery!.value.isNotEmpty
|
||||||
? RichTextBuilder(
|
? RichTextBuilder(
|
||||||
_presentationEmail.getPartialContent(),
|
_presentationEmail.getPartialContent(),
|
||||||
_searchQuery!.value,
|
_searchQuery!.value,
|
||||||
const TextStyle(fontSize: 13, color: AppColor.colorContentEmail),
|
const TextStyle(
|
||||||
const TextStyle(fontSize: 13, color: AppColor.colorContentEmail, backgroundColor: AppColor.bgWordSearch)).build()
|
fontSize: 13,
|
||||||
|
color: AppColor.colorContentEmail),
|
||||||
|
const TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: AppColor.colorContentEmail,
|
||||||
|
backgroundColor: AppColor.bgWordSearch)).build()
|
||||||
: Text(
|
: Text(
|
||||||
_presentationEmail.getPartialContent(),
|
_presentationEmail.getPartialContent(),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: const TextStyle(fontSize: 13, color: AppColor.colorContentEmail))
|
style: const TextStyle(
|
||||||
),
|
fontSize: 13,
|
||||||
|
color: AppColor.colorContentEmail))
|
||||||
|
),
|
||||||
]),
|
]),
|
||||||
]),
|
]),
|
||||||
)
|
)
|
||||||
@@ -218,7 +268,9 @@ class EmailTileBuilder {
|
|||||||
Widget _buildListTileTablet() {
|
Widget _buildListTileTablet() {
|
||||||
return StatefulBuilder(builder: (BuildContext context, StateSetter setState) {
|
return StatefulBuilder(builder: (BuildContext context, StateSetter setState) {
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () => _emailActionClick?.call(EmailActionType.preview, _presentationEmail),
|
onTap: () => _emailActionClick?.call(
|
||||||
|
EmailActionType.preview,
|
||||||
|
_presentationEmail),
|
||||||
onHover: (value) => _onHoverItemChanged(value, setState),
|
onHover: (value) => _onHoverItemChanged(value, setState),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
@@ -226,7 +278,9 @@ class EmailTileBuilder {
|
|||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (isHoverIcon) {
|
if (isHoverIcon) {
|
||||||
_emailActionClick?.call(EmailActionType.selection, _presentationEmail);
|
_emailActionClick?.call(
|
||||||
|
EmailActionType.selection,
|
||||||
|
_presentationEmail);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onHover: (value) => _onHoverIconChanged(value, setState),
|
onHover: (value) => _onHoverIconChanged(value, setState),
|
||||||
@@ -259,8 +313,7 @@ class EmailTileBuilder {
|
|||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
color: _buildTextColorForReadEmail(),
|
color: _buildTextColorForReadEmail(),
|
||||||
backgroundColor: AppColor.bgWordSearch,
|
backgroundColor: AppColor.bgWordSearch,
|
||||||
fontWeight: _buildFontForReadEmail())
|
fontWeight: _buildFontForReadEmail())).build()
|
||||||
).build()
|
|
||||||
: Text(
|
: Text(
|
||||||
_getInformationSender(),
|
_getInformationSender(),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
@@ -278,7 +331,9 @@ class EmailTileBuilder {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: _searchStatus == SearchStatus.ACTIVE && _searchQuery != null && _searchQuery!.value.isNotEmpty
|
Expanded(child: _searchStatus == SearchStatus.ACTIVE &&
|
||||||
|
_searchQuery != null &&
|
||||||
|
_searchQuery!.value.isNotEmpty
|
||||||
? RichTextBuilder(
|
? RichTextBuilder(
|
||||||
_presentationEmail.getEmailTitle(),
|
_presentationEmail.getEmailTitle(),
|
||||||
_searchQuery!.value,
|
_searchQuery!.value,
|
||||||
@@ -297,10 +352,13 @@ class EmailTileBuilder {
|
|||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
color: _buildTextColorForReadEmail()))
|
color: _buildTextColorForReadEmail()))
|
||||||
),
|
),
|
||||||
if (_searchStatus == SearchStatus.ACTIVE && _presentationEmail.mailboxName.isNotEmpty)
|
if (_searchStatus == SearchStatus.ACTIVE &&
|
||||||
|
_presentationEmail.mailboxName.isNotEmpty)
|
||||||
Container(
|
Container(
|
||||||
margin: const EdgeInsets.only(left: 8),
|
margin: const EdgeInsets.only(left: 8),
|
||||||
padding: const EdgeInsets.only(left: 8, right: 8, top: 3, bottom: 3),
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 8,
|
||||||
|
vertical: 3),
|
||||||
constraints: const BoxConstraints(maxWidth: 100),
|
constraints: const BoxConstraints(maxWidth: 100),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
@@ -308,27 +366,41 @@ class EmailTileBuilder {
|
|||||||
child: Text(
|
child: Text(
|
||||||
_presentationEmail.mailboxName,
|
_presentationEmail.mailboxName,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: const TextStyle(fontSize: 10, color: AppColor.mailboxTextColor, fontWeight: FontWeight.bold),
|
style: const TextStyle(
|
||||||
|
fontSize: 10,
|
||||||
|
color: AppColor.mailboxTextColor,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
if (_presentationEmail.hasStarred)
|
if (_presentationEmail.hasStarred)
|
||||||
SvgPicture.asset(_imagePaths.icStar, width: 15, height: 15, fit: BoxFit.fill)
|
SvgPicture.asset(
|
||||||
|
_imagePaths.icStar,
|
||||||
|
width: 15,
|
||||||
|
height: 15,
|
||||||
|
fit: BoxFit.fill)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
Row(children: [
|
Row(children: [
|
||||||
Expanded(child: _searchStatus ==
|
Expanded(child: _searchStatus == SearchStatus.ACTIVE &&
|
||||||
SearchStatus.ACTIVE && _searchQuery != null &&
|
_searchQuery != null &&
|
||||||
_searchQuery!.value.isNotEmpty
|
_searchQuery!.value.isNotEmpty
|
||||||
? RichTextBuilder(
|
? RichTextBuilder(
|
||||||
_presentationEmail.getPartialContent(),
|
_presentationEmail.getPartialContent(),
|
||||||
_searchQuery!.value,
|
_searchQuery!.value,
|
||||||
const TextStyle(fontSize: 13, color: AppColor.colorContentEmail),
|
const TextStyle(
|
||||||
const TextStyle(fontSize: 13, color: AppColor.colorContentEmail, backgroundColor: AppColor.bgWordSearch)).build()
|
fontSize: 13,
|
||||||
|
color: AppColor.colorContentEmail),
|
||||||
|
const TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: AppColor.colorContentEmail,
|
||||||
|
backgroundColor: AppColor.bgWordSearch)).build()
|
||||||
: Text(
|
: Text(
|
||||||
_presentationEmail.getPartialContent(),
|
_presentationEmail.getPartialContent(),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: const TextStyle(fontSize: 13, color: AppColor.colorContentEmail))
|
style: const TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: AppColor.colorContentEmail))
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
]),
|
]),
|
||||||
@@ -362,7 +434,9 @@ class EmailTileBuilder {
|
|||||||
Widget _buildListTileForDesktop() {
|
Widget _buildListTileForDesktop() {
|
||||||
return StatefulBuilder(builder: (BuildContext context, StateSetter setState) {
|
return StatefulBuilder(builder: (BuildContext context, StateSetter setState) {
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () => _emailActionClick?.call(EmailActionType.preview, _presentationEmail),
|
onTap: () => _emailActionClick?.call(
|
||||||
|
EmailActionType.preview,
|
||||||
|
_presentationEmail),
|
||||||
onHover: (value) => _onHoverItemChanged(value, setState),
|
onHover: (value) => _onHoverItemChanged(value, setState),
|
||||||
child: Stack(alignment: Alignment.bottomCenter, children: [
|
child: Stack(alignment: Alignment.bottomCenter, children: [
|
||||||
Row(children: [
|
Row(children: [
|
||||||
@@ -370,28 +444,42 @@ class EmailTileBuilder {
|
|||||||
padding: const EdgeInsets.only(left: 16, right: 16),
|
padding: const EdgeInsets.only(left: 16, right: 16),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: !_presentationEmail.hasRead
|
child: !_presentationEmail.hasRead
|
||||||
? SvgPicture.asset(_imagePaths.icUnreadStatus, width: 9, height: 9, fit: BoxFit.fill)
|
? SvgPicture.asset(
|
||||||
|
_imagePaths.icUnreadStatus,
|
||||||
|
width: 9, height: 9,
|
||||||
|
fit: BoxFit.fill)
|
||||||
: const SizedBox(width: 9)),
|
: const SizedBox(width: 9)),
|
||||||
buildIconWeb(
|
buildIconWeb(
|
||||||
icon: SvgPicture.asset(
|
icon: SvgPicture.asset(
|
||||||
_presentationEmail.hasStarred ? _imagePaths.icStar : _imagePaths.icUnStar,
|
_presentationEmail.hasStarred
|
||||||
width: 20,
|
? _imagePaths.icStar
|
||||||
height: 20,
|
: _imagePaths.icUnStar,
|
||||||
|
width: 16,
|
||||||
|
height: 16,
|
||||||
fit: BoxFit.fill),
|
fit: BoxFit.fill),
|
||||||
tooltip: _presentationEmail.hasStarred ? AppLocalizations.of(_context).starred : AppLocalizations.of(_context).not_starred,
|
tooltip: _presentationEmail.hasStarred
|
||||||
|
? AppLocalizations.of(_context).starred
|
||||||
|
: AppLocalizations.of(_context).not_starred,
|
||||||
onTap: () => _emailActionClick?.call(
|
onTap: () => _emailActionClick?.call(
|
||||||
_presentationEmail.hasStarred ? EmailActionType.unMarkAsStarred : EmailActionType.markAsStarred,
|
_presentationEmail.hasStarred
|
||||||
|
? EmailActionType.unMarkAsStarred
|
||||||
|
: EmailActionType.markAsStarred,
|
||||||
_presentationEmail)),
|
_presentationEmail)),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (isHoverIcon) {
|
if (isHoverIcon) {
|
||||||
_emailActionClick?.call(EmailActionType.selection, _presentationEmail);
|
_emailActionClick?.call(
|
||||||
|
EmailActionType.selection,
|
||||||
|
_presentationEmail);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onHover: (value) => _onHoverIconChanged(value, setState),
|
onHover: (value) => _onHoverIconChanged(value, setState),
|
||||||
child: _buildAvatarIcon(
|
child: _buildAvatarIcon(
|
||||||
iconSize: 32,
|
iconSize: 32,
|
||||||
textStyle: const TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white),
|
textStyle: const TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Colors.white),
|
||||||
paddingIconSelect: const EdgeInsets.all(5)),
|
paddingIconSelect: const EdgeInsets.all(5)),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
@@ -401,11 +489,21 @@ class EmailTileBuilder {
|
|||||||
? RichTextBuilder(
|
? RichTextBuilder(
|
||||||
_getInformationSender(),
|
_getInformationSender(),
|
||||||
_searchQuery!.value,
|
_searchQuery!.value,
|
||||||
TextStyle(fontSize: 15, color: _buildTextColorForReadEmail(), fontWeight: _buildFontForReadEmail()),
|
TextStyle(
|
||||||
TextStyle(fontSize: 15, color: _buildTextColorForReadEmail(), fontWeight: _buildFontForReadEmail(), backgroundColor: AppColor.bgWordSearch)).build()
|
fontSize: 15,
|
||||||
|
color: _buildTextColorForReadEmail(),
|
||||||
|
fontWeight: _buildFontForReadEmail()),
|
||||||
|
TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
color: _buildTextColorForReadEmail(),
|
||||||
|
fontWeight: _buildFontForReadEmail(),
|
||||||
|
backgroundColor: AppColor.bgWordSearch)).build()
|
||||||
: Text(_getInformationSender(),
|
: Text(_getInformationSender(),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(fontSize: 15, color: _buildTextColorForReadEmail(), fontWeight: _buildFontForReadEmail())),
|
style: TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
color: _buildTextColorForReadEmail(),
|
||||||
|
fontWeight: _buildFontForReadEmail())),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 24),
|
const SizedBox(width: 24),
|
||||||
Expanded(child: _buildSubjectAndContent()),
|
Expanded(child: _buildSubjectAndContent()),
|
||||||
@@ -417,10 +515,13 @@ class EmailTileBuilder {
|
|||||||
]),
|
]),
|
||||||
if ( _selectModeAll == SelectMode.INACTIVE)
|
if ( _selectModeAll == SelectMode.INACTIVE)
|
||||||
Transform(
|
Transform(
|
||||||
transform: Matrix4.translationValues(0.0, 8.5, 0.0),
|
transform: Matrix4.translationValues(0.0, 10, 0.0),
|
||||||
child: const Padding(
|
child: const Padding(
|
||||||
padding: EdgeInsets.only(left: 80),
|
padding: EdgeInsets.only(left: 80),
|
||||||
child: Divider(color: AppColor.lineItemListColor, height: 1, thickness: 0.2)),
|
child: Divider(
|
||||||
|
color: AppColor.lineItemListColor,
|
||||||
|
height: 1,
|
||||||
|
thickness: 0.2)),
|
||||||
)
|
)
|
||||||
]),
|
]),
|
||||||
);
|
);
|
||||||
@@ -435,14 +536,20 @@ class EmailTileBuilder {
|
|||||||
iconPadding: const EdgeInsets.all(5),
|
iconPadding: const EdgeInsets.all(5),
|
||||||
splashRadius: 10,
|
splashRadius: 10,
|
||||||
icon: SvgPicture.asset(
|
icon: SvgPicture.asset(
|
||||||
_presentationEmail.hasRead ? _imagePaths.icRead : _imagePaths.icUnread,
|
_presentationEmail.hasRead
|
||||||
|
? _imagePaths.icRead
|
||||||
|
: _imagePaths.icUnread,
|
||||||
color: AppColor.colorActionButtonHover,
|
color: AppColor.colorActionButtonHover,
|
||||||
width: 16,
|
width: 16,
|
||||||
height: 16,
|
height: 16,
|
||||||
fit: BoxFit.fill),
|
fit: BoxFit.fill),
|
||||||
tooltip: _presentationEmail.hasRead ? AppLocalizations.of(_context).mark_as_unread : AppLocalizations.of(_context).mark_as_read,
|
tooltip: _presentationEmail.hasRead
|
||||||
|
? AppLocalizations.of(_context).mark_as_unread
|
||||||
|
: AppLocalizations.of(_context).mark_as_read,
|
||||||
onTap: () => _emailActionClick?.call(
|
onTap: () => _emailActionClick?.call(
|
||||||
_presentationEmail.hasRead ? EmailActionType.markAsUnread : EmailActionType.markAsRead,
|
_presentationEmail.hasRead
|
||||||
|
? EmailActionType.markAsUnread
|
||||||
|
: EmailActionType.markAsRead,
|
||||||
_presentationEmail)),
|
_presentationEmail)),
|
||||||
const SizedBox(width: 5),
|
const SizedBox(width: 5),
|
||||||
if (_mailboxRole != PresentationMailbox.roleDrafts)
|
if (_mailboxRole != PresentationMailbox.roleDrafts)
|
||||||
@@ -459,7 +566,9 @@ class EmailTileBuilder {
|
|||||||
color: AppColor.colorActionButtonHover,
|
color: AppColor.colorActionButtonHover,
|
||||||
fit: BoxFit.fill),
|
fit: BoxFit.fill),
|
||||||
tooltip: AppLocalizations.of(_context).move,
|
tooltip: AppLocalizations.of(_context).move,
|
||||||
onTap: () => _emailActionClick?.call(EmailActionType.moveToMailbox, _presentationEmail)),
|
onTap: () => _emailActionClick?.call(
|
||||||
|
EmailActionType.moveToMailbox,
|
||||||
|
_presentationEmail)),
|
||||||
const SizedBox(width: 5),
|
const SizedBox(width: 5),
|
||||||
],
|
],
|
||||||
buildIconWeb(
|
buildIconWeb(
|
||||||
@@ -477,7 +586,9 @@ class EmailTileBuilder {
|
|||||||
? AppLocalizations.of(_context).move_to_trash
|
? AppLocalizations.of(_context).move_to_trash
|
||||||
: AppLocalizations.of(_context).delete_permanently,
|
: AppLocalizations.of(_context).delete_permanently,
|
||||||
onTap: () => _emailActionClick?.call(
|
onTap: () => _emailActionClick?.call(
|
||||||
_mailboxRole != PresentationMailbox.roleTrash ? EmailActionType.moveToTrash : EmailActionType.deletePermanently,
|
_mailboxRole != PresentationMailbox.roleTrash
|
||||||
|
? EmailActionType.moveToTrash
|
||||||
|
: EmailActionType.deletePermanently,
|
||||||
_presentationEmail)),
|
_presentationEmail)),
|
||||||
const SizedBox(width: 5),
|
const SizedBox(width: 5),
|
||||||
if (_mailboxRole != PresentationMailbox.roleDrafts)
|
if (_mailboxRole != PresentationMailbox.roleDrafts)
|
||||||
@@ -506,24 +617,40 @@ class EmailTileBuilder {
|
|||||||
|
|
||||||
Widget _buildDateTimeForDesktopScreen() {
|
Widget _buildDateTimeForDesktopScreen() {
|
||||||
return Row(children: [
|
return Row(children: [
|
||||||
if (_searchStatus == SearchStatus.ACTIVE && _presentationEmail.mailboxName.isNotEmpty)
|
if (_searchStatus == SearchStatus.ACTIVE &&
|
||||||
|
_presentationEmail.mailboxName.isNotEmpty)
|
||||||
Container(
|
Container(
|
||||||
margin: const EdgeInsets.only(left: 8),
|
margin: const EdgeInsets.only(left: 8),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
|
||||||
constraints: const BoxConstraints(maxWidth: 100),
|
constraints: const BoxConstraints(maxWidth: 100),
|
||||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: AppColor.backgroundCounterMailboxColor),
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
color: AppColor.backgroundCounterMailboxColor),
|
||||||
child: Text(_presentationEmail.mailboxName,
|
child: Text(_presentationEmail.mailboxName,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: const TextStyle(fontSize: 10, color: AppColor.mailboxTextColor, fontWeight: FontWeight.bold),
|
style: const TextStyle(
|
||||||
|
fontSize: 10,
|
||||||
|
color: AppColor.mailboxTextColor,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
if (_presentationEmail.hasAttachment == true)
|
if (_presentationEmail.hasAttachment == true)
|
||||||
Padding(padding: const EdgeInsets.only(left: 8),
|
Padding(padding: const EdgeInsets.only(left: 8),
|
||||||
child: SvgPicture.asset(_imagePaths.icAttachment, width: 16, height: 16, fit: BoxFit.fill)),
|
child: SvgPicture.asset(
|
||||||
|
_imagePaths.icAttachment,
|
||||||
|
width: 16,
|
||||||
|
height: 16,
|
||||||
|
fit: BoxFit.fill)),
|
||||||
Padding(padding: const EdgeInsets.only(right: 20, left: 8),
|
Padding(padding: const EdgeInsets.only(right: 20, left: 8),
|
||||||
child: Text(_presentationEmail.getReceivedAt(Localizations.localeOf(_context).toLanguageTag()),
|
child: Text(
|
||||||
|
_presentationEmail
|
||||||
|
.getReceivedAt(Localizations.localeOf(_context)
|
||||||
|
.toLanguageTag()),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(fontSize: 13, color: _buildTextColorForReadEmail(), fontWeight: _buildFontForReadEmail())))
|
style: TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: _buildTextColorForReadEmail(),
|
||||||
|
fontWeight: _buildFontForReadEmail())))
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -532,13 +659,26 @@ class EmailTileBuilder {
|
|||||||
if (_presentationEmail.hasAttachment == true)
|
if (_presentationEmail.hasAttachment == true)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 8),
|
padding: const EdgeInsets.only(left: 8),
|
||||||
child: SvgPicture.asset(_imagePaths.icAttachment, width: 16, height: 16, fit: BoxFit.fill)),
|
child: SvgPicture.asset(
|
||||||
|
_imagePaths.icAttachment,
|
||||||
|
width: 16,
|
||||||
|
height: 16,
|
||||||
|
fit: BoxFit.fill)),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(right: 4, left: 8),
|
padding: const EdgeInsets.only(right: 4, left: 8),
|
||||||
child: Text(_presentationEmail.getReceivedAt(Localizations.localeOf(_context).toLanguageTag()),
|
child: Text(
|
||||||
|
_presentationEmail
|
||||||
|
.getReceivedAt(Localizations.localeOf(_context)
|
||||||
|
.toLanguageTag()),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: const TextStyle(fontSize: 13, color: AppColor.colorContentEmail))),
|
style: const TextStyle(
|
||||||
SvgPicture.asset(_imagePaths.icChevron, width: 16, height: 16, fit: BoxFit.fill)
|
fontSize: 13,
|
||||||
|
color: AppColor.colorContentEmail))),
|
||||||
|
SvgPicture.asset(
|
||||||
|
_imagePaths.icChevron,
|
||||||
|
width: 16,
|
||||||
|
height: 16,
|
||||||
|
fit: BoxFit.fill)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -551,24 +691,44 @@ class EmailTileBuilder {
|
|||||||
? RichTextBuilder(
|
? RichTextBuilder(
|
||||||
_presentationEmail.getEmailTitle(),
|
_presentationEmail.getEmailTitle(),
|
||||||
_searchQuery!.value,
|
_searchQuery!.value,
|
||||||
TextStyle(fontSize: 13, color: _buildTextColorForReadEmail(), fontWeight: _buildFontForReadEmail()),
|
TextStyle(
|
||||||
TextStyle(fontSize: 13, backgroundColor: AppColor.bgWordSearch, color: _buildTextColorForReadEmail(), fontWeight: _buildFontForReadEmail())).build()
|
fontSize: 13,
|
||||||
|
color: _buildTextColorForReadEmail(),
|
||||||
|
fontWeight: _buildFontForReadEmail()),
|
||||||
|
TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
backgroundColor: AppColor.bgWordSearch,
|
||||||
|
color: _buildTextColorForReadEmail(),
|
||||||
|
fontWeight: _buildFontForReadEmail())).build()
|
||||||
: Text(_presentationEmail.getEmailTitle(),
|
: Text(_presentationEmail.getEmailTitle(),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(fontSize: 13, color: _buildTextColorForReadEmail(), fontWeight: _buildFontForReadEmail()))
|
style: TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: _buildTextColorForReadEmail(),
|
||||||
|
fontWeight: _buildFontForReadEmail()))
|
||||||
),
|
),
|
||||||
if (_presentationEmail.getEmailTitle().isNotEmpty) const SizedBox(width: 12),
|
if (_presentationEmail.getEmailTitle().isNotEmpty)
|
||||||
|
const SizedBox(width: 12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
child: _isSearchEnabled
|
child: _isSearchEnabled
|
||||||
? RichTextBuilder(
|
? RichTextBuilder(
|
||||||
_presentationEmail.getPartialContent(),
|
_presentationEmail.getPartialContent(),
|
||||||
_searchQuery!.value,
|
_searchQuery!.value,
|
||||||
const TextStyle(fontSize: 13, color: AppColor.colorContentEmail, fontWeight: FontWeight.normal),
|
const TextStyle(
|
||||||
const TextStyle(fontSize: 13, color: AppColor.colorContentEmail, backgroundColor: AppColor.bgWordSearch)).build()
|
fontSize: 13,
|
||||||
|
color: AppColor.colorContentEmail,
|
||||||
|
fontWeight: FontWeight.normal),
|
||||||
|
const TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: AppColor.colorContentEmail,
|
||||||
|
backgroundColor: AppColor.bgWordSearch)).build()
|
||||||
: Text(_presentationEmail.getPartialContent(),
|
: Text(_presentationEmail.getPartialContent(),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: const TextStyle(fontSize: 13, color: AppColor.colorContentEmail, fontWeight: FontWeight.normal))
|
style: const TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: AppColor.colorContentEmail,
|
||||||
|
fontWeight: FontWeight.normal))
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
@@ -580,8 +740,10 @@ class EmailTileBuilder {
|
|||||||
EdgeInsets? paddingIconSelect,
|
EdgeInsets? paddingIconSelect,
|
||||||
TextStyle? textStyle
|
TextStyle? textStyle
|
||||||
}) {
|
}) {
|
||||||
if (isHoverIcon || _presentationEmail.selectMode == SelectMode.ACTIVE
|
if (isHoverIcon ||
|
||||||
|| (_responsiveUtils.isMobile(_context) && _selectModeAll == SelectMode.ACTIVE)) {
|
_presentationEmail.selectMode == SelectMode.ACTIVE ||
|
||||||
|
(_responsiveUtils.isMobile(_context) &&
|
||||||
|
_selectModeAll == SelectMode.ACTIVE)) {
|
||||||
return Container(
|
return Container(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
width: iconSize ?? 48,
|
width: iconSize ?? 48,
|
||||||
@@ -613,7 +775,10 @@ class EmailTileBuilder {
|
|||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
_presentationEmail.getAvatarText(),
|
_presentationEmail.getAvatarText(),
|
||||||
style: textStyle ?? const TextStyle(fontSize: 20, color: Colors.white, fontWeight: FontWeight.w500)
|
style: textStyle ?? const TextStyle(
|
||||||
|
fontSize: 20,
|
||||||
|
color: Colors.white,
|
||||||
|
fontWeight: FontWeight.w500)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -624,7 +789,9 @@ class EmailTileBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Color _buildTextColorForReadEmail() {
|
Color _buildTextColorForReadEmail() {
|
||||||
return _presentationEmail.hasRead ? AppColor.colorContentEmail : AppColor.colorNameEmail;
|
return _presentationEmail.hasRead
|
||||||
|
? AppColor.colorContentEmail
|
||||||
|
: AppColor.colorNameEmail;
|
||||||
}
|
}
|
||||||
|
|
||||||
String _getInformationSender() {
|
String _getInformationSender() {
|
||||||
|
|||||||
Reference in New Issue
Block a user