TF-602 Persist size item email when selection on mobile browser
This commit is contained in:
@@ -52,7 +52,7 @@ class EmailTileBuilder {
|
|||||||
|
|
||||||
void _onHoverIconChanged(bool isHover, StateSetter setState) {
|
void _onHoverIconChanged(bool isHover, StateSetter setState) {
|
||||||
if (_debounceTimeIcon?.isActive ?? false) _debounceTimeIcon?.cancel();
|
if (_debounceTimeIcon?.isActive ?? false) _debounceTimeIcon?.cancel();
|
||||||
_debounceTimeIcon = Timer(const Duration(milliseconds: 300), () {
|
_debounceTimeIcon = Timer(const Duration(milliseconds: 100), () {
|
||||||
setState(() {
|
setState(() {
|
||||||
isHoverIcon = isHover;
|
isHoverIcon = isHover;
|
||||||
});
|
});
|
||||||
@@ -61,7 +61,7 @@ class EmailTileBuilder {
|
|||||||
|
|
||||||
void _onHoverItemChanged(bool isHover, StateSetter setState) {
|
void _onHoverItemChanged(bool isHover, StateSetter setState) {
|
||||||
if (_debounceTimeItem?.isActive ?? false) _debounceTimeItem?.cancel();
|
if (_debounceTimeItem?.isActive ?? false) _debounceTimeItem?.cancel();
|
||||||
_debounceTimeItem = Timer(const Duration(milliseconds: 300), () {
|
_debounceTimeItem = Timer(const Duration(milliseconds: 200), () {
|
||||||
setState(() {
|
setState(() {
|
||||||
isHoverItem = isHover;
|
isHoverItem = isHover;
|
||||||
});
|
});
|
||||||
@@ -94,16 +94,7 @@ class EmailTileBuilder {
|
|||||||
: null,
|
: null,
|
||||||
child: tile,
|
child: tile,
|
||||||
);
|
);
|
||||||
} else if (_responsiveUtils.isTabletLarge(_context) || _responsiveUtils.isTablet(_context)) {
|
} else {
|
||||||
return Container(
|
|
||||||
margin: const EdgeInsets.only(top: 3, left: 16, right: 16),
|
|
||||||
padding: const EdgeInsets.only(bottom: 8, right: 8, top: 8),
|
|
||||||
decoration: _selectModeAll == SelectMode.ACTIVE && _presentationEmail.selectMode == SelectMode.ACTIVE
|
|
||||||
? BoxDecoration(borderRadius: BorderRadius.circular(14), color: AppColor.colorItemEmailSelectedDesktop)
|
|
||||||
: BoxDecoration(borderRadius: BorderRadius.circular(0), color: Colors.white),
|
|
||||||
alignment: Alignment.center,
|
|
||||||
child: tile);
|
|
||||||
}else {
|
|
||||||
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),
|
||||||
@@ -116,128 +107,130 @@ class EmailTileBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildListTile() {
|
Widget _buildListTile() {
|
||||||
return Column(children: [
|
return Stack(alignment: Alignment.bottomCenter,
|
||||||
ListTile(
|
children: [
|
||||||
contentPadding: EdgeInsets.zero,
|
InkWell(
|
||||||
onTap: () => _emailActionClick?.call(EmailActionType.preview, _presentationEmail),
|
onTap: () => _emailActionClick?.call(EmailActionType.preview, _presentationEmail),
|
||||||
onLongPress: () => _emailActionClick?.call(EmailActionType.selection, _presentationEmail),
|
onLongPress: () => _emailActionClick?.call(EmailActionType.selection, _presentationEmail),
|
||||||
leading: GestureDetector(
|
child: Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||||
onTap: () => _emailActionClick?.call(
|
InkWell(
|
||||||
_selectModeAll == SelectMode.ACTIVE ? EmailActionType.selection : EmailActionType.preview,
|
onTap: () => _emailActionClick?.call(
|
||||||
_presentationEmail),
|
_selectModeAll == SelectMode.ACTIVE ? EmailActionType.selection : EmailActionType.preview,
|
||||||
child: _buildAvatarIcon(),
|
_presentationEmail),
|
||||||
),
|
child: Padding(
|
||||||
title: Row(children: [
|
padding: const EdgeInsets.only(top: 8, right: 12),
|
||||||
if (!_presentationEmail.hasRead)
|
child: _buildAvatarIcon(),
|
||||||
Padding(
|
),
|
||||||
padding: const EdgeInsets.only(right: 5),
|
),
|
||||||
child: SvgPicture.asset(_imagePaths.icUnreadStatus, width: 9, height: 9, fit: BoxFit.fill)),
|
Expanded(
|
||||||
Expanded(
|
child: Column(children: [
|
||||||
child: _searchStatus == SearchStatus.ACTIVE && _searchQuery != null && _searchQuery!.value.isNotEmpty
|
Row(children: [
|
||||||
? RichTextBuilder(
|
if (!_presentationEmail.hasRead)
|
||||||
_getInformationSender(),
|
Padding(
|
||||||
_searchQuery!.value,
|
padding: const EdgeInsets.only(right: 5),
|
||||||
TextStyle(
|
child: SvgPicture.asset(_imagePaths.icUnreadStatus, width: 9, height: 9, fit: BoxFit.fill)),
|
||||||
fontSize: 15,
|
Expanded(
|
||||||
color: _buildTextColorForReadEmail(),
|
child: _searchStatus == SearchStatus.ACTIVE && _searchQuery != null && _searchQuery!.value.isNotEmpty
|
||||||
fontWeight: _buildFontForReadEmail()),
|
|
||||||
TextStyle(
|
|
||||||
fontSize: 15,
|
|
||||||
color: _buildTextColorForReadEmail(),
|
|
||||||
backgroundColor: AppColor.bgWordSearch,
|
|
||||||
fontWeight: _buildFontForReadEmail())).build()
|
|
||||||
: Text(
|
|
||||||
_getInformationSender(),
|
|
||||||
maxLines: 1,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 15,
|
|
||||||
color: _buildTextColorForReadEmail(),
|
|
||||||
fontWeight: _buildFontForReadEmail()))
|
|
||||||
),
|
|
||||||
if (_presentationEmail.hasAttachment == true)
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 8),
|
|
||||||
child: SvgPicture.asset(_imagePaths.icAttachment, width: 16, height: 16, fit: BoxFit.fill)),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(right: 4, left: 8),
|
|
||||||
child: Text(
|
|
||||||
_presentationEmail.getReceivedAt(Localizations.localeOf(_context).toLanguageTag()),
|
|
||||||
maxLines: 1,
|
|
||||||
style: const TextStyle(fontSize: 13, color: AppColor.colorContentEmail))),
|
|
||||||
SvgPicture.asset(_imagePaths.icChevron, width: 16, height: 16, fit: BoxFit.fill)
|
|
||||||
]),
|
|
||||||
subtitle: Transform(
|
|
||||||
transform: Matrix4.translationValues(0.0, 8.0, 0.0),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.zero,
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
Expanded(child: _searchStatus == SearchStatus.ACTIVE && _searchQuery != null && _searchQuery!.value.isNotEmpty
|
|
||||||
? RichTextBuilder(
|
|
||||||
_presentationEmail.getEmailTitle(),
|
|
||||||
_searchQuery!.value,
|
|
||||||
TextStyle(
|
|
||||||
fontSize: 13,
|
|
||||||
color: _buildTextColorForReadEmail()),
|
|
||||||
TextStyle(
|
|
||||||
fontSize: 13,
|
|
||||||
backgroundColor: AppColor.bgWordSearch,
|
|
||||||
color: _buildTextColorForReadEmail())
|
|
||||||
).build()
|
|
||||||
: Text(
|
|
||||||
_presentationEmail.getEmailTitle(),
|
|
||||||
maxLines: 1,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 13,
|
|
||||||
color: _buildTextColorForReadEmail()))
|
|
||||||
),
|
|
||||||
if (_searchStatus == SearchStatus.ACTIVE && _presentationEmail.mailboxName.isNotEmpty)
|
|
||||||
Container(
|
|
||||||
margin: const EdgeInsets.only(left: 8),
|
|
||||||
padding: const EdgeInsets.only(left: 8, right: 8, top: 3, bottom: 3),
|
|
||||||
constraints: const BoxConstraints(maxWidth: 100),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
color: AppColor.backgroundCounterMailboxColor),
|
|
||||||
child: Text(
|
|
||||||
_presentationEmail.mailboxName,
|
|
||||||
maxLines: 1,
|
|
||||||
style: const TextStyle(fontSize: 10, color: AppColor.mailboxTextColor, fontWeight: FontWeight.bold),
|
|
||||||
)
|
|
||||||
),
|
|
||||||
if (_presentationEmail.hasStarred)
|
|
||||||
SvgPicture.asset(_imagePaths.icStar, width: 15, height: 15, fit: BoxFit.fill),
|
|
||||||
],
|
|
||||||
)),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(top: 8),
|
|
||||||
child: Row(children: [
|
|
||||||
Expanded(child: _searchStatus == SearchStatus.ACTIVE && _searchQuery != null && _searchQuery!.value.isNotEmpty
|
|
||||||
? RichTextBuilder(
|
? RichTextBuilder(
|
||||||
_presentationEmail.getPartialContent(),
|
_getInformationSender(),
|
||||||
_searchQuery!.value,
|
_searchQuery!.value,
|
||||||
const TextStyle(fontSize: 13, color: AppColor.colorContentEmail),
|
TextStyle(
|
||||||
const TextStyle(fontSize: 13, color: AppColor.colorContentEmail, backgroundColor: AppColor.bgWordSearch)).build()
|
fontSize: 15,
|
||||||
|
color: _buildTextColorForReadEmail(),
|
||||||
|
fontWeight: _buildFontForReadEmail()),
|
||||||
|
TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
color: _buildTextColorForReadEmail(),
|
||||||
|
backgroundColor: AppColor.bgWordSearch,
|
||||||
|
fontWeight: _buildFontForReadEmail())).build()
|
||||||
: Text(
|
: Text(
|
||||||
_presentationEmail.getPartialContent(),
|
_getInformationSender(),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: const TextStyle(fontSize: 13, color: AppColor.colorContentEmail))
|
style: TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
color: _buildTextColorForReadEmail(),
|
||||||
|
fontWeight: _buildFontForReadEmail()))
|
||||||
|
),
|
||||||
|
if (_presentationEmail.hasAttachment == true)
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 8),
|
||||||
|
child: SvgPicture.asset(_imagePaths.icAttachment, width: 16, height: 16, fit: BoxFit.fill)),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(right: 4, left: 8),
|
||||||
|
child: Text(
|
||||||
|
_presentationEmail.getReceivedAt(Localizations.localeOf(_context).toLanguageTag()),
|
||||||
|
maxLines: 1,
|
||||||
|
style: const TextStyle(fontSize: 13, color: AppColor.colorContentEmail))),
|
||||||
|
SvgPicture.asset(_imagePaths.icChevron, width: 16, height: 16, fit: BoxFit.fill)
|
||||||
|
]),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Expanded(child: _searchStatus == SearchStatus.ACTIVE && _searchQuery != null && _searchQuery!.value.isNotEmpty
|
||||||
|
? RichTextBuilder(
|
||||||
|
_presentationEmail.getEmailTitle(),
|
||||||
|
_searchQuery!.value,
|
||||||
|
TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: _buildTextColorForReadEmail()),
|
||||||
|
TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
backgroundColor: AppColor.bgWordSearch,
|
||||||
|
color: _buildTextColorForReadEmail())
|
||||||
|
).build()
|
||||||
|
: Text(
|
||||||
|
_presentationEmail.getEmailTitle(),
|
||||||
|
maxLines: 1,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: _buildTextColorForReadEmail()))
|
||||||
|
),
|
||||||
|
if (_searchStatus == SearchStatus.ACTIVE && _presentationEmail.mailboxName.isNotEmpty)
|
||||||
|
Container(
|
||||||
|
margin: const EdgeInsets.only(left: 8),
|
||||||
|
padding: const EdgeInsets.only(left: 8, right: 8, top: 3, bottom: 3),
|
||||||
|
constraints: const BoxConstraints(maxWidth: 100),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
color: AppColor.backgroundCounterMailboxColor),
|
||||||
|
child: Text(
|
||||||
|
_presentationEmail.mailboxName,
|
||||||
|
maxLines: 1,
|
||||||
|
style: const TextStyle(fontSize: 10, color: AppColor.mailboxTextColor, fontWeight: FontWeight.bold),
|
||||||
|
)
|
||||||
),
|
),
|
||||||
])),
|
if (_presentationEmail.hasStarred)
|
||||||
if (_selectModeAll == SelectMode.INACTIVE)
|
SvgPicture.asset(_imagePaths.icStar, width: 15, height: 15, fit: BoxFit.fill),
|
||||||
const Padding(
|
],
|
||||||
padding: EdgeInsets.only(top: 12),
|
),
|
||||||
child: Divider(color: AppColor.lineItemListColor, height: 1, thickness: 0.2)),
|
const SizedBox(height: 8),
|
||||||
],
|
Row(children: [
|
||||||
|
Expanded(child: _searchStatus == SearchStatus.ACTIVE && _searchQuery != null && _searchQuery!.value.isNotEmpty
|
||||||
|
? RichTextBuilder(
|
||||||
|
_presentationEmail.getPartialContent(),
|
||||||
|
_searchQuery!.value,
|
||||||
|
const TextStyle(fontSize: 13, color: AppColor.colorContentEmail),
|
||||||
|
const TextStyle(fontSize: 13, color: AppColor.colorContentEmail, backgroundColor: AppColor.bgWordSearch)).build()
|
||||||
|
: Text(
|
||||||
|
_presentationEmail.getPartialContent(),
|
||||||
|
maxLines: 1,
|
||||||
|
style: const TextStyle(fontSize: 13, color: AppColor.colorContentEmail))
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
)
|
)
|
||||||
|
])
|
||||||
),
|
),
|
||||||
),
|
if (_selectModeAll == SelectMode.INACTIVE)
|
||||||
]);
|
Transform(
|
||||||
|
transform: Matrix4.translationValues(0.0, 10.0, 0.0),
|
||||||
|
child: const Divider(
|
||||||
|
color: AppColor.lineItemListColor,
|
||||||
|
height: 1,
|
||||||
|
thickness: 0.2)),
|
||||||
|
],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildListTileTablet() {
|
Widget _buildListTileTablet() {
|
||||||
@@ -299,65 +292,63 @@ class EmailTileBuilder {
|
|||||||
else
|
else
|
||||||
_buildDateTimeForMobileTabletScreen()
|
_buildDateTimeForMobileTabletScreen()
|
||||||
]),
|
]),
|
||||||
Padding(
|
const SizedBox(height: 8),
|
||||||
padding: const EdgeInsets.only(top: 8),
|
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(
|
||||||
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.only(left: 8, right: 8, top: 3, bottom: 3),
|
constraints: const BoxConstraints(maxWidth: 100),
|
||||||
constraints: const BoxConstraints(maxWidth: 100),
|
decoration: BoxDecoration(
|
||||||
decoration: BoxDecoration(
|
borderRadius: BorderRadius.circular(10),
|
||||||
borderRadius: BorderRadius.circular(10),
|
color: AppColor.backgroundCounterMailboxColor),
|
||||||
color: AppColor.backgroundCounterMailboxColor),
|
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)
|
|
||||||
SvgPicture.asset(_imagePaths.icStar, width: 15, height: 15, fit: BoxFit.fill)
|
|
||||||
],
|
|
||||||
)),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(top: 8),
|
|
||||||
child: Row(children: [
|
|
||||||
Expanded(child: _searchStatus ==
|
|
||||||
SearchStatus.ACTIVE && _searchQuery != null &&
|
|
||||||
_searchQuery!.value.isNotEmpty
|
|
||||||
? RichTextBuilder(
|
|
||||||
_presentationEmail.getPartialContent(),
|
|
||||||
_searchQuery!.value,
|
|
||||||
const TextStyle(fontSize: 13, color: AppColor.colorContentEmail),
|
|
||||||
const TextStyle(fontSize: 13, color: AppColor.colorContentEmail, backgroundColor: AppColor.bgWordSearch)).build()
|
|
||||||
: Text(
|
|
||||||
_presentationEmail.getPartialContent(),
|
|
||||||
maxLines: 1,
|
|
||||||
style: const TextStyle(fontSize: 13, color: AppColor.colorContentEmail))
|
|
||||||
),
|
),
|
||||||
])),
|
if (_presentationEmail.hasStarred)
|
||||||
|
SvgPicture.asset(_imagePaths.icStar, width: 15, height: 15, fit: BoxFit.fill)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
Row(children: [
|
||||||
|
Expanded(child: _searchStatus ==
|
||||||
|
SearchStatus.ACTIVE && _searchQuery != null &&
|
||||||
|
_searchQuery!.value.isNotEmpty
|
||||||
|
? RichTextBuilder(
|
||||||
|
_presentationEmail.getPartialContent(),
|
||||||
|
_searchQuery!.value,
|
||||||
|
const TextStyle(fontSize: 13, color: AppColor.colorContentEmail),
|
||||||
|
const TextStyle(fontSize: 13, color: AppColor.colorContentEmail, backgroundColor: AppColor.bgWordSearch)).build()
|
||||||
|
: Text(
|
||||||
|
_presentationEmail.getPartialContent(),
|
||||||
|
maxLines: 1,
|
||||||
|
style: const TextStyle(fontSize: 13, color: AppColor.colorContentEmail))
|
||||||
|
),
|
||||||
|
]),
|
||||||
]),
|
]),
|
||||||
if (_selectModeAll == SelectMode.INACTIVE)
|
if (_selectModeAll == SelectMode.INACTIVE)
|
||||||
Transform(
|
Transform(
|
||||||
|
|||||||
Reference in New Issue
Block a user