TF-174 Order the ThreadView base on ReceivedAt to uniform with load more

This commit is contained in:
Dat PHAM HOANG
2021-10-14 17:03:25 +07:00
committed by Dat H. Pham
parent 630758e11a
commit d8dd5ea31b
4 changed files with 5 additions and 5 deletions
@@ -68,7 +68,7 @@ class SenderAndReceiverInformationTileBuilder {
Padding(
padding: EdgeInsets.only(top: 6),
child: Text(
'${_presentationEmail!.getEmailDateTime(Localizations.localeOf(_context).toLanguageTag(), pattern: 'dd/MM/yyyy h:mm a')}',
'${_presentationEmail!.getReceivedAt(Localizations.localeOf(_context).toLanguageTag(), pattern: 'dd/MM/yyyy h:mm a')}',
style: TextStyle(fontSize: 12, color: AppColor.baseTextColor),
))
],
@@ -62,7 +62,7 @@ class ThreadController extends BaseController {
inMailbox: mailboxDashBoardController.selectedMailbox.value?.id);
Set<Comparator>? get _sortOrder => Set()
..add(EmailComparator(EmailComparatorProperty.sentAt)
..add(EmailComparator(EmailComparatorProperty.receivedAt)
..setIsAscending(false));
AccountId? get _accountId => mailboxDashBoardController.accountId.value;
@@ -99,7 +99,7 @@ class EmailTileBuilder {
Padding(
padding: EdgeInsets.only(right: 4),
child: Text(
'${_presentationEmail.getEmailDateTime(Localizations.localeOf(_context).toLanguageTag())}',
'${_presentationEmail.getReceivedAt(Localizations.localeOf(_context).toLanguageTag())}',
maxLines: 1,
overflow:TextOverflow.ellipsis,
style: TextStyle(
@@ -9,8 +9,8 @@ extension PresentationEmailExtension on PresentationEmail {
int numberOfAllEmailAddress() => to.numberEmailAddress() + cc.numberEmailAddress() + bcc.numberEmailAddress();
String getEmailDateTime(String newLocale, {String? pattern}) {
final emailTime = sentAt ?? receivedAt;
String getReceivedAt(String newLocale, {String? pattern}) {
final emailTime = receivedAt;
if (emailTime != null) {
return emailTime.formatDate(
pattern: pattern ?? emailTime.value.toLocal().toPattern(),