TF-691 Show mailbox label inside email item of advanced search
This commit is contained in:
@@ -577,7 +577,8 @@ class ThreadView extends GetWidget<ThreadController> with AppLoaderMixin,
|
||||
controller.currentMailbox?.role,
|
||||
controller.mailboxDashBoardController.currentSelectMode.value,
|
||||
controller.searchController.searchState.value.searchStatus,
|
||||
controller.searchQuery)
|
||||
controller.searchQuery,
|
||||
advancedSearchActivated: controller.searchController.isAdvancedSearchHasApply.isTrue)
|
||||
..addOnPressEmailActionClick((action, email) => controller.pressEmailAction(context, action, email))
|
||||
..addOnMoreActionClick((email, position) => _responsiveUtils.isMobile(context)
|
||||
? controller.openContextMenuAction(context, _contextMenuActionTile(context, email))
|
||||
|
||||
@@ -20,6 +20,7 @@ class EmailTileBuilder {
|
||||
final Role? _mailboxRole;
|
||||
final SearchStatus _searchStatus;
|
||||
final SearchQuery? _searchQuery;
|
||||
final bool advancedSearchActivated;
|
||||
|
||||
OnPressEmailActionClick? _emailActionClick;
|
||||
|
||||
@@ -30,6 +31,9 @@ class EmailTileBuilder {
|
||||
this._selectModeAll,
|
||||
this._searchStatus,
|
||||
this._searchQuery,
|
||||
{
|
||||
this.advancedSearchActivated = false
|
||||
}
|
||||
);
|
||||
|
||||
void addOnPressEmailActionClick(OnPressEmailActionClick actionClick) {
|
||||
@@ -159,8 +163,7 @@ class EmailTileBuilder {
|
||||
color: _buildTextColorForReadEmail(),
|
||||
fontWeight: _buildFontForReadEmail()))
|
||||
),
|
||||
if (_searchStatus == SearchStatus.ACTIVE &&
|
||||
_presentationEmail.mailboxName.isNotEmpty)
|
||||
if (_hasMailboxLabel)
|
||||
Container(
|
||||
margin: const EdgeInsets.only(left: 8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
@@ -284,4 +287,10 @@ class EmailTileBuilder {
|
||||
}
|
||||
return _presentationEmail.getSenderName();
|
||||
}
|
||||
|
||||
bool get _hasMailboxLabel {
|
||||
return (_searchStatus == SearchStatus.ACTIVE ||
|
||||
advancedSearchActivated) &&
|
||||
_presentationEmail.mailboxName.isNotEmpty;
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ class EmailTileBuilder {
|
||||
final Role? _mailboxRole;
|
||||
final SearchStatus _searchStatus;
|
||||
final SearchQuery? _searchQuery;
|
||||
final bool advancedSearchActivated;
|
||||
|
||||
OnPressEmailActionClick? _emailActionClick;
|
||||
OnMoreActionClick? _onMoreActionClick;
|
||||
@@ -37,6 +38,9 @@ class EmailTileBuilder {
|
||||
this._selectModeAll,
|
||||
this._searchStatus,
|
||||
this._searchQuery,
|
||||
{
|
||||
this.advancedSearchActivated = false
|
||||
}
|
||||
);
|
||||
|
||||
void addOnPressEmailActionClick(OnPressEmailActionClick actionClick) {
|
||||
@@ -206,8 +210,7 @@ class EmailTileBuilder {
|
||||
fontSize: 13,
|
||||
color: _buildTextColorForReadEmail()))
|
||||
),
|
||||
if (_searchStatus == SearchStatus.ACTIVE &&
|
||||
_presentationEmail.mailboxName.isNotEmpty)
|
||||
if (_hasMailboxLabel)
|
||||
Container(
|
||||
margin: const EdgeInsets.only(left: 8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
@@ -368,8 +371,7 @@ class EmailTileBuilder {
|
||||
fontSize: 13,
|
||||
color: _buildTextColorForReadEmail()))
|
||||
),
|
||||
if (_searchStatus == SearchStatus.ACTIVE &&
|
||||
_presentationEmail.mailboxName.isNotEmpty)
|
||||
if (_hasMailboxLabel)
|
||||
Container(
|
||||
margin: const EdgeInsets.only(left: 8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
@@ -640,8 +642,7 @@ class EmailTileBuilder {
|
||||
|
||||
Widget _buildDateTimeForDesktopScreen() {
|
||||
return Row(children: [
|
||||
if (_searchStatus == SearchStatus.ACTIVE &&
|
||||
_presentationEmail.mailboxName.isNotEmpty)
|
||||
if (_hasMailboxLabel)
|
||||
Container(
|
||||
margin: const EdgeInsets.only(left: 8),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
|
||||
@@ -839,4 +840,10 @@ class EmailTileBuilder {
|
||||
bool get _isSearchEnabled => _searchStatus == SearchStatus.ACTIVE
|
||||
&& _searchQuery != null
|
||||
&& _searchQuery!.value.isNotEmpty;
|
||||
|
||||
bool get _hasMailboxLabel {
|
||||
return (_searchStatus == SearchStatus.ACTIVE ||
|
||||
advancedSearchActivated) &&
|
||||
_presentationEmail.mailboxName.isNotEmpty;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user