TF-248 Change avatar of item list email
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:core/core.dart';
|
||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
@@ -63,6 +65,8 @@ class ThreadController extends BaseController {
|
||||
final emailListSearch = <PresentationEmail>[].obs;
|
||||
final currentSelectMode = SelectMode.INACTIVE.obs;
|
||||
|
||||
final random = Random();
|
||||
|
||||
bool canLoadMore = true;
|
||||
bool canSearchMore = true;
|
||||
MailboxId? _currentMailboxId;
|
||||
@@ -207,7 +211,10 @@ class ThreadController extends BaseController {
|
||||
|
||||
void _getAllEmailSuccess(GetAllEmailSuccess success) {
|
||||
_currentEmailState = success.currentEmailState;
|
||||
emailList.value = success.emailList;
|
||||
final listEmailHaveAvatarGradientColor = success.emailList
|
||||
.map((email) => email.asAvatarGradientColor(random))
|
||||
.toList();
|
||||
emailList.value = listEmailHaveAvatarGradientColor;
|
||||
}
|
||||
|
||||
void _getAllEmailAction(AccountId accountId, {MailboxId? mailboxId}) {
|
||||
@@ -271,7 +278,10 @@ class ThreadController extends BaseController {
|
||||
|
||||
void _loadMoreEmailsSuccess(LoadMoreEmailsSuccess success) {
|
||||
if (success.emailList.isNotEmpty) {
|
||||
emailList.addAll(success.emailList);
|
||||
final listEmailHaveAvatarGradientColor = success.emailList
|
||||
.map((email) => email.asAvatarGradientColor(random))
|
||||
.toList();
|
||||
emailList.addAll(listEmailHaveAvatarGradientColor);
|
||||
} else {
|
||||
canLoadMore = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user