TF-495 Implement linter for thread view
This commit is contained in:
@@ -3,9 +3,6 @@ import 'package:tmail_ui_user/features/thread/data/model/email_cache.dart';
|
||||
|
||||
extension ListEmailCacheExtension on List<EmailCache> {
|
||||
Map<String, EmailCache> toMap() {
|
||||
return Map<String, EmailCache>.fromIterable(
|
||||
this,
|
||||
key: (emailCache) => emailCache.id,
|
||||
value: (emailCache) => emailCache);
|
||||
return { for (var emailCache in this) emailCache.id : emailCache };
|
||||
}
|
||||
}
|
||||
@@ -30,9 +30,9 @@ class EmailCacheManager {
|
||||
.where((email) => filterOption.filterEmail(email))
|
||||
.toList();
|
||||
if (sort != null) {
|
||||
sort.forEach((comparator) {
|
||||
for (var comparator in sort) {
|
||||
emailList.sortBy(comparator);
|
||||
});
|
||||
}
|
||||
}
|
||||
return emailList;
|
||||
}
|
||||
|
||||
@@ -39,19 +39,19 @@ class ThreadAPI {
|
||||
|
||||
final queryEmailMethod = QueryEmailMethod(accountId);
|
||||
|
||||
if (limit != null) queryEmailMethod..addLimit(limit);
|
||||
if (limit != null) queryEmailMethod.addLimit(limit);
|
||||
|
||||
if (sort != null) queryEmailMethod..addSorts(sort);
|
||||
if (sort != null) queryEmailMethod.addSorts(sort);
|
||||
|
||||
if (filter != null) queryEmailMethod..addFilters(filter);
|
||||
if (filter != null) queryEmailMethod.addFilters(filter);
|
||||
|
||||
final queryEmailInvocation = jmapRequestBuilder.invocation(queryEmailMethod);
|
||||
|
||||
final getEmailMethod = GetEmailMethod(accountId);
|
||||
|
||||
if (properties != null) getEmailMethod..addProperties(properties);
|
||||
if (properties != null) getEmailMethod.addProperties(properties);
|
||||
|
||||
getEmailMethod..addReferenceIds(processingInvocation.createResultReference(
|
||||
getEmailMethod.addReferenceIds(processingInvocation.createResultReference(
|
||||
queryEmailInvocation.methodCallId,
|
||||
ReferencePath.idsPath));
|
||||
|
||||
@@ -66,9 +66,9 @@ class ThreadAPI {
|
||||
getEmailInvocation.methodCallId, GetEmailResponse.deserialize);
|
||||
|
||||
if (sort != null && resultList != null) {
|
||||
sort.forEach((comparator) {
|
||||
resultList..sortEmails(comparator);
|
||||
});
|
||||
for (var comparator in sort) {
|
||||
resultList.sortEmails(comparator);
|
||||
}
|
||||
}
|
||||
|
||||
return EmailsResponse(emailList: resultList?.list, state: resultList?.state);
|
||||
@@ -96,7 +96,7 @@ class ThreadAPI {
|
||||
ReferencePath.updatedPath));
|
||||
|
||||
if (propertiesUpdated != null) {
|
||||
getMailboxUpdated..addProperties(propertiesUpdated);
|
||||
getMailboxUpdated.addProperties(propertiesUpdated);
|
||||
}
|
||||
|
||||
final getEmailCreated = GetEmailMethod(accountId)
|
||||
@@ -105,7 +105,7 @@ class ThreadAPI {
|
||||
ReferencePath.createdPath));
|
||||
|
||||
if (propertiesCreated != null) {
|
||||
getEmailCreated..addProperties(propertiesCreated);
|
||||
getEmailCreated.addProperties(propertiesCreated);
|
||||
}
|
||||
|
||||
final getEmailUpdatedInvocation = jmapRequestBuilder.invocation(getMailboxUpdated);
|
||||
|
||||
@@ -242,9 +242,9 @@ class ThreadRepositoryImpl extends ThreadRepository {
|
||||
}
|
||||
|
||||
@override
|
||||
Stream<EmailsResponse> loadMoreEmails(GetEmailRequest getEmailRequest) async* {
|
||||
Stream<EmailsResponse> loadMoreEmails(GetEmailRequest emailRequest) async* {
|
||||
bench.start('loadMoreEmails in computed');
|
||||
final response = await compute(_getAllEmailsWithoutLastEmailId, getEmailRequest);
|
||||
final response = await compute(_getAllEmailsWithoutLastEmailId, emailRequest);
|
||||
bench.end('loadMoreEmails in computed');
|
||||
await _updateEmailCache(newCreated: response.emailList);
|
||||
yield response;
|
||||
@@ -335,7 +335,7 @@ class ThreadRepositoryImpl extends ThreadRepository {
|
||||
|
||||
final emailsResponse = await mapDataSource[DataSourceType.network]!.getAllEmail(
|
||||
accountId,
|
||||
sort: Set()
|
||||
sort: <Comparator>{}
|
||||
..add(EmailComparator(EmailComparatorProperty.receivedAt)
|
||||
..setIsAscending(false)),
|
||||
filter: EmailFilterCondition(inMailbox: trashMailboxId, before: lastEmail?.receivedAt),
|
||||
|
||||
@@ -9,7 +9,7 @@ class EmptyTrashFolderSuccess extends UIState {
|
||||
}
|
||||
|
||||
class EmptyTrashFolderFailure extends FeatureFailure {
|
||||
final exception;
|
||||
final dynamic exception;
|
||||
|
||||
EmptyTrashFolderFailure(this.exception);
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class GetAllEmailSuccess extends UIState {
|
||||
}
|
||||
|
||||
class GetAllEmailFailure extends FeatureFailure {
|
||||
final exception;
|
||||
final dynamic exception;
|
||||
|
||||
GetAllEmailFailure(this.exception);
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class LoadMoreEmailsSuccess extends UIState {
|
||||
}
|
||||
|
||||
class LoadMoreEmailsFailure extends FeatureFailure {
|
||||
final exception;
|
||||
final dynamic exception;
|
||||
|
||||
LoadMoreEmailsFailure(this.exception);
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ class MarkAsMultipleEmailReadHasSomeEmailFailure extends UIState {
|
||||
}
|
||||
|
||||
class MarkAsMultipleEmailReadFailure extends FeatureFailure {
|
||||
final exception;
|
||||
final dynamic exception;
|
||||
final ReadActions readActions;
|
||||
|
||||
MarkAsMultipleEmailReadFailure(this.exception, this.readActions);
|
||||
|
||||
@@ -31,7 +31,7 @@ class MarkAsStarMultipleEmailHasSomeEmailFailure extends UIState {
|
||||
}
|
||||
|
||||
class MarkAsStarMultipleEmailFailure extends FeatureFailure {
|
||||
final exception;
|
||||
final dynamic exception;
|
||||
final MarkStarAction markStarAction;
|
||||
|
||||
MarkAsStarMultipleEmailFailure(this.exception, this.markStarAction);
|
||||
|
||||
@@ -71,7 +71,7 @@ class MoveMultipleEmailToMailboxHasSomeEmailFailure extends UIState {
|
||||
}
|
||||
|
||||
class MoveMultipleEmailToMailboxFailure extends FeatureFailure {
|
||||
final exception;
|
||||
final dynamic exception;
|
||||
final MoveAction moveAction;
|
||||
final EmailActionType emailActionType;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class RefreshChangesAllEmailSuccess extends UIState {
|
||||
}
|
||||
|
||||
class RefreshChangesAllEmailFailure extends FeatureFailure {
|
||||
final exception;
|
||||
final dynamic exception;
|
||||
|
||||
RefreshChangesAllEmailFailure(this.exception);
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class SearchEmailSuccess extends UIState {
|
||||
}
|
||||
|
||||
class SearchEmailFailure extends FeatureFailure {
|
||||
final exception;
|
||||
final dynamic exception;
|
||||
|
||||
SearchEmailFailure(this.exception);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class SearchMoreEmailSuccess extends UIState {
|
||||
}
|
||||
|
||||
class SearchMoreEmailFailure extends FeatureFailure {
|
||||
final exception;
|
||||
final dynamic exception;
|
||||
|
||||
SearchMoreEmailFailure(this.exception);
|
||||
|
||||
|
||||
@@ -37,11 +37,6 @@ import 'package:tmail_ui_user/features/thread/presentation/thread_controller.dar
|
||||
|
||||
class ThreadBindings extends BaseBindings {
|
||||
|
||||
@override
|
||||
void dependencies() {
|
||||
super.dependencies();
|
||||
}
|
||||
|
||||
@override
|
||||
void bindingsController() {
|
||||
Get.put(ThreadController(
|
||||
|
||||
@@ -104,7 +104,7 @@ class ThreadController extends BaseController {
|
||||
|
||||
SearchQuery? get searchQuery => mailboxDashBoardController.searchQuery;
|
||||
|
||||
Set<Comparator>? get _sortOrder => Set()
|
||||
Set<Comparator>? get _sortOrder => <Comparator>{}
|
||||
..add(EmailComparator(EmailComparatorProperty.receivedAt)
|
||||
..setIsAscending(false));
|
||||
|
||||
@@ -277,7 +277,7 @@ class ThreadController extends BaseController {
|
||||
_currentEmailState = success.currentEmailState;
|
||||
emailList.value = success.emailList;
|
||||
if (listEmailController.hasClients) {
|
||||
listEmailController.animateTo(0, duration: Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
|
||||
listEmailController.animateTo(0, duration: const Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -361,7 +361,7 @@ class ThreadController extends BaseController {
|
||||
void _refreshEmailChanges() {
|
||||
if (isSearchActive()) {
|
||||
if (_accountId != null && searchQuery != null) {
|
||||
final limit = emailListSearch.length > 0 ? UnsignedInt(emailListSearch.length) : ThreadConstants.defaultLimit;
|
||||
final limit = emailListSearch.isNotEmpty ? UnsignedInt(emailListSearch.length) : ThreadConstants.defaultLimit;
|
||||
consumeState(_searchEmailInteractor.execute(
|
||||
_accountId!,
|
||||
limit: limit,
|
||||
@@ -535,7 +535,7 @@ class ThreadController extends BaseController {
|
||||
void openFilterMessagesForTablet(BuildContext context, RelativeRect? position, List<PopupMenuEntry> popupMenuItems) async {
|
||||
await showMenu(
|
||||
context: context,
|
||||
position: position ?? RelativeRect.fromLTRB(16, 40, 16, 16),
|
||||
position: position ?? const RelativeRect.fromLTRB(16, 40, 16, 16),
|
||||
color: Colors.white,
|
||||
elevation: 5,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)),
|
||||
@@ -1054,12 +1054,12 @@ class ThreadController extends BaseController {
|
||||
context: context,
|
||||
barrierColor: AppColor.colorDefaultCupertinoActionSheet,
|
||||
builder: (BuildContext context) => PointerInterceptor(child: (ConfirmDialogBuilder(_imagePaths)
|
||||
..key(Key('confirm_dialog_delete_email_permanently'))
|
||||
..key(const Key('confirm_dialog_delete_email_permanently'))
|
||||
..title(DeleteActionType.single.getTitleDialog(context))
|
||||
..content(DeleteActionType.single.getContentDialog(context))
|
||||
..addIcon(SvgPicture.asset(_imagePaths.icRemoveDialog, fit: BoxFit.fill))
|
||||
..colorConfirmButton(AppColor.colorConfirmActionDialog)
|
||||
..styleTextConfirmButton(TextStyle(fontSize: 17, fontWeight: FontWeight.w500, color: AppColor.colorActionDeleteConfirmDialog))
|
||||
..styleTextConfirmButton(const TextStyle(fontSize: 17, fontWeight: FontWeight.w500, color: AppColor.colorActionDeleteConfirmDialog))
|
||||
..onCloseButtonAction(() => popBack())
|
||||
..onConfirmButtonAction(DeleteActionType.single.getConfirmActionName(context), () => _deleteEmailPermanentlyAction(context, email))
|
||||
..onCancelButtonAction(AppLocalizations.of(context).cancel, () => popBack()))
|
||||
@@ -1086,12 +1086,12 @@ class ThreadController extends BaseController {
|
||||
context: context,
|
||||
barrierColor: AppColor.colorDefaultCupertinoActionSheet,
|
||||
builder: (BuildContext context) => PointerInterceptor(child: (ConfirmDialogBuilder(_imagePaths)
|
||||
..key(Key('confirm_dialog_delete_emails_permanently'))
|
||||
..key(const Key('confirm_dialog_delete_emails_permanently'))
|
||||
..title(actionType.getTitleDialog(context))
|
||||
..content(actionType.getContentDialog(context, count: selectedEmails?.length))
|
||||
..addIcon(SvgPicture.asset(_imagePaths.icRemoveDialog, fit: BoxFit.fill))
|
||||
..colorConfirmButton(AppColor.colorConfirmActionDialog)
|
||||
..styleTextConfirmButton(TextStyle(fontSize: 17, fontWeight: FontWeight.w500, color: AppColor.colorActionDeleteConfirmDialog))
|
||||
..styleTextConfirmButton(const TextStyle(fontSize: 17, fontWeight: FontWeight.w500, color: AppColor.colorActionDeleteConfirmDialog))
|
||||
..onCloseButtonAction(() => popBack())
|
||||
..onConfirmButtonAction(actionType.getConfirmActionName(context), () => _deleteSelectionEmailsPermanentlyAction(actionType))
|
||||
..onCancelButtonAction(AppLocalizations.of(context).cancel, () => popBack()))
|
||||
|
||||
@@ -26,6 +26,8 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
ThreadView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
@@ -35,7 +37,7 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
backgroundColor: _responsiveUtils.isDesktop(context) ? AppColor.colorBgDesktop : Colors.white,
|
||||
body: Row(children: [
|
||||
if ((!kIsWeb && !_responsiveUtils.isMobile(context)) || (kIsWeb && _responsiveUtils.isTabletLarge(context)))
|
||||
VerticalDivider(color: AppColor.lineItemListColor, width: 1, thickness: 0.2),
|
||||
const VerticalDivider(color: AppColor.lineItemListColor, width: 1, thickness: 0.2),
|
||||
Expanded(child: SafeArea(
|
||||
right: _responsiveUtils.isLandscapeMobile(context),
|
||||
left: _responsiveUtils.isLandscapeMobile(context),
|
||||
@@ -45,11 +47,11 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
if (_responsiveUtils.isDesktop(context))
|
||||
Container(
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.only(right: 10, top: 16, bottom: 10, left: 32),
|
||||
padding: const EdgeInsets.only(right: 10, top: 16, bottom: 10, left: 32),
|
||||
child: _buildHeader(context)),
|
||||
Obx(() => !controller.isSearchActive() && !_responsiveUtils.isDesktop(context)
|
||||
? _buildAppBarNormal(context)
|
||||
: SizedBox.shrink()),
|
||||
: const SizedBox.shrink()),
|
||||
_buildSearchInputFormForMobile(context),
|
||||
Container(
|
||||
color: kIsWeb ? AppColor.colorBgDesktop : Colors.white,
|
||||
@@ -57,10 +59,10 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
child: _buildSearchButtonViewForMobile(context)),
|
||||
Obx(() => controller.isMailboxTrash && controller.emailList.isNotEmpty && !controller.isSearchActive()
|
||||
? _buildEmptyTrashButton(context)
|
||||
: SizedBox.shrink()),
|
||||
: const SizedBox.shrink()),
|
||||
Expanded(child: Container(
|
||||
color: kIsWeb ? AppColor.colorBgDesktop : Colors.white,
|
||||
padding: _responsiveUtils.isDesktop(context) ? EdgeInsets.only(left: 32, right: 24, top: 16, bottom: 24) : EdgeInsets.zero,
|
||||
padding: _responsiveUtils.isDesktop(context) ? const EdgeInsets.only(left: 32, right: 24, top: 16, bottom: 24) : EdgeInsets.zero,
|
||||
child: Stack(children: [
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
@@ -92,14 +94,14 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
|
||||
Widget _buildHeader(BuildContext context) {
|
||||
return Row(children: [
|
||||
Obx(() => !controller.isSelectionEnabled() ? _buildListButtonTopBar(context) : SizedBox.shrink()),
|
||||
Obx(() => controller.isSelectionEnabled() ? _buildListButtonSelectionForDesktop(context) : SizedBox.shrink()),
|
||||
SizedBox(width: 16),
|
||||
Obx(() => !controller.isSearchActive() ? Spacer() : SizedBox.shrink()),
|
||||
Obx(() => !controller.isSelectionEnabled() ? _buildListButtonTopBar(context) : const SizedBox.shrink()),
|
||||
Obx(() => controller.isSelectionEnabled() ? _buildListButtonSelectionForDesktop(context) : const SizedBox.shrink()),
|
||||
const SizedBox(width: 16),
|
||||
Obx(() => !controller.isSearchActive() ? const Spacer() : const SizedBox.shrink()),
|
||||
Expanded(child: _buildSearchInputFormForDesktop(context)),
|
||||
_buildSearchButtonViewForDesktop(context),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 16),
|
||||
padding: const EdgeInsets.only(right: 16),
|
||||
child: (AvatarBuilder()
|
||||
..text(controller.mailboxDashBoardController.userProfile.value?.getAvatarText() ?? '')
|
||||
..backgroundColor(Colors.white)
|
||||
@@ -109,7 +111,7 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
context,
|
||||
position,
|
||||
popupMenuUserSettingActionTile(context, () => controller.mailboxDashBoardController.logoutAction())))
|
||||
..addBoxShadows([BoxShadow(
|
||||
..addBoxShadows([const BoxShadow(
|
||||
color: AppColor.colorShadowBgContentEmail,
|
||||
spreadRadius: 1, blurRadius: 1, offset: Offset(0, 0.5))])
|
||||
..size(48))
|
||||
@@ -121,35 +123,35 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
return Row(children: [
|
||||
if (!controller.isSearchActive())
|
||||
(ButtonBuilder(_imagePaths.icRefresh)
|
||||
..key(Key('button_reload_thread'))
|
||||
..key(const Key('button_reload_thread'))
|
||||
..decoration(BoxDecoration(borderRadius: BorderRadius.circular(10), color: AppColor.colorButtonHeaderThread))
|
||||
..paddingIcon(EdgeInsets.zero)
|
||||
..size(16)
|
||||
..radiusSplash(10)
|
||||
..padding(EdgeInsets.symmetric(horizontal: 8, vertical: 8))
|
||||
..padding(const EdgeInsets.symmetric(horizontal: 8, vertical: 8))
|
||||
..onPressActionClick(() => controller.refreshAllEmail()))
|
||||
.build(),
|
||||
if (!controller.isSearchActive()) SizedBox(width: 16),
|
||||
if (!controller.isSearchActive()) const SizedBox(width: 16),
|
||||
(ButtonBuilder(_imagePaths.icSelectAll)
|
||||
..key(Key('button_select_all'))
|
||||
..key(const Key('button_select_all'))
|
||||
..decoration(BoxDecoration(borderRadius: BorderRadius.circular(10), color: AppColor.colorButtonHeaderThread))
|
||||
..paddingIcon(EdgeInsets.only(right: 8))
|
||||
..paddingIcon(const EdgeInsets.only(right: 8))
|
||||
..size(16)
|
||||
..radiusSplash(10)
|
||||
..padding(EdgeInsets.symmetric(horizontal: 12, vertical: 8))
|
||||
..textStyle(TextStyle(fontSize: 12, color: AppColor.colorTextButtonHeaderThread))
|
||||
..padding(const EdgeInsets.symmetric(horizontal: 12, vertical: 8))
|
||||
..textStyle(const TextStyle(fontSize: 12, color: AppColor.colorTextButtonHeaderThread))
|
||||
..onPressActionClick(() => controller.setSelectAllEmailAction())
|
||||
..text(AppLocalizations.of(context).select_all, isVertical: false))
|
||||
.build(),
|
||||
SizedBox(width: 16),
|
||||
const SizedBox(width: 16),
|
||||
(ButtonBuilder(_imagePaths.icMarkAllAsRead)
|
||||
..key(Key('button_mark_all_as_read'))
|
||||
..key(const Key('button_mark_all_as_read'))
|
||||
..decoration(BoxDecoration(borderRadius: BorderRadius.circular(10), color: AppColor.colorButtonHeaderThread))
|
||||
..paddingIcon(EdgeInsets.only(right: 8))
|
||||
..paddingIcon(const EdgeInsets.only(right: 8))
|
||||
..size(16)
|
||||
..padding(EdgeInsets.symmetric(horizontal: 12, vertical: 8))
|
||||
..padding(const EdgeInsets.symmetric(horizontal: 12, vertical: 8))
|
||||
..radiusSplash(10)
|
||||
..textStyle(TextStyle(fontSize: 12, color: AppColor.colorTextButtonHeaderThread))
|
||||
..textStyle(const TextStyle(fontSize: 12, color: AppColor.colorTextButtonHeaderThread))
|
||||
..onPressActionClick(() {
|
||||
final listEmail = controller.isSearchActive()
|
||||
? controller.emailListSearch.allEmailUnread
|
||||
@@ -161,22 +163,22 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
})
|
||||
..text(AppLocalizations.of(context).mark_all_as_read, isVertical: false))
|
||||
.build(),
|
||||
if (!controller.isSearchActive()) SizedBox(width: 16),
|
||||
if (!controller.isSearchActive()) const SizedBox(width: 16),
|
||||
if (!controller.isSearchActive())
|
||||
(ButtonBuilder(_imagePaths.icFilterWeb)
|
||||
..key(Key('button_filter_messages'))
|
||||
..key(const Key('button_filter_messages'))
|
||||
..context(context)
|
||||
..decoration(BoxDecoration(borderRadius: BorderRadius.circular(10), color: AppColor.colorButtonHeaderThread))
|
||||
..paddingIcon(EdgeInsets.only(right: 8))
|
||||
..paddingIcon(const EdgeInsets.only(right: 8))
|
||||
..size(16)
|
||||
..padding(EdgeInsets.symmetric(horizontal: 12, vertical: 8))
|
||||
..padding(const EdgeInsets.symmetric(horizontal: 12, vertical: 8))
|
||||
..radiusSplash(10)
|
||||
..textStyle(TextStyle(
|
||||
fontSize: 12,
|
||||
color: controller.filterMessageOption.value == FilterMessageOption.all ? AppColor.colorTextButtonHeaderThread : AppColor.colorNameEmail,
|
||||
fontWeight: controller.filterMessageOption.value == FilterMessageOption.all ? FontWeight.normal : FontWeight.w500))
|
||||
..addIconAction(Padding(
|
||||
padding: EdgeInsets.only(left: 8),
|
||||
padding: const EdgeInsets.only(left: 8),
|
||||
child: SvgPicture.asset(_imagePaths.icArrowDown, fit: BoxFit.fill)))
|
||||
..addOnPressActionWithPositionClick((position) =>
|
||||
controller.openFilterMessagesForTablet(
|
||||
@@ -198,8 +200,8 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
onTap: () => controller.cancelSelectEmail()),
|
||||
Text(
|
||||
AppLocalizations.of(context).count_email_selected(controller.listEmailSelected.length),
|
||||
style: TextStyle(fontSize: 17, fontWeight: FontWeight.w500, color: AppColor.colorTextButton),),
|
||||
SizedBox(width: 30),
|
||||
style: const TextStyle(fontSize: 17, fontWeight: FontWeight.w500, color: AppColor.colorTextButton),),
|
||||
const SizedBox(width: 30),
|
||||
buildIconWeb(
|
||||
icon: SvgPicture.asset(controller.listEmailSelected.isAllEmailRead ? _imagePaths.icUnread : _imagePaths.icRead, fit: BoxFit.fill),
|
||||
tooltip: controller.listEmailSelected.isAllEmailRead ? AppLocalizations.of(context).mark_as_unread : AppLocalizations.of(context).mark_as_read,
|
||||
@@ -242,9 +244,9 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
return Obx(() {
|
||||
if (controller.isSelectionEnabled() && !_responsiveUtils.isDesktop(context) && controller.listEmailSelected.isNotEmpty) {
|
||||
return Column(children: [
|
||||
Divider(color: AppColor.lineItemListColor, height: 1, thickness: 0.2),
|
||||
const Divider(color: AppColor.lineItemListColor, height: 1, thickness: 0.2),
|
||||
Padding(
|
||||
padding: EdgeInsets.all(10),
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: (BottomBarThreadSelectionWidget(
|
||||
context,
|
||||
_imagePaths,
|
||||
@@ -256,7 +258,7 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
.build()),
|
||||
]);
|
||||
} else {
|
||||
return SizedBox.shrink();
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -266,13 +268,13 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
if (!controller.isSearchActive() && !_responsiveUtils.isDesktop(context)) {
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.only(left: 16, right: 16, bottom: 10),
|
||||
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 10),
|
||||
child: (SearchBarView(_imagePaths)
|
||||
..hintTextSearch(kIsWeb ? AppLocalizations.of(context).search_emails : AppLocalizations.of(context).hint_search_emails)
|
||||
..addOnOpenSearchViewAction(() => controller.enableSearch(context)))
|
||||
.build());
|
||||
} else {
|
||||
return SizedBox.shrink();
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -282,10 +284,10 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
if (controller.isSearchActive() && !_responsiveUtils.isDesktop(context)) {
|
||||
return Column(children: [
|
||||
_buildSearchForm(context),
|
||||
Divider(color: AppColor.lineItemListColor, height: 1, thickness: 0.2),
|
||||
const Divider(color: AppColor.lineItemListColor, height: 1, thickness: 0.2),
|
||||
]);
|
||||
} else {
|
||||
return SizedBox.shrink();
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -294,14 +296,14 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
return Obx(() {
|
||||
if (!controller.isSearchActive() && _responsiveUtils.isDesktop(context)) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(right: 16),
|
||||
padding: const EdgeInsets.only(right: 16),
|
||||
child: (SearchBarView(_imagePaths)
|
||||
..hintTextSearch(AppLocalizations.of(context).search_emails)
|
||||
..maxSizeWidth(240)
|
||||
..addOnOpenSearchViewAction(() => controller.enableSearch(context)))
|
||||
.build());
|
||||
} else {
|
||||
return SizedBox.shrink();
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -311,7 +313,7 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
if (controller.isSearchActive() && _responsiveUtils.isDesktop(context)) {
|
||||
return _buildSearchFormForDesktop(context);
|
||||
} else {
|
||||
return SizedBox.shrink();
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -325,10 +327,10 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
controller.mailboxDashBoardController.searchFocus,
|
||||
controller.mailboxDashBoardController.searchInputController,
|
||||
suggestionSearch: controller.mailboxDashBoardController.suggestionSearch,)
|
||||
..addDecoration(BoxDecoration(
|
||||
..addDecoration(const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||
color: AppColor.colorBgSearchBar))
|
||||
..setMargin(EdgeInsets.only(right: 10))
|
||||
..setMargin(const EdgeInsets.only(right: 10))
|
||||
..setHeightSearchBar(45)
|
||||
..setHintText(AppLocalizations.of(context).search_mail)
|
||||
..addOnCancelSearchPressed(() => controller.disableSearch())
|
||||
@@ -347,8 +349,8 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
controller.mailboxDashBoardController.searchFocus,
|
||||
controller.mailboxDashBoardController.searchInputController,
|
||||
suggestionSearch: controller.mailboxDashBoardController.suggestionSearch,)
|
||||
..addDecoration(BoxDecoration(color: Colors.white))
|
||||
..setMargin(EdgeInsets.only(right: 10))
|
||||
..addDecoration(const BoxDecoration(color: Colors.white))
|
||||
..setMargin(const EdgeInsets.only(right: 10))
|
||||
..setHintText(AppLocalizations.of(context).search_mail)
|
||||
..addOnCancelSearchPressed(() => controller.disableSearch())
|
||||
..addOnClearTextSearchAction(() => controller.mailboxDashBoardController.clearSearchText())
|
||||
@@ -395,9 +397,9 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
alignment: Alignment.bottomRight,
|
||||
child: ScrollingFloatingButtonAnimated(
|
||||
icon: SvgPicture.asset(_imagePaths.icCompose, width: 20, height: 20, fit: BoxFit.fill),
|
||||
text: Padding(padding: EdgeInsets.only(right: 10),
|
||||
text: Padding(padding: const EdgeInsets.only(right: 10),
|
||||
child: Text(AppLocalizations.of(context).compose,
|
||||
style: TextStyle(color: AppColor.colorTextButton, fontSize: 15.0, fontWeight: FontWeight.w500))),
|
||||
style: const TextStyle(color: AppColor.colorTextButton, fontSize: 15.0, fontWeight: FontWeight.w500))),
|
||||
onPress: () => controller.composeEmailAction(),
|
||||
scrollController: controller.listEmailController,
|
||||
color: Colors.white,
|
||||
@@ -408,7 +410,7 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
)
|
||||
);
|
||||
} else {
|
||||
return SizedBox.shrink();
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -425,23 +427,23 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
return CupertinoActionSheetAction(
|
||||
child: Text(
|
||||
AppLocalizations.of(context).cancel,
|
||||
style: TextStyle(fontWeight: FontWeight.w500, fontSize: 20, color: AppColor.colorTextButton)),
|
||||
style: const TextStyle(fontWeight: FontWeight.w500, fontSize: 20, color: AppColor.colorTextButton)),
|
||||
onPressed: () => controller.closeFilterMessageActionSheet(),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _filterMessageWithAttachmentsAction(BuildContext context, FilterMessageOption optionCurrent) {
|
||||
return (FilterMessageCupertinoActionSheetActionBuilder(
|
||||
Key('filter_attachment_action'),
|
||||
const Key('filter_attachment_action'),
|
||||
SvgPicture.asset(_imagePaths.icAttachment, width: 28, height: 28, fit: BoxFit.fill, color: AppColor.colorTextButton),
|
||||
AppLocalizations.of(context).with_attachments,
|
||||
FilterMessageOption.attachments,
|
||||
optionCurrent: optionCurrent,
|
||||
iconLeftPadding: _responsiveUtils.isMobile(context)
|
||||
? EdgeInsets.only(left: 12, right: 16)
|
||||
: EdgeInsets.only(right: 12),
|
||||
? const EdgeInsets.only(left: 12, right: 16)
|
||||
: const EdgeInsets.only(right: 12),
|
||||
iconRightPadding: _responsiveUtils.isMobile(context)
|
||||
? EdgeInsets.only(right: 12)
|
||||
? const EdgeInsets.only(right: 12)
|
||||
: EdgeInsets.zero,
|
||||
actionSelected: SvgPicture.asset(_imagePaths.icFilterSelected, fit: BoxFit.fill))
|
||||
..onActionClick((option) => controller.filterMessagesAction(context, option)))
|
||||
@@ -450,16 +452,16 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
|
||||
Widget _filterMessagesUnreadAction(BuildContext context, FilterMessageOption optionCurrent) {
|
||||
return (FilterMessageCupertinoActionSheetActionBuilder(
|
||||
Key('filter_unread_action'),
|
||||
const Key('filter_unread_action'),
|
||||
SvgPicture.asset(_imagePaths.icUnread, width: 28, height: 28, fit: BoxFit.fill),
|
||||
AppLocalizations.of(context).unread,
|
||||
FilterMessageOption.unread,
|
||||
optionCurrent: optionCurrent,
|
||||
iconLeftPadding: _responsiveUtils.isMobile(context)
|
||||
? EdgeInsets.only(left: 12, right: 16)
|
||||
: EdgeInsets.only(right: 12),
|
||||
? const EdgeInsets.only(left: 12, right: 16)
|
||||
: const EdgeInsets.only(right: 12),
|
||||
iconRightPadding: _responsiveUtils.isMobile(context)
|
||||
? EdgeInsets.only(right: 12)
|
||||
? const EdgeInsets.only(right: 12)
|
||||
: EdgeInsets.zero,
|
||||
actionSelected: SvgPicture.asset(_imagePaths.icFilterSelected, fit: BoxFit.fill))
|
||||
..onActionClick((option) => controller.filterMessagesAction(context, option)))
|
||||
@@ -468,16 +470,16 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
|
||||
Widget _filterMessageStarredAction(BuildContext context, FilterMessageOption optionCurrent) {
|
||||
return (FilterMessageCupertinoActionSheetActionBuilder(
|
||||
Key('filter_starred_action'),
|
||||
const Key('filter_starred_action'),
|
||||
SvgPicture.asset(_imagePaths.icStar, width: 28, height: 28, fit: BoxFit.fill),
|
||||
AppLocalizations.of(context).starred,
|
||||
FilterMessageOption.starred,
|
||||
optionCurrent: optionCurrent,
|
||||
iconLeftPadding: _responsiveUtils.isMobile(context)
|
||||
? EdgeInsets.only(left: 12, right: 16)
|
||||
: EdgeInsets.only(right: 12),
|
||||
? const EdgeInsets.only(left: 12, right: 16)
|
||||
: const EdgeInsets.only(right: 12),
|
||||
iconRightPadding: _responsiveUtils.isMobile(context)
|
||||
? EdgeInsets.only(right: 12)
|
||||
? const EdgeInsets.only(right: 12)
|
||||
: EdgeInsets.zero,
|
||||
actionSelected: SvgPicture.asset(_imagePaths.icFilterSelected, fit: BoxFit.fill))
|
||||
..onActionClick((option) => controller.filterMessagesAction(context, option)))
|
||||
@@ -486,32 +488,32 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
|
||||
List<PopupMenuEntry> _popupMenuEmailActionTile(BuildContext context, FilterMessageOption option) {
|
||||
return [
|
||||
PopupMenuItem(padding: EdgeInsets.symmetric(horizontal: 8), child: _filterMessageWithAttachmentsAction(context, option)),
|
||||
PopupMenuDivider(height: 0.5),
|
||||
PopupMenuItem(padding: EdgeInsets.symmetric(horizontal: 8), child: _filterMessagesUnreadAction(context, option)),
|
||||
PopupMenuDivider(height: 0.5),
|
||||
PopupMenuItem(padding: EdgeInsets.symmetric(horizontal: 8), child: _filterMessageStarredAction(context, option)),
|
||||
PopupMenuItem(padding: const EdgeInsets.symmetric(horizontal: 8), child: _filterMessageWithAttachmentsAction(context, option)),
|
||||
const PopupMenuDivider(height: 0.5),
|
||||
PopupMenuItem(padding: const EdgeInsets.symmetric(horizontal: 8), child: _filterMessagesUnreadAction(context, option)),
|
||||
const PopupMenuDivider(height: 0.5),
|
||||
PopupMenuItem(padding: const EdgeInsets.symmetric(horizontal: 8), child: _filterMessageStarredAction(context, option)),
|
||||
];
|
||||
}
|
||||
|
||||
Widget _buildLoadingView() {
|
||||
return Obx(() => controller.viewState.value.fold(
|
||||
(failure) => SizedBox.shrink(),
|
||||
(failure) => const SizedBox.shrink(),
|
||||
(success) {
|
||||
if (controller.isSearchActive()) {
|
||||
return success is SearchingState
|
||||
? Padding(padding: EdgeInsets.symmetric(vertical: 16), child: _loadingWidget)
|
||||
: SizedBox.shrink();
|
||||
? Padding(padding: const EdgeInsets.symmetric(vertical: 16), child: _loadingWidget)
|
||||
: const SizedBox.shrink();
|
||||
} else {
|
||||
return success is LoadingState
|
||||
? Padding(padding: EdgeInsets.symmetric(vertical: 16), child: _loadingWidget)
|
||||
: SizedBox.shrink();
|
||||
? Padding(padding: const EdgeInsets.symmetric(vertical: 16), child: _loadingWidget)
|
||||
: const SizedBox.shrink();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
Widget get _loadingWidget {
|
||||
return Center(child: Padding(
|
||||
return const Center(child: Padding(
|
||||
padding: EdgeInsets.zero,
|
||||
child: SizedBox(
|
||||
width: 24,
|
||||
@@ -521,16 +523,16 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
|
||||
Widget _buildLoadingViewLoadMore() {
|
||||
return Obx(() => controller.viewState.value.fold(
|
||||
(failure) => SizedBox.shrink(),
|
||||
(failure) => const SizedBox.shrink(),
|
||||
(success) {
|
||||
if (controller.isSearchActive()) {
|
||||
return success is SearchingMoreState
|
||||
? Padding(padding: EdgeInsets.only(bottom: 16), child: _loadingWidget)
|
||||
: SizedBox.shrink();
|
||||
? Padding(padding: const EdgeInsets.only(bottom: 16), child: _loadingWidget)
|
||||
: const SizedBox.shrink();
|
||||
} else {
|
||||
return success is LoadingMoreState
|
||||
? Padding(padding: EdgeInsets.only(bottom: 16), child: _loadingWidget)
|
||||
: SizedBox.shrink();
|
||||
? Padding(padding: const EdgeInsets.only(bottom: 16), child: _loadingWidget)
|
||||
: const SizedBox.shrink();
|
||||
}
|
||||
}));
|
||||
}
|
||||
@@ -546,7 +548,7 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
child: Obx(() {
|
||||
if (controller.isSearchActive()) {
|
||||
if (controller.mailboxDashBoardController.suggestionSearch.isNotEmpty) {
|
||||
return SizedBox.shrink();
|
||||
return const SizedBox.shrink();
|
||||
} else {
|
||||
return _buildResultSearchEmails(context, controller.emailListSearch);
|
||||
}
|
||||
@@ -598,8 +600,8 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
},
|
||||
child: ListView.builder(
|
||||
controller: controller.listEmailController,
|
||||
physics: AlwaysScrollableScrollPhysics(),
|
||||
key: PageStorageKey('list_presentation_email_in_threads'),
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
key: const PageStorageKey('list_presentation_email_in_threads'),
|
||||
itemCount: listPresentationEmail.length,
|
||||
padding: EdgeInsets.only(top: kIsWeb && !_responsiveUtils.isDesktop(context) ? 10 : 0),
|
||||
itemBuilder: (context, index) => Obx(() => (EmailTileBuilder(
|
||||
@@ -620,16 +622,16 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
|
||||
Widget _buildEmptyEmail(BuildContext context) {
|
||||
return Obx(() => controller.viewState.value.fold(
|
||||
(failure) => SizedBox.shrink(),
|
||||
(success) => !(success is LoadingState) && !(success is SearchingState)
|
||||
(failure) => const SizedBox.shrink(),
|
||||
(success) => success is! LoadingState && success is! SearchingState
|
||||
? (BackgroundWidgetBuilder(context)
|
||||
..key(Key('empty_email_background'))
|
||||
..key(const Key('empty_email_background'))
|
||||
..image(SvgPicture.asset(_imagePaths.icEmptyImageDefault, width: 120, height: 120, fit: BoxFit.fill))
|
||||
..text(controller.isSearchActive()
|
||||
? AppLocalizations.of(context).no_emails_matching_your_search
|
||||
: AppLocalizations.of(context).no_emails))
|
||||
.build()
|
||||
: SizedBox.shrink())
|
||||
: const SizedBox.shrink())
|
||||
);
|
||||
}
|
||||
|
||||
@@ -642,29 +644,29 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
..addOnSelectedSuggestion((suggestion) =>
|
||||
controller.mailboxDashBoardController.searchEmail(context, suggestion)))
|
||||
.build()
|
||||
: SizedBox.shrink()
|
||||
: const SizedBox.shrink()
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildStatusResultSearch(BuildContext context) {
|
||||
return Obx(() {
|
||||
if (controller.isSearchActive()) {
|
||||
return controller.emailListSearch.length > 0
|
||||
return controller.emailListSearch.isNotEmpty
|
||||
? Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.symmetric(vertical: 12, horizontal: 24),
|
||||
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 24),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: _responsiveUtils.isDesktop(context)
|
||||
? BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20))
|
||||
? const BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20))
|
||||
: null,
|
||||
color: AppColor.bgStatusResultSearch),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).results,
|
||||
style: TextStyle(color: AppColor.baseTextColor, fontSize: 14, fontWeight: FontWeight.w500),
|
||||
style: const TextStyle(color: AppColor.baseTextColor, fontSize: 14, fontWeight: FontWeight.w500),
|
||||
))
|
||||
: SizedBox.shrink();
|
||||
: const SizedBox.shrink();
|
||||
} else {
|
||||
return SizedBox.shrink();
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -672,7 +674,7 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
Widget _buildEmptyTrashButton(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(14)),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(14)),
|
||||
border: Border.all(color: AppColor.colorLineLeftEmailView),
|
||||
color: Colors.white),
|
||||
margin: EdgeInsets.only(
|
||||
@@ -680,25 +682,25 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
right: _responsiveUtils.isDesktop(context) ? 20 : 16,
|
||||
bottom: _responsiveUtils.isDesktop(context) ? 0 : 16,
|
||||
top: _responsiveUtils.isDesktop(context) ? 16 : 0),
|
||||
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
child: Row(children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 16),
|
||||
padding: const EdgeInsets.only(right: 16),
|
||||
child: SvgPicture.asset(_imagePaths.icDeleteTrash, fit: BoxFit.fill)),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 8),
|
||||
padding: const EdgeInsets.only(left: 8),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).message_delete_all_email_in_trash_button,
|
||||
style: TextStyle(color: AppColor.colorContentEmail, fontSize: 13, fontWeight: FontWeight.w500))),
|
||||
style: const TextStyle(color: AppColor.colorContentEmail, fontSize: 13, fontWeight: FontWeight.w500))),
|
||||
TextButton(
|
||||
onPressed: () => controller.deleteSelectionEmailsPermanently(context, DeleteActionType.all),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).empty_trash_now,
|
||||
style: TextStyle(fontSize: 17, fontWeight: FontWeight.w500, color: AppColor.colorTextButton)
|
||||
style: const TextStyle(fontSize: 17, fontWeight: FontWeight.w500, color: AppColor.colorTextButton)
|
||||
)
|
||||
)
|
||||
]
|
||||
@@ -716,7 +718,7 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
|
||||
Widget _markAsEmailSpamOrUnSpamAction(BuildContext context, PresentationEmail email) {
|
||||
return (EmailActionCupertinoActionSheetActionBuilder(
|
||||
Key('mark_as_spam_or_un_spam_action'),
|
||||
const Key('mark_as_spam_or_un_spam_action'),
|
||||
SvgPicture.asset(
|
||||
controller.currentMailbox?.isSpam == true ? _imagePaths.icNotSpam : _imagePaths.icSpam,
|
||||
width: 28, height: 28, fit: BoxFit.fill, color: AppColor.colorTextButton),
|
||||
@@ -725,10 +727,10 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
: AppLocalizations.of(context).mark_as_spam,
|
||||
email,
|
||||
iconLeftPadding: _responsiveUtils.isMobile(context)
|
||||
? EdgeInsets.only(left: 12, right: 16)
|
||||
: EdgeInsets.only(right: 12),
|
||||
? const EdgeInsets.only(left: 12, right: 16)
|
||||
: const EdgeInsets.only(right: 12),
|
||||
iconRightPadding: _responsiveUtils.isMobile(context)
|
||||
? EdgeInsets.only(right: 12)
|
||||
? const EdgeInsets.only(right: 12)
|
||||
: EdgeInsets.zero)
|
||||
..onActionClick((email) => controller.pressEmailAction(context,
|
||||
controller.currentMailbox?.isSpam == true
|
||||
@@ -740,7 +742,7 @@ class ThreadView extends GetWidget<ThreadController> with UserSettingPopupMenuMi
|
||||
|
||||
List<PopupMenuEntry> _popupMenuActionTile(BuildContext context, PresentationEmail email) {
|
||||
return [
|
||||
PopupMenuItem(padding: EdgeInsets.symmetric(horizontal: 8), child: _markAsEmailSpamOrUnSpamAction(context, email)),
|
||||
PopupMenuItem(padding: const EdgeInsets.symmetric(horizontal: 8), child: _markAsEmailSpamOrUnSpamAction(context, email)),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ class AppActionSheetActionBuilder extends CupertinoActionSheetActionBuilder {
|
||||
key: key,
|
||||
child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||
Padding(
|
||||
padding: iconLeftPadding ?? EdgeInsets.only(left: 12, right: 16),
|
||||
padding: iconLeftPadding ?? const EdgeInsets.only(left: 12, right: 16),
|
||||
child: actionIcon),
|
||||
Expanded(child: Text(actionName, textAlign: TextAlign.left, style: actionTextStyle())),
|
||||
]),
|
||||
|
||||
@@ -61,13 +61,13 @@ class AppBarThreadWidgetBuilder {
|
||||
|
||||
Widget build() {
|
||||
return Container(
|
||||
key: Key('app_bar_thread_widget'),
|
||||
key: const Key('app_bar_thread_widget'),
|
||||
alignment: Alignment.topCenter,
|
||||
color: Colors.white,
|
||||
margin: EdgeInsets.zero,
|
||||
padding: EdgeInsets.only(left: 8, top: 16, bottom: 8, right: 8),
|
||||
padding: const EdgeInsets.only(left: 8, top: 16, bottom: 8, right: 8),
|
||||
child: MediaQuery(
|
||||
data: MediaQueryData(padding: EdgeInsets.zero),
|
||||
data: const MediaQueryData(padding: EdgeInsets.zero),
|
||||
child: kIsWeb
|
||||
? _selectMode == SelectMode.INACTIVE ? _buildBodyAppBarForWeb() : _buildBodyAppBarForWebSelection()
|
||||
: _selectMode == SelectMode.INACTIVE ? _buildBodyAppBarForMobile() : _buildBodyAppBarForMobileSelection()
|
||||
@@ -78,12 +78,12 @@ class AppBarThreadWidgetBuilder {
|
||||
Widget _buildBodyAppBarForWeb() {
|
||||
return Row(children: [
|
||||
if (!_responsiveUtils.isTabletLarge(_context)) _buildMenuButton(),
|
||||
if (_responsiveUtils.isTabletLarge(_context)) SizedBox(width: 16),
|
||||
if (_responsiveUtils.isTabletLarge(_context)) const SizedBox(width: 16),
|
||||
Expanded(child: Text(
|
||||
'${_currentMailbox?.name?.name.capitalizeFirstEach ?? ''}',
|
||||
_currentMailbox?.name?.name.capitalizeFirstEach ?? '',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 21, color: Colors.black, fontWeight: FontWeight.bold))),
|
||||
style: const TextStyle(fontSize: 21, color: Colors.black, fontWeight: FontWeight.bold))),
|
||||
_buildFilterButton(),
|
||||
]);
|
||||
}
|
||||
@@ -96,7 +96,7 @@ class AppBarThreadWidgetBuilder {
|
||||
onTap: () => _onCancelEditThread?.call()),
|
||||
Expanded(child: Text(
|
||||
AppLocalizations.of(_context).count_email_selected(_listSelectionEmail.length),
|
||||
style: TextStyle(fontSize: 17, fontWeight: FontWeight.w500, color: AppColor.colorTextButton))),
|
||||
style: const TextStyle(fontSize: 17, fontWeight: FontWeight.w500, color: AppColor.colorTextButton))),
|
||||
buildIconWeb(
|
||||
icon: SvgPicture.asset(_listSelectionEmail.isAllEmailRead ? _imagePaths.icUnread : _imagePaths.icRead, fit: BoxFit.fill),
|
||||
tooltip: _listSelectionEmail.isAllEmailRead ? AppLocalizations.of(_context).unread : AppLocalizations.of(_context).read,
|
||||
@@ -144,16 +144,16 @@ class AppBarThreadWidgetBuilder {
|
||||
_filterMessageOption.getTitle(_context).isNotEmpty
|
||||
? Column(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 40, right: 40),
|
||||
padding: const EdgeInsets.only(left: 40, right: 40),
|
||||
child: _buildContentCenterAppBar()),
|
||||
Transform(
|
||||
transform: Matrix4.translationValues(_responsiveUtils.isDesktop(_context) ? -2.0 : -16.0, -8.0, 0.0),
|
||||
child: Text(
|
||||
_filterMessageOption.getTitle(_context),
|
||||
style: TextStyle(fontSize: 11, color: AppColor.colorContentEmail)))
|
||||
style: const TextStyle(fontSize: 11, color: AppColor.colorContentEmail)))
|
||||
])
|
||||
: Padding(
|
||||
padding: EdgeInsets.only(left: 60, right: 40),
|
||||
padding: const EdgeInsets.only(left: 60, right: 40),
|
||||
child: _buildContentCenterAppBar()),
|
||||
]
|
||||
))
|
||||
@@ -171,16 +171,16 @@ class AppBarThreadWidgetBuilder {
|
||||
_filterMessageOption.getTitle(_context).isNotEmpty
|
||||
? Column(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 40, right: 40),
|
||||
padding: const EdgeInsets.only(left: 40, right: 40),
|
||||
child: _buildContentCenterAppBar()),
|
||||
Transform(
|
||||
transform: Matrix4.translationValues(_responsiveUtils.isDesktop(_context) ? -2.0 : -16.0, -8.0, 0.0),
|
||||
child: Text(
|
||||
_filterMessageOption.getTitle(_context),
|
||||
style: TextStyle(fontSize: 11, color: AppColor.colorContentEmail)))
|
||||
style: const TextStyle(fontSize: 11, color: AppColor.colorContentEmail)))
|
||||
])
|
||||
: Padding(
|
||||
padding: EdgeInsets.only(left: 60, right: 40),
|
||||
padding: const EdgeInsets.only(left: 60, right: 40),
|
||||
child: _buildContentCenterAppBar()),
|
||||
]
|
||||
))
|
||||
@@ -192,12 +192,12 @@ class AppBarThreadWidgetBuilder {
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.transparent,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(right: 16),
|
||||
padding: const EdgeInsets.only(right: 16),
|
||||
child: TextButton(
|
||||
onPressed: () => _onEditThreadAction?.call(),
|
||||
child: Text(
|
||||
AppLocalizations.of(_context).edit,
|
||||
style: TextStyle(fontSize: 17, color: AppColor.colorTextButton),
|
||||
style: const TextStyle(fontSize: 17, color: AppColor.colorTextButton),
|
||||
),
|
||||
)
|
||||
)
|
||||
@@ -209,7 +209,7 @@ class AppBarThreadWidgetBuilder {
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.transparent,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 16, right: 16),
|
||||
padding: const EdgeInsets.only(left: 16, right: 16),
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
if (_onFilterEmailAction != null && _responsiveUtils.isMobileDevice(_context)) {
|
||||
@@ -258,7 +258,7 @@ class AppBarThreadWidgetBuilder {
|
||||
'${_listSelectionEmail.length}',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 17, color: AppColor.colorTextButton)));
|
||||
style: const TextStyle(fontSize: 17, color: AppColor.colorTextButton)));
|
||||
}
|
||||
|
||||
Widget _buildContentCenterAppBar() {
|
||||
@@ -269,16 +269,16 @@ class AppBarThreadWidgetBuilder {
|
||||
InkWell(
|
||||
onTap: () => !_responsiveUtils.isTabletLarge(_context) ? _onOpenMailboxMenuActionClick?.call() : null,
|
||||
child: Padding(
|
||||
padding: !_responsiveUtils.isTabletLarge(_context) ? EdgeInsets.zero : EdgeInsets.only(bottom: 8, top: 8),
|
||||
padding: !_responsiveUtils.isTabletLarge(_context) ? EdgeInsets.zero : const EdgeInsets.only(bottom: 8, top: 8),
|
||||
child: Container(
|
||||
padding: EdgeInsets.zero,
|
||||
margin: EdgeInsets.zero,
|
||||
constraints: BoxConstraints(maxWidth: _getMaxWidthAppBarTitle()),
|
||||
child: Text(
|
||||
'${_currentMailbox?.name?.name.capitalizeFirstEach ?? ''}',
|
||||
_currentMailbox?.name?.name.capitalizeFirstEach ?? '',
|
||||
maxLines: 1,
|
||||
overflow: GetPlatform.isWeb ? TextOverflow.clip : TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 21, color: AppColor.colorNameEmail, fontWeight: FontWeight.w700))
|
||||
style: const TextStyle(fontSize: 21, color: AppColor.colorNameEmail, fontWeight: FontWeight.w700))
|
||||
))),
|
||||
if (!_responsiveUtils.isTabletLarge(_context))
|
||||
Transform(
|
||||
|
||||
@@ -29,11 +29,11 @@ class BottomBarThreadSelectionWidget {
|
||||
|
||||
Widget build() {
|
||||
return Container(
|
||||
key: Key('bottom_bar_thread_selection_widget'),
|
||||
key: const Key('bottom_bar_thread_selection_widget'),
|
||||
alignment: Alignment.center,
|
||||
color: Colors.white,
|
||||
child: MediaQuery(
|
||||
data: MediaQueryData(padding: EdgeInsets.zero),
|
||||
data: const MediaQueryData(padding: EdgeInsets.zero),
|
||||
child: _buildListOptionButton()
|
||||
)
|
||||
);
|
||||
@@ -45,9 +45,9 @@ class BottomBarThreadSelectionWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(child: (ButtonBuilder(_listSelectionEmail.isAllEmailRead ? _imagePaths.icUnread : _imagePaths.icRead)
|
||||
..key(Key('button_mark_read_email'))
|
||||
..paddingIcon(EdgeInsets.all(8))
|
||||
..textStyle(TextStyle(fontSize: 12, color: AppColor.colorTextButton))
|
||||
..key(const Key('button_mark_read_email'))
|
||||
..paddingIcon(const EdgeInsets.all(8))
|
||||
..textStyle(const TextStyle(fontSize: 12, color: AppColor.colorTextButton))
|
||||
..onPressActionClick(() {
|
||||
if (_onPressEmailSelectionActionClick != null) {
|
||||
_onPressEmailSelectionActionClick!(
|
||||
@@ -59,9 +59,9 @@ class BottomBarThreadSelectionWidget {
|
||||
isVertical: _responsiveUtils.isMobile(_context)))
|
||||
.build()),
|
||||
Expanded(child: (ButtonBuilder(_listSelectionEmail.isAllEmailStarred ? _imagePaths.icUnStar : _imagePaths.icStar)
|
||||
..key(Key('button_mark_as_star_email'))
|
||||
..paddingIcon(EdgeInsets.all(8))
|
||||
..textStyle(TextStyle(fontSize: 12, color: AppColor.colorTextButton))
|
||||
..key(const Key('button_mark_as_star_email'))
|
||||
..paddingIcon(const EdgeInsets.all(8))
|
||||
..textStyle(const TextStyle(fontSize: 12, color: AppColor.colorTextButton))
|
||||
..onPressActionClick(() {
|
||||
if (_onPressEmailSelectionActionClick != null) {
|
||||
_onPressEmailSelectionActionClick!(
|
||||
@@ -73,9 +73,9 @@ class BottomBarThreadSelectionWidget {
|
||||
.build()),
|
||||
if (_currentMailbox?.isDrafts == false)
|
||||
Expanded(child: (ButtonBuilder(_imagePaths.icMove)
|
||||
..key(Key('button_move_to_mailbox'))
|
||||
..paddingIcon(EdgeInsets.all(8))
|
||||
..textStyle(TextStyle(fontSize: 12, color: AppColor.colorTextButton))
|
||||
..key(const Key('button_move_to_mailbox'))
|
||||
..paddingIcon(const EdgeInsets.all(8))
|
||||
..textStyle(const TextStyle(fontSize: 12, color: AppColor.colorTextButton))
|
||||
..onPressActionClick(() {
|
||||
if (_onPressEmailSelectionActionClick != null) {
|
||||
_onPressEmailSelectionActionClick!(EmailActionType.moveToMailbox, _listSelectionEmail);
|
||||
@@ -84,9 +84,9 @@ class BottomBarThreadSelectionWidget {
|
||||
.build()),
|
||||
if (_currentMailbox?.isDrafts == false)
|
||||
Expanded(child: (ButtonBuilder(_currentMailbox?.isSpam == true ? _imagePaths.icNotSpam : _imagePaths.icSpam)
|
||||
..key(Key('button_move_to_spam'))
|
||||
..paddingIcon(EdgeInsets.all(8))
|
||||
..textStyle(TextStyle(fontSize: 12, color: AppColor.colorTextButton))
|
||||
..key(const Key('button_move_to_spam'))
|
||||
..paddingIcon(const EdgeInsets.all(8))
|
||||
..textStyle(const TextStyle(fontSize: 12, color: AppColor.colorTextButton))
|
||||
..onPressActionClick(() {
|
||||
if (_currentMailbox?.isSpam == true) {
|
||||
_onPressEmailSelectionActionClick?.call(EmailActionType.unSpam, _listSelectionEmail);
|
||||
@@ -100,9 +100,9 @@ class BottomBarThreadSelectionWidget {
|
||||
isVertical: _responsiveUtils.isMobile(_context)))
|
||||
.build()),
|
||||
Expanded(child: (ButtonBuilder(_imagePaths.icDelete)
|
||||
..key(Key('button_delete_email'))
|
||||
..paddingIcon(EdgeInsets.all(8))
|
||||
..textStyle(TextStyle(fontSize: 12, color: AppColor.colorTextButton))
|
||||
..key(const Key('button_delete_email'))
|
||||
..paddingIcon(const EdgeInsets.all(8))
|
||||
..textStyle(const TextStyle(fontSize: 12, color: AppColor.colorTextButton))
|
||||
..onPressActionClick(() {
|
||||
if (_currentMailbox?.isTrash == true) {
|
||||
_onPressEmailSelectionActionClick?.call(EmailActionType.deletePermanently, _listSelectionEmail);
|
||||
|
||||
@@ -19,7 +19,7 @@ class EmailContextMenuActionBuilder extends ContextMenuActionBuilder<List<Presen
|
||||
return ListTile(
|
||||
key: key,
|
||||
leading: Padding(
|
||||
padding: EdgeInsets.only(left: 12),
|
||||
padding: const EdgeInsets.only(left: 12),
|
||||
child: actionIcon),
|
||||
title: Text(actionName, style: actionTextStyle()),
|
||||
onTap: () {
|
||||
|
||||
@@ -48,14 +48,14 @@ class EmailTileBuilder {
|
||||
|
||||
Widget build() {
|
||||
return Theme(
|
||||
key: Key('thread_tile'),
|
||||
key: const Key('thread_tile'),
|
||||
data: ThemeData(splashColor: Colors.transparent, highlightColor: Colors.transparent),
|
||||
child: ResponsiveWidget(
|
||||
responsiveUtils: _responsiveUtils,
|
||||
mobile: _buildListTile(),
|
||||
desktop: Container(
|
||||
margin: _selectModeAll == SelectMode.ACTIVE ? EdgeInsets.only(top: 3, left: 8, right: 8) : EdgeInsets.zero,
|
||||
padding: _selectModeAll == SelectMode.ACTIVE ? EdgeInsets.symmetric(vertical: 8) : EdgeInsets.zero,
|
||||
margin: _selectModeAll == SelectMode.ACTIVE ? const EdgeInsets.only(top: 3, left: 8, right: 8) : EdgeInsets.zero,
|
||||
padding: _selectModeAll == SelectMode.ACTIVE ? const EdgeInsets.symmetric(vertical: 8) : EdgeInsets.zero,
|
||||
decoration: _selectModeAll == SelectMode.ACTIVE && _presentationEmail.selectMode == SelectMode.ACTIVE
|
||||
? BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
@@ -70,7 +70,7 @@ class EmailTileBuilder {
|
||||
Widget _buildListTile() {
|
||||
return Container(
|
||||
margin: EdgeInsets.zero,
|
||||
padding: EdgeInsets.only(bottom: 10, left: 16, right: 16),
|
||||
padding: const EdgeInsets.only(bottom: 10, left: 16, right: 16),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(0), color: Colors.white),
|
||||
alignment: Alignment.center,
|
||||
child: Column(children: [
|
||||
@@ -88,39 +88,33 @@ class EmailTileBuilder {
|
||||
children: [
|
||||
if (!_presentationEmail.hasRead)
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 5),
|
||||
padding: const EdgeInsets.only(right: 5),
|
||||
child: SvgPicture.asset(_imagePaths.icUnreadStatus, width: 9, height: 9, fit: BoxFit.fill)),
|
||||
Expanded(
|
||||
child: _searchStatus == SearchStatus.ACTIVE && _searchQuery != null && _searchQuery!.value.isNotEmpty
|
||||
? RichTextBuilder(
|
||||
_getInformationSender(),
|
||||
'${_searchQuery!.value}',
|
||||
TextStyle(fontSize: 15, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600),
|
||||
TextStyle(fontSize: 15, color: AppColor.colorNameEmail, backgroundColor: AppColor.bgWordSearch, fontWeight: FontWeight.w600)).build()
|
||||
_searchQuery!.value,
|
||||
const TextStyle(fontSize: 15, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600),
|
||||
const TextStyle(fontSize: 15, color: AppColor.colorNameEmail, backgroundColor: AppColor.bgWordSearch, fontWeight: FontWeight.w600)).build()
|
||||
: Text(
|
||||
_getInformationSender(),
|
||||
maxLines: 1,
|
||||
overflow:TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 15, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600))
|
||||
style: const TextStyle(fontSize: 15, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600))
|
||||
),
|
||||
if (_presentationEmail.hasAttachment == true)
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 8),
|
||||
child: (ButtonBuilder(_imagePaths.icAttachment)
|
||||
..paddingIcon(EdgeInsets.zero)
|
||||
..size(16))
|
||||
.build()),
|
||||
padding: const EdgeInsets.only(left: 8),
|
||||
child: SvgPicture.asset(_imagePaths.icAttachment, width: 16, height: 16, fit: BoxFit.fill)),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 4, left: 8),
|
||||
padding: const EdgeInsets.only(right: 4, left: 8),
|
||||
child: Text(
|
||||
'${_presentationEmail.getReceivedAt(Localizations.localeOf(_context).toLanguageTag())}',
|
||||
_presentationEmail.getReceivedAt(Localizations.localeOf(_context).toLanguageTag()),
|
||||
maxLines: 1,
|
||||
overflow:TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 13, color: AppColor.colorContentEmail))),
|
||||
(ButtonBuilder(_imagePaths.icChevron)
|
||||
..paddingIcon(EdgeInsets.zero)
|
||||
..size(16))
|
||||
.build(),
|
||||
style: const TextStyle(fontSize: 13, color: AppColor.colorContentEmail))),
|
||||
SvgPicture.asset(_imagePaths.icChevron, width: 16, height: 16, fit: BoxFit.fill),
|
||||
],
|
||||
),
|
||||
subtitle: Transform(
|
||||
@@ -136,52 +130,49 @@ class EmailTileBuilder {
|
||||
children: [
|
||||
Expanded(child: _searchStatus == SearchStatus.ACTIVE && _searchQuery != null && _searchQuery!.value.isNotEmpty
|
||||
? RichTextBuilder(
|
||||
'${_presentationEmail.getEmailTitle()}',
|
||||
'${_searchQuery!.value}',
|
||||
TextStyle(fontSize: 13, color: AppColor.colorNameEmail),
|
||||
TextStyle(fontSize: 13, backgroundColor: AppColor.bgWordSearch, color: AppColor.colorNameEmail)).build()
|
||||
_presentationEmail.getEmailTitle(),
|
||||
_searchQuery!.value,
|
||||
const TextStyle(fontSize: 13, color: AppColor.colorNameEmail),
|
||||
const TextStyle(fontSize: 13, backgroundColor: AppColor.bgWordSearch, color: AppColor.colorNameEmail)).build()
|
||||
: Text(
|
||||
'${_presentationEmail.getEmailTitle()}',
|
||||
_presentationEmail.getEmailTitle(),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 13, color: AppColor.colorNameEmail))
|
||||
style: const TextStyle(fontSize: 13, color: AppColor.colorNameEmail))
|
||||
),
|
||||
if (_searchStatus == SearchStatus.ACTIVE && _presentationEmail.mailboxName.isNotEmpty)
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 8),
|
||||
padding: EdgeInsets.only(left: 8, right: 8, top: 3, bottom: 3),
|
||||
constraints: BoxConstraints(maxWidth: 100),
|
||||
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}',
|
||||
_presentationEmail.mailboxName,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 10, color: AppColor.mailboxTextColor, fontWeight: FontWeight.bold),
|
||||
style: const TextStyle(fontSize: 10, color: AppColor.mailboxTextColor, fontWeight: FontWeight.bold),
|
||||
)
|
||||
),
|
||||
if (_presentationEmail.hasStarred)
|
||||
(ButtonBuilder(_imagePaths.icStar)
|
||||
..paddingIcon(EdgeInsets.zero)
|
||||
..size(15))
|
||||
.build(),
|
||||
SvgPicture.asset(_imagePaths.icStar, width: 15, height: 15, fit: BoxFit.fill)
|
||||
],
|
||||
)),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 8),
|
||||
padding: const EdgeInsets.only(top: 8),
|
||||
child: Row(children: [
|
||||
Expanded(child: _searchStatus == SearchStatus.ACTIVE && _searchQuery != null && _searchQuery!.value.isNotEmpty
|
||||
? RichTextBuilder(
|
||||
'${_presentationEmail.getPartialContent()}',
|
||||
'${_searchQuery!.value}',
|
||||
TextStyle(fontSize: 13, color: AppColor.colorContentEmail),
|
||||
TextStyle(fontSize: 13, color: AppColor.colorContentEmail, backgroundColor: AppColor.bgWordSearch)).build()
|
||||
_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()}',
|
||||
_presentationEmail.getPartialContent(),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 13, color: AppColor.colorContentEmail))
|
||||
style: const TextStyle(fontSize: 13, color: AppColor.colorContentEmail))
|
||||
),
|
||||
])
|
||||
),
|
||||
@@ -189,7 +180,7 @@ class EmailTileBuilder {
|
||||
)
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(top: 12, right: 12),
|
||||
child: Divider(color: AppColor.lineItemListColor, height: 1, thickness: 0.2)),
|
||||
]),
|
||||
@@ -203,11 +194,11 @@ class EmailTileBuilder {
|
||||
child: Column(children: [
|
||||
Row(children: [
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 16, right: 16),
|
||||
padding: const EdgeInsets.only(left: 16, right: 16),
|
||||
alignment: Alignment.center,
|
||||
child: !_presentationEmail.hasRead
|
||||
? SvgPicture.asset(_imagePaths.icUnreadStatus, width: 9, height: 9, fit: BoxFit.fill)
|
||||
: SizedBox(width: 9)),
|
||||
: const SizedBox(width: 9)),
|
||||
buildIconWeb(
|
||||
icon: SvgPicture.asset(
|
||||
_presentationEmail.hasStarred ? _imagePaths.icStar : _imagePaths.icUnStar,
|
||||
@@ -218,61 +209,58 @@ class EmailTileBuilder {
|
||||
onTap: () => _emailActionClick?.call(
|
||||
_presentationEmail.hasStarred ? EmailActionType.unMarkAsStarred : EmailActionType.markAsStarred,
|
||||
_presentationEmail)),
|
||||
if (_selectModeAll == SelectMode.INACTIVE) SizedBox(width: 8),
|
||||
if (_selectModeAll == SelectMode.INACTIVE) const SizedBox(width: 8),
|
||||
GestureDetector(
|
||||
onTap: () => _emailActionClick?.call(
|
||||
_selectModeAll == SelectMode.ACTIVE ? EmailActionType.selection : EmailActionType.preview,
|
||||
_presentationEmail),
|
||||
child: _buildAvatarIcon(
|
||||
iconSize: 32,
|
||||
textStyle: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white),
|
||||
paddingIconSelect: EdgeInsets.all(5)),
|
||||
textStyle: const TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white),
|
||||
paddingIconSelect: const EdgeInsets.all(5)),
|
||||
),
|
||||
if (_selectModeAll == SelectMode.INACTIVE) SizedBox(width: 10),
|
||||
Container(
|
||||
if (_selectModeAll == SelectMode.INACTIVE) const SizedBox(width: 10),
|
||||
SizedBox(
|
||||
width: 160,
|
||||
child: _isSearchEnabled
|
||||
? RichTextBuilder(
|
||||
_getInformationSender(),
|
||||
'${_searchQuery!.value}',
|
||||
TextStyle(fontSize: 15, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600),
|
||||
TextStyle(fontSize: 15, color: AppColor.colorNameEmail, backgroundColor: AppColor.bgWordSearch, fontWeight: FontWeight.w600)).build()
|
||||
: Text('${_getInformationSender()}',
|
||||
_searchQuery!.value,
|
||||
const TextStyle(fontSize: 15, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600),
|
||||
const TextStyle(fontSize: 15, color: AppColor.colorNameEmail, backgroundColor: AppColor.bgWordSearch, fontWeight: FontWeight.w600)).build()
|
||||
: Text(_getInformationSender(),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 15, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600)),
|
||||
style: const TextStyle(fontSize: 15, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600)),
|
||||
),
|
||||
SizedBox(width: 24),
|
||||
const SizedBox(width: 24),
|
||||
Expanded(child: _buildSubjectAndContent()),
|
||||
SizedBox(width: 16),
|
||||
const SizedBox(width: 16),
|
||||
if (_searchStatus == SearchStatus.ACTIVE && _presentationEmail.mailboxName.isNotEmpty)
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 8),
|
||||
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 3),
|
||||
constraints: BoxConstraints(maxWidth: 80),
|
||||
margin: const EdgeInsets.only(left: 8),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
|
||||
constraints: const BoxConstraints(maxWidth: 80),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: AppColor.backgroundCounterMailboxColor),
|
||||
child: Text('${_presentationEmail.mailboxName}',
|
||||
child: Text(_presentationEmail.mailboxName,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 10, color: AppColor.mailboxTextColor, fontWeight: FontWeight.bold),
|
||||
style: const TextStyle(fontSize: 10, color: AppColor.mailboxTextColor, fontWeight: FontWeight.bold),
|
||||
)
|
||||
),
|
||||
if (_presentationEmail.hasAttachment == true)
|
||||
Padding(padding: EdgeInsets.only(left: 8),
|
||||
child: (ButtonBuilder(_imagePaths.icAttachment)
|
||||
..paddingIcon(EdgeInsets.zero)
|
||||
..size(16))
|
||||
.build()),
|
||||
Padding(padding: const EdgeInsets.only(left: 8),
|
||||
child: SvgPicture.asset(_imagePaths.icAttachment, width: 16, height: 16, fit: BoxFit.fill)),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 20, left: 8),
|
||||
child: Text('${_presentationEmail.getReceivedAt(Localizations.localeOf(_context).toLanguageTag())}',
|
||||
padding: const EdgeInsets.only(right: 20, left: 8),
|
||||
child: Text(_presentationEmail.getReceivedAt(Localizations.localeOf(_context).toLanguageTag()),
|
||||
maxLines: 1,
|
||||
textAlign: TextAlign.right,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 13, color: AppColor.colorContentEmail, fontWeight: FontWeight.normal))),
|
||||
style: const TextStyle(fontSize: 13, color: AppColor.colorContentEmail, fontWeight: FontWeight.normal))),
|
||||
]),
|
||||
if (_selectModeAll == SelectMode.INACTIVE)
|
||||
Padding(
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(top: 7.5, bottom: 7.5, left: 70),
|
||||
child: Divider(color: AppColor.lineItemListColor, height: 1, thickness: 0.2)),
|
||||
]),
|
||||
@@ -286,28 +274,28 @@ class EmailTileBuilder {
|
||||
constraints: BoxConstraints(maxWidth: constraints.maxWidth / 2),
|
||||
child: _isSearchEnabled
|
||||
? RichTextBuilder(
|
||||
'${_presentationEmail.getEmailTitle()}',
|
||||
'${_searchQuery!.value}',
|
||||
TextStyle(fontSize: 13, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600),
|
||||
TextStyle(fontSize: 13, backgroundColor: AppColor.bgWordSearch, color: AppColor.colorNameEmail)).build()
|
||||
: Text('${_presentationEmail.getEmailTitle()}',
|
||||
_presentationEmail.getEmailTitle(),
|
||||
_searchQuery!.value,
|
||||
const TextStyle(fontSize: 13, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600),
|
||||
const TextStyle(fontSize: 13, backgroundColor: AppColor.bgWordSearch, color: AppColor.colorNameEmail)).build()
|
||||
: Text(_presentationEmail.getEmailTitle(),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 13, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600))
|
||||
style: const TextStyle(fontSize: 13, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600))
|
||||
),
|
||||
if (_presentationEmail.getEmailTitle().isNotEmpty) SizedBox(width: 12),
|
||||
if (_presentationEmail.getEmailTitle().isNotEmpty) const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: _isSearchEnabled
|
||||
? RichTextBuilder(
|
||||
'${_presentationEmail.getPartialContent()}',
|
||||
'${_searchQuery!.value}',
|
||||
TextStyle(fontSize: 13, color: AppColor.colorContentEmail, fontWeight: FontWeight.normal),
|
||||
TextStyle(fontSize: 13, color: AppColor.colorContentEmail, backgroundColor: AppColor.bgWordSearch)).build()
|
||||
: Text('${_presentationEmail.getPartialContent()}',
|
||||
_presentationEmail.getPartialContent(),
|
||||
_searchQuery!.value,
|
||||
const TextStyle(fontSize: 13, color: AppColor.colorContentEmail, fontWeight: FontWeight.normal),
|
||||
const TextStyle(fontSize: 13, color: AppColor.colorContentEmail, backgroundColor: AppColor.bgWordSearch)).build()
|
||||
: Text(_presentationEmail.getPartialContent(),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 13, color: AppColor.colorContentEmail, fontWeight: FontWeight.normal))
|
||||
style: const TextStyle(fontSize: 13, color: AppColor.colorContentEmail, fontWeight: FontWeight.normal))
|
||||
)
|
||||
),
|
||||
]);
|
||||
@@ -322,17 +310,29 @@ class EmailTileBuilder {
|
||||
if (_selectModeAll == SelectMode.ACTIVE) {
|
||||
return Tooltip(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(12),
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: SvgPicture.asset(_presentationEmail.selectMode == SelectMode.ACTIVE ? _imagePaths.icSelected : _imagePaths.icUnSelected, fit: BoxFit.fill)),
|
||||
message: AppLocalizations.of(_context).select);
|
||||
} else {
|
||||
return (AvatarBuilder()
|
||||
..text('${_presentationEmail.getAvatarText()}')
|
||||
..size(iconSize ?? 56)
|
||||
..textColor(Colors.white)
|
||||
..addTextStyle(textStyle)
|
||||
..avatarColor(_presentationEmail.avatarColors))
|
||||
.build();
|
||||
return Container(
|
||||
width: iconSize ?? 56,
|
||||
height: iconSize ?? 56,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular((iconSize ?? 56) * 0.5),
|
||||
border: Border.all(color: Colors.transparent),
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
stops: const [0.0, 1.0],
|
||||
colors: _presentationEmail.avatarColors),
|
||||
color: AppColor.avatarColor
|
||||
),
|
||||
child: Text(
|
||||
_presentationEmail.getAvatarText(),
|
||||
style: textStyle ?? const TextStyle(fontSize: 20, color: Colors.white, fontWeight: FontWeight.w500)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -340,9 +340,9 @@ class EmailTileBuilder {
|
||||
if (_mailboxRole == PresentationMailbox.roleSent
|
||||
|| _mailboxRole == PresentationMailbox.roleDrafts
|
||||
|| _mailboxRole == PresentationMailbox.roleOutbox) {
|
||||
return '${_presentationEmail.recipientsName()}';
|
||||
return _presentationEmail.recipientsName();
|
||||
}
|
||||
return '${_presentationEmail.getSenderName()}';
|
||||
return _presentationEmail.getSenderName();
|
||||
}
|
||||
|
||||
bool get _isSearchEnabled => _searchStatus == SearchStatus.ACTIVE
|
||||
|
||||
@@ -47,17 +47,17 @@ class EmailTileBuilder {
|
||||
|
||||
Widget build() {
|
||||
return Theme(
|
||||
key: Key('thread_tile'),
|
||||
key: const Key('thread_tile'),
|
||||
data: ThemeData(splashColor: Colors.transparent, highlightColor: Colors.transparent),
|
||||
child: ResponsiveWidget(
|
||||
responsiveUtils: _responsiveUtils,
|
||||
mobile: Container(
|
||||
margin: _selectModeAll == SelectMode.ACTIVE
|
||||
? EdgeInsets.only(top: 3, left: 16, right: 16)
|
||||
? const EdgeInsets.only(top: 3, left: 16, right: 16)
|
||||
: EdgeInsets.zero,
|
||||
padding: _selectModeAll == SelectMode.ACTIVE
|
||||
? EdgeInsets.only(top: 8, bottom: 16, right: 8)
|
||||
: EdgeInsets.only(bottom: 10, left: 16, right: 16),
|
||||
? const EdgeInsets.only(top: 8, bottom: 16, right: 8)
|
||||
: const EdgeInsets.only(bottom: 10, left: 16, right: 16),
|
||||
decoration: _selectModeAll == SelectMode.ACTIVE && _presentationEmail.selectMode == SelectMode.ACTIVE
|
||||
? BoxDecoration(borderRadius: BorderRadius.circular(14), color: AppColor.colorItemEmailSelectedDesktop)
|
||||
: BoxDecoration(borderRadius: BorderRadius.circular(0), color: Colors.white),
|
||||
@@ -65,11 +65,11 @@ class EmailTileBuilder {
|
||||
child: _buildListTile()),
|
||||
tablet: Container(
|
||||
margin: _selectModeAll == SelectMode.ACTIVE
|
||||
? EdgeInsets.only(top: 3, left: 16, right: 16)
|
||||
? const EdgeInsets.only(top: 3, left: 16, right: 16)
|
||||
: EdgeInsets.zero,
|
||||
padding: _selectModeAll == SelectMode.ACTIVE
|
||||
? EdgeInsets.only(top: 8, bottom: 16, right: 8)
|
||||
: EdgeInsets.only(bottom: 10, left: 16, right: 16),
|
||||
? const EdgeInsets.only(top: 8, bottom: 16, right: 8)
|
||||
: const EdgeInsets.only(bottom: 10, left: 16, right: 16),
|
||||
decoration: _selectModeAll == SelectMode.ACTIVE && _presentationEmail.selectMode == SelectMode.ACTIVE
|
||||
? BoxDecoration(borderRadius: BorderRadius.circular(14), color: AppColor.colorItemEmailSelectedDesktop)
|
||||
: BoxDecoration(borderRadius: BorderRadius.circular(0), color: Colors.white),
|
||||
@@ -77,19 +77,19 @@ class EmailTileBuilder {
|
||||
child: _buildListTileTabletLarge()),
|
||||
tabletLarge: Container(
|
||||
margin: _selectModeAll == SelectMode.ACTIVE
|
||||
? EdgeInsets.only(top: 3, left: 16, right: 16)
|
||||
? const EdgeInsets.only(top: 3, left: 16, right: 16)
|
||||
: EdgeInsets.zero,
|
||||
padding: _selectModeAll == SelectMode.ACTIVE
|
||||
? EdgeInsets.only(top: 8, bottom: 16, right: 8)
|
||||
: EdgeInsets.only(bottom: 10, left: 16, right: 16),
|
||||
? const EdgeInsets.only(top: 8, bottom: 16, right: 8)
|
||||
: const EdgeInsets.only(bottom: 10, left: 16, right: 16),
|
||||
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: _buildListTileTabletLarge()),
|
||||
desktop: Container(
|
||||
margin: _selectModeAll == SelectMode.ACTIVE ? EdgeInsets.only(top: 3, left: 8, right: 8) : EdgeInsets.zero,
|
||||
padding: _selectModeAll == SelectMode.ACTIVE ? EdgeInsets.symmetric(vertical: 8) : EdgeInsets.zero,
|
||||
margin: _selectModeAll == SelectMode.ACTIVE ? const EdgeInsets.only(top: 3, left: 8, right: 8) : EdgeInsets.zero,
|
||||
padding: _selectModeAll == SelectMode.ACTIVE ? const EdgeInsets.symmetric(vertical: 8) : EdgeInsets.zero,
|
||||
decoration: _selectModeAll == SelectMode.ACTIVE && _presentationEmail.selectMode == SelectMode.ACTIVE
|
||||
? BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
@@ -116,37 +116,31 @@ class EmailTileBuilder {
|
||||
title: Row(children: [
|
||||
if (!_presentationEmail.hasRead)
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 5),
|
||||
padding: const EdgeInsets.only(right: 5),
|
||||
child: SvgPicture.asset(_imagePaths.icUnreadStatus, width: 9, height: 9, fit: BoxFit.fill)),
|
||||
Expanded(
|
||||
child: _searchStatus == SearchStatus.ACTIVE && _searchQuery != null && _searchQuery!.value.isNotEmpty
|
||||
? RichTextBuilder(
|
||||
_getInformationSender(),
|
||||
'${_searchQuery!.value}',
|
||||
TextStyle(fontSize: 15, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600),
|
||||
TextStyle(fontSize: 15, color: AppColor.colorNameEmail, backgroundColor: AppColor.bgWordSearch, fontWeight: FontWeight.w600)).build()
|
||||
_searchQuery!.value,
|
||||
const TextStyle(fontSize: 15, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600),
|
||||
const TextStyle(fontSize: 15, color: AppColor.colorNameEmail, backgroundColor: AppColor.bgWordSearch, fontWeight: FontWeight.w600)).build()
|
||||
: Text(
|
||||
_getInformationSender(),
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 15, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600))
|
||||
style: const TextStyle(fontSize: 15, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600))
|
||||
),
|
||||
if (_presentationEmail.hasAttachment == true)
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 8),
|
||||
child: (ButtonBuilder(_imagePaths.icAttachment)
|
||||
..paddingIcon(EdgeInsets.zero)
|
||||
..size(16))
|
||||
.build()),
|
||||
padding: const EdgeInsets.only(left: 8),
|
||||
child: SvgPicture.asset(_imagePaths.icAttachment, width: 16, height: 16, fit: BoxFit.fill)),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 4, left: 8),
|
||||
padding: const EdgeInsets.only(right: 4, left: 8),
|
||||
child: Text(
|
||||
'${_presentationEmail.getReceivedAt(Localizations.localeOf(_context).toLanguageTag())}',
|
||||
_presentationEmail.getReceivedAt(Localizations.localeOf(_context).toLanguageTag()),
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 13, color: AppColor.colorContentEmail))),
|
||||
(ButtonBuilder(_imagePaths.icChevron)
|
||||
..paddingIcon(EdgeInsets.zero)
|
||||
..size(16))
|
||||
.build(),
|
||||
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),
|
||||
@@ -161,53 +155,50 @@ class EmailTileBuilder {
|
||||
children: [
|
||||
Expanded(child: _searchStatus == SearchStatus.ACTIVE && _searchQuery != null && _searchQuery!.value.isNotEmpty
|
||||
? RichTextBuilder(
|
||||
'${_presentationEmail.getEmailTitle()}',
|
||||
'${_searchQuery!.value}',
|
||||
TextStyle(fontSize: 13, color: AppColor.colorNameEmail),
|
||||
TextStyle(fontSize: 13, backgroundColor: AppColor.bgWordSearch, color: AppColor.colorNameEmail)).build()
|
||||
_presentationEmail.getEmailTitle(),
|
||||
_searchQuery!.value,
|
||||
const TextStyle(fontSize: 13, color: AppColor.colorNameEmail),
|
||||
const TextStyle(fontSize: 13, backgroundColor: AppColor.bgWordSearch, color: AppColor.colorNameEmail)).build()
|
||||
: Text(
|
||||
'${_presentationEmail.getEmailTitle()}',
|
||||
_presentationEmail.getEmailTitle(),
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 13, color: AppColor.colorNameEmail))
|
||||
style: const TextStyle(fontSize: 13, color: AppColor.colorNameEmail))
|
||||
),
|
||||
if (_searchStatus == SearchStatus.ACTIVE && _presentationEmail.mailboxName.isNotEmpty)
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 8),
|
||||
padding: EdgeInsets.only(left: 8, right: 8, top: 3, bottom: 3),
|
||||
constraints: BoxConstraints(maxWidth: 100),
|
||||
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}',
|
||||
_presentationEmail.mailboxName,
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 10, color: AppColor.mailboxTextColor, fontWeight: FontWeight.bold),
|
||||
style: const TextStyle(fontSize: 10, color: AppColor.mailboxTextColor, fontWeight: FontWeight.bold),
|
||||
)
|
||||
),
|
||||
if (_presentationEmail.hasStarred)
|
||||
(ButtonBuilder(_imagePaths.icStar)
|
||||
..paddingIcon(EdgeInsets.zero)
|
||||
..size(15))
|
||||
.build(),
|
||||
SvgPicture.asset(_imagePaths.icStar, width: 15, height: 15, fit: BoxFit.fill),
|
||||
],
|
||||
)),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 8),
|
||||
padding: const EdgeInsets.only(top: 8),
|
||||
child: Row(children: [
|
||||
Expanded(child: _searchStatus == SearchStatus.ACTIVE && _searchQuery != null && _searchQuery!.value.isNotEmpty
|
||||
? RichTextBuilder(
|
||||
'${_presentationEmail.getPartialContent()}',
|
||||
'${_searchQuery!.value}',
|
||||
TextStyle(fontSize: 13, color: AppColor.colorContentEmail),
|
||||
TextStyle(fontSize: 13, color: AppColor.colorContentEmail, backgroundColor: AppColor.bgWordSearch)).build()
|
||||
_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()}',
|
||||
_presentationEmail.getPartialContent(),
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 13, color: AppColor.colorContentEmail))
|
||||
style: const TextStyle(fontSize: 13, color: AppColor.colorContentEmail))
|
||||
),
|
||||
])),
|
||||
if (_selectModeAll == SelectMode.INACTIVE)
|
||||
Padding(
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(top: 12),
|
||||
child: Divider(color: AppColor.lineItemListColor, height: 1, thickness: 0.2)),
|
||||
],
|
||||
@@ -225,32 +216,32 @@ class EmailTileBuilder {
|
||||
onHover: (value) => setState(() => isHoverItem = value),
|
||||
child: Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 8),
|
||||
padding: const EdgeInsets.only(top: 8),
|
||||
child: GestureDetector(
|
||||
onTap: () => _emailActionClick?.call(
|
||||
_selectModeAll == SelectMode.ACTIVE ? EmailActionType.selection : EmailActionType.preview,
|
||||
_presentationEmail),
|
||||
child: _buildAvatarIcon())),
|
||||
SizedBox(width: 12),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(child: Column(children: [
|
||||
Transform(
|
||||
transform: Matrix4.translationValues(0.0, isHoverItem ? -10.0 : 0.0, 0.0),
|
||||
child: Row(children: [
|
||||
if (!_presentationEmail.hasRead)
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 5),
|
||||
padding: const EdgeInsets.only(right: 5),
|
||||
child: SvgPicture.asset(_imagePaths.icUnreadStatus, width: 9, height: 9, fit: BoxFit.fill)),
|
||||
Expanded(
|
||||
child: _searchStatus == SearchStatus.ACTIVE && _searchQuery != null && _searchQuery!.value.isNotEmpty
|
||||
? RichTextBuilder(
|
||||
_getInformationSender(),
|
||||
'${_searchQuery!.value}',
|
||||
TextStyle(fontSize: 15, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600),
|
||||
TextStyle(fontSize: 15, color: AppColor.colorNameEmail, backgroundColor: AppColor.bgWordSearch, fontWeight: FontWeight.w600)).build()
|
||||
_searchQuery!.value,
|
||||
const TextStyle(fontSize: 15, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600),
|
||||
const TextStyle(fontSize: 15, color: AppColor.colorNameEmail, backgroundColor: AppColor.bgWordSearch, fontWeight: FontWeight.w600)).build()
|
||||
: Text(
|
||||
_getInformationSender(),
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 15, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600))
|
||||
style: const TextStyle(fontSize: 15, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600))
|
||||
),
|
||||
if (isHoverItem)
|
||||
_buildListActionButtonWhenHover()
|
||||
@@ -270,55 +261,52 @@ class EmailTileBuilder {
|
||||
children: [
|
||||
Expanded(child: _searchStatus == SearchStatus.ACTIVE && _searchQuery != null && _searchQuery!.value.isNotEmpty
|
||||
? RichTextBuilder(
|
||||
'${_presentationEmail.getEmailTitle()}',
|
||||
'${_searchQuery!.value}',
|
||||
TextStyle(fontSize: 13, color: AppColor.colorNameEmail),
|
||||
TextStyle(fontSize: 13, backgroundColor: AppColor.bgWordSearch, color: AppColor.colorNameEmail)).build()
|
||||
_presentationEmail.getEmailTitle(),
|
||||
_searchQuery!.value,
|
||||
const TextStyle(fontSize: 13, color: AppColor.colorNameEmail),
|
||||
const TextStyle(fontSize: 13, backgroundColor: AppColor.bgWordSearch, color: AppColor.colorNameEmail)).build()
|
||||
: Text(
|
||||
'${_presentationEmail.getEmailTitle()}',
|
||||
_presentationEmail.getEmailTitle(),
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 13, color: AppColor.colorNameEmail))
|
||||
style: const TextStyle(fontSize: 13, color: AppColor.colorNameEmail))
|
||||
),
|
||||
if (_searchStatus == SearchStatus.ACTIVE && _presentationEmail.mailboxName.isNotEmpty)
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 8),
|
||||
padding: EdgeInsets.only(left: 8, right: 8, top: 3, bottom: 3),
|
||||
constraints: BoxConstraints(maxWidth: 100),
|
||||
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}',
|
||||
_presentationEmail.mailboxName,
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 10, color: AppColor.mailboxTextColor, fontWeight: FontWeight.bold),
|
||||
style: const TextStyle(fontSize: 10, color: AppColor.mailboxTextColor, fontWeight: FontWeight.bold),
|
||||
)
|
||||
),
|
||||
if (_presentationEmail.hasStarred)
|
||||
(ButtonBuilder(_imagePaths.icStar)
|
||||
..paddingIcon(EdgeInsets.zero)
|
||||
..size(15))
|
||||
.build(),
|
||||
SvgPicture.asset(_imagePaths.icStar, width: 15, height: 15, fit: BoxFit.fill)
|
||||
],
|
||||
)),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 8),
|
||||
padding: const EdgeInsets.only(top: 8),
|
||||
child: Row(children: [
|
||||
Expanded(child: _searchStatus ==
|
||||
SearchStatus.ACTIVE && _searchQuery != null &&
|
||||
_searchQuery!.value.isNotEmpty
|
||||
? RichTextBuilder(
|
||||
'${_presentationEmail.getPartialContent()}',
|
||||
'${_searchQuery!.value}',
|
||||
TextStyle(fontSize: 13, color: AppColor.colorContentEmail),
|
||||
TextStyle(fontSize: 13, color: AppColor.colorContentEmail, backgroundColor: AppColor.bgWordSearch)).build()
|
||||
_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()}',
|
||||
_presentationEmail.getPartialContent(),
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 13, color: AppColor.colorContentEmail))
|
||||
style: const TextStyle(fontSize: 13, color: AppColor.colorContentEmail))
|
||||
),
|
||||
])),
|
||||
if (_selectModeAll == SelectMode.INACTIVE)
|
||||
Padding(
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(top: 12),
|
||||
child: Divider(color: AppColor.lineItemListColor, height: 1, thickness: 0.2)),
|
||||
],
|
||||
@@ -339,11 +327,11 @@ class EmailTileBuilder {
|
||||
child: Column(children: [
|
||||
Row(children: [
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 16, right: 16),
|
||||
padding: const EdgeInsets.only(left: 16, right: 16),
|
||||
alignment: Alignment.center,
|
||||
child: !_presentationEmail.hasRead
|
||||
? SvgPicture.asset(_imagePaths.icUnreadStatus, width: 9, height: 9, fit: BoxFit.fill)
|
||||
: SizedBox(width: 9)),
|
||||
: const SizedBox(width: 9)),
|
||||
buildIconWeb(
|
||||
icon: SvgPicture.asset(
|
||||
_presentationEmail.hasStarred ? _imagePaths.icStar : _imagePaths.icUnStar,
|
||||
@@ -354,7 +342,7 @@ class EmailTileBuilder {
|
||||
onTap: () => _emailActionClick?.call(
|
||||
_presentationEmail.hasStarred ? EmailActionType.unMarkAsStarred : EmailActionType.markAsStarred,
|
||||
_presentationEmail)),
|
||||
if (_selectModeAll == SelectMode.INACTIVE) SizedBox(width: 8),
|
||||
if (_selectModeAll == SelectMode.INACTIVE) const SizedBox(width: 8),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
if (_selectModeAll == SelectMode.ACTIVE) {
|
||||
@@ -365,32 +353,32 @@ class EmailTileBuilder {
|
||||
},
|
||||
child: _buildAvatarIcon(
|
||||
iconSize: 32,
|
||||
textStyle: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white),
|
||||
paddingIconSelect: EdgeInsets.all(5)),
|
||||
textStyle: const TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white),
|
||||
paddingIconSelect: const EdgeInsets.all(5)),
|
||||
),
|
||||
if (_selectModeAll == SelectMode.INACTIVE) SizedBox(width: 10),
|
||||
Container(
|
||||
if (_selectModeAll == SelectMode.INACTIVE) const SizedBox(width: 10),
|
||||
SizedBox(
|
||||
width: 160,
|
||||
child: _isSearchEnabled
|
||||
? RichTextBuilder(
|
||||
_getInformationSender(),
|
||||
'${_searchQuery!.value}',
|
||||
TextStyle(fontSize: 15, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600),
|
||||
TextStyle(fontSize: 15, color: AppColor.colorNameEmail, backgroundColor: AppColor.bgWordSearch, fontWeight: FontWeight.w600)).build()
|
||||
: Text('${_getInformationSender()}',
|
||||
_searchQuery!.value,
|
||||
const TextStyle(fontSize: 15, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600),
|
||||
const TextStyle(fontSize: 15, color: AppColor.colorNameEmail, backgroundColor: AppColor.bgWordSearch, fontWeight: FontWeight.w600)).build()
|
||||
: Text(_getInformationSender(),
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 15, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600)),
|
||||
style: const TextStyle(fontSize: 15, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600)),
|
||||
),
|
||||
SizedBox(width: 24),
|
||||
const SizedBox(width: 24),
|
||||
Expanded(child: _buildSubjectAndContent()),
|
||||
SizedBox(width: 16),
|
||||
const SizedBox(width: 16),
|
||||
if (isHoverItem)
|
||||
_buildListActionButtonWhenHover()
|
||||
else
|
||||
_buildDateTimeForDesktopScreen()
|
||||
]),
|
||||
if (_selectModeAll == SelectMode.INACTIVE)
|
||||
Padding(
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(top: 7.5, bottom: 7.5, left: 70),
|
||||
child: Divider(color: AppColor.lineItemListColor, height: 1, thickness: 0.2)),
|
||||
]),
|
||||
@@ -454,7 +442,7 @@ class EmailTileBuilder {
|
||||
_onMoreActionClick?.call(_presentationEmail, position);
|
||||
}
|
||||
}),
|
||||
if (_responsiveUtils.isDesktop(_context)) SizedBox(width: 16),
|
||||
if (_responsiveUtils.isDesktop(_context)) const SizedBox(width: 16),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -462,25 +450,22 @@ class EmailTileBuilder {
|
||||
return Row(children: [
|
||||
if (_searchStatus == SearchStatus.ACTIVE && _presentationEmail.mailboxName.isNotEmpty)
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 8),
|
||||
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 3),
|
||||
constraints: BoxConstraints(maxWidth: 100),
|
||||
margin: const EdgeInsets.only(left: 8),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
|
||||
constraints: const BoxConstraints(maxWidth: 100),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: AppColor.backgroundCounterMailboxColor),
|
||||
child: Text('${_presentationEmail.mailboxName}',
|
||||
child: Text(_presentationEmail.mailboxName,
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 10, color: AppColor.mailboxTextColor, fontWeight: FontWeight.bold),
|
||||
style: const TextStyle(fontSize: 10, color: AppColor.mailboxTextColor, fontWeight: FontWeight.bold),
|
||||
)
|
||||
),
|
||||
if (_presentationEmail.hasAttachment == true)
|
||||
Padding(padding: EdgeInsets.only(left: 8),
|
||||
child: (ButtonBuilder(_imagePaths.icAttachment)
|
||||
..paddingIcon(EdgeInsets.zero)
|
||||
..size(16))
|
||||
.build()),
|
||||
Padding(padding: EdgeInsets.only(right: 20, left: 8),
|
||||
child: Text('${_presentationEmail.getReceivedAt(Localizations.localeOf(_context).toLanguageTag())}',
|
||||
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: 20, left: 8),
|
||||
child: Text(_presentationEmail.getReceivedAt(Localizations.localeOf(_context).toLanguageTag()),
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 13, color: AppColor.colorContentEmail, fontWeight: FontWeight.normal)))
|
||||
style: const TextStyle(fontSize: 13, color: AppColor.colorContentEmail, fontWeight: FontWeight.normal)))
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -488,20 +473,14 @@ class EmailTileBuilder {
|
||||
return Row(children: [
|
||||
if (_presentationEmail.hasAttachment == true)
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 8),
|
||||
child: (ButtonBuilder(_imagePaths.icAttachment)
|
||||
..paddingIcon(EdgeInsets.zero)
|
||||
..size(16))
|
||||
.build()),
|
||||
padding: const EdgeInsets.only(left: 8),
|
||||
child: SvgPicture.asset(_imagePaths.icAttachment, width: 16, height: 16, fit: BoxFit.fill)),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 4, left: 8),
|
||||
child: Text('${_presentationEmail.getReceivedAt(Localizations.localeOf(_context).toLanguageTag())}',
|
||||
padding: const EdgeInsets.only(right: 4, left: 8),
|
||||
child: Text(_presentationEmail.getReceivedAt(Localizations.localeOf(_context).toLanguageTag()),
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 13, color: AppColor.colorContentEmail))),
|
||||
(ButtonBuilder(_imagePaths.icChevron)
|
||||
..paddingIcon(EdgeInsets.zero)
|
||||
..size(16))
|
||||
.build()
|
||||
style: const TextStyle(fontSize: 13, color: AppColor.colorContentEmail))),
|
||||
SvgPicture.asset(_imagePaths.icChevron, width: 16, height: 16, fit: BoxFit.fill)
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -512,26 +491,26 @@ class EmailTileBuilder {
|
||||
constraints: BoxConstraints(maxWidth: constraints.maxWidth / 2),
|
||||
child: _isSearchEnabled
|
||||
? RichTextBuilder(
|
||||
'${_presentationEmail.getEmailTitle()}',
|
||||
'${_searchQuery!.value}',
|
||||
TextStyle(fontSize: 13, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600),
|
||||
TextStyle(fontSize: 13, backgroundColor: AppColor.bgWordSearch, color: AppColor.colorNameEmail)).build()
|
||||
: Text('${_presentationEmail.getEmailTitle()}',
|
||||
_presentationEmail.getEmailTitle(),
|
||||
_searchQuery!.value,
|
||||
const TextStyle(fontSize: 13, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600),
|
||||
const TextStyle(fontSize: 13, backgroundColor: AppColor.bgWordSearch, color: AppColor.colorNameEmail)).build()
|
||||
: Text(_presentationEmail.getEmailTitle(),
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 13, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600))
|
||||
style: const TextStyle(fontSize: 13, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600))
|
||||
),
|
||||
if (_presentationEmail.getEmailTitle().isNotEmpty) SizedBox(width: 12),
|
||||
if (_presentationEmail.getEmailTitle().isNotEmpty) const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: _isSearchEnabled
|
||||
? RichTextBuilder(
|
||||
'${_presentationEmail.getPartialContent()}',
|
||||
'${_searchQuery!.value}',
|
||||
TextStyle(fontSize: 13, color: AppColor.colorContentEmail, fontWeight: FontWeight.normal),
|
||||
TextStyle(fontSize: 13, color: AppColor.colorContentEmail, backgroundColor: AppColor.bgWordSearch)).build()
|
||||
: Text('${_presentationEmail.getPartialContent()}',
|
||||
_presentationEmail.getPartialContent(),
|
||||
_searchQuery!.value,
|
||||
const TextStyle(fontSize: 13, color: AppColor.colorContentEmail, fontWeight: FontWeight.normal),
|
||||
const TextStyle(fontSize: 13, color: AppColor.colorContentEmail, backgroundColor: AppColor.bgWordSearch)).build()
|
||||
: Text(_presentationEmail.getPartialContent(),
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 13, color: AppColor.colorContentEmail, fontWeight: FontWeight.normal))
|
||||
style: const TextStyle(fontSize: 13, color: AppColor.colorContentEmail, fontWeight: FontWeight.normal))
|
||||
)
|
||||
),
|
||||
]);
|
||||
@@ -546,17 +525,29 @@ class EmailTileBuilder {
|
||||
if (_selectModeAll == SelectMode.ACTIVE) {
|
||||
return Tooltip(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(12),
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: SvgPicture.asset(_presentationEmail.selectMode == SelectMode.ACTIVE ? _imagePaths.icSelected : _imagePaths.icUnSelected, fit: BoxFit.fill)),
|
||||
message: AppLocalizations.of(_context).select);
|
||||
} else {
|
||||
return (AvatarBuilder()
|
||||
..text('${_presentationEmail.getAvatarText()}')
|
||||
..size(iconSize ?? 48)
|
||||
..textColor(Colors.white)
|
||||
..addTextStyle(textStyle)
|
||||
..avatarColor(_presentationEmail.avatarColors))
|
||||
.build();
|
||||
return Container(
|
||||
width: iconSize ?? 48,
|
||||
height: iconSize ?? 48,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular((iconSize ?? 48) * 0.5),
|
||||
border: Border.all(color: Colors.transparent),
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
stops: const [0.0, 1.0],
|
||||
colors: _presentationEmail.avatarColors),
|
||||
color: AppColor.avatarColor
|
||||
),
|
||||
child: Text(
|
||||
_presentationEmail.getAvatarText(),
|
||||
style: textStyle ?? const TextStyle(fontSize: 20, color: Colors.white, fontWeight: FontWeight.w500)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -564,9 +555,9 @@ class EmailTileBuilder {
|
||||
if (_mailboxRole == PresentationMailbox.roleSent
|
||||
|| _mailboxRole == PresentationMailbox.roleDrafts
|
||||
|| _mailboxRole == PresentationMailbox.roleOutbox) {
|
||||
return '${_presentationEmail.recipientsName()}';
|
||||
return _presentationEmail.recipientsName();
|
||||
}
|
||||
return '${_presentationEmail.getSenderName()}';
|
||||
return _presentationEmail.getSenderName();
|
||||
}
|
||||
|
||||
bool get _isSearchEnabled => _searchStatus == SearchStatus.ACTIVE
|
||||
|
||||
+2
-2
@@ -36,12 +36,12 @@ class FilterMessageCupertinoActionSheetActionBuilder extends CupertinoActionShee
|
||||
key: key,
|
||||
child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||
Padding(
|
||||
padding: iconLeftPadding ?? EdgeInsets.only(left: 12, right: 16),
|
||||
padding: iconLeftPadding ?? const EdgeInsets.only(left: 12, right: 16),
|
||||
child: actionIcon),
|
||||
Expanded(child: Text(actionName, textAlign: TextAlign.left, style: actionTextStyle())),
|
||||
if (optionCurrent == option && actionSelected != null)
|
||||
Padding(
|
||||
padding: iconRightPadding ?? EdgeInsets.only(right: 12),
|
||||
padding: iconRightPadding ?? const EdgeInsets.only(right: 12),
|
||||
child: actionSelected!),
|
||||
]),
|
||||
onPressed: () {
|
||||
|
||||
@@ -88,13 +88,13 @@ class SearchAppBarWidget {
|
||||
|
||||
Widget build() {
|
||||
return Container(
|
||||
key: Key('search_app_bar_widget'),
|
||||
key: const Key('search_app_bar_widget'),
|
||||
height: _heightSearchBar,
|
||||
decoration: _decoration,
|
||||
padding: _padding ?? EdgeInsets.zero,
|
||||
margin: _margin,
|
||||
child: MediaQuery(
|
||||
data: MediaQueryData(padding: EdgeInsets.zero),
|
||||
data: const MediaQueryData(padding: EdgeInsets.zero),
|
||||
child: Row(
|
||||
children: [
|
||||
if (hasBackButton) _buildBackButton(),
|
||||
@@ -133,22 +133,22 @@ class SearchAppBarWidget {
|
||||
|
||||
Widget _buildSearchInputForm() {
|
||||
return (TextFieldBuilder()
|
||||
..key(Key('search_input_form'))
|
||||
..key(const Key('search_input_form'))
|
||||
..textInputAction(TextInputAction.done)
|
||||
..onChange((value) => _onTextChangeSearchAction?.call(value))
|
||||
..onSubmitted((value) => _onSearchTextAction?.call(value))
|
||||
..cursorColor(AppColor.colorTextButton)
|
||||
..autoFocus(true)
|
||||
..addFocusNode(_searchFocusNode)
|
||||
..textStyle(TextStyle(color: AppColor.colorNameEmail, fontSize: 17))
|
||||
..textStyle(const TextStyle(color: AppColor.colorNameEmail, fontSize: 17))
|
||||
..textDecoration(InputDecoration(
|
||||
border: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
enabledBorder: InputBorder.none,
|
||||
contentPadding: EdgeInsets.zero,
|
||||
hintText: _hintText,
|
||||
hintStyle: TextStyle(color: AppColor.colorHintSearchBar, fontSize: 17.0),
|
||||
labelStyle: TextStyle(color: AppColor.colorHintSearchBar, fontSize: 17.0)))
|
||||
hintStyle: const TextStyle(color: AppColor.colorHintSearchBar, fontSize: 17.0),
|
||||
labelStyle: const TextStyle(color: AppColor.colorHintSearchBar, fontSize: 17.0)))
|
||||
..addController(_searchInputController))
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ class SuggestionBoxWidget {
|
||||
|
||||
double? _suggestionHeight;
|
||||
double? _elevation;
|
||||
List<String> _listData;
|
||||
final List<String> _listData;
|
||||
|
||||
SuggestionBoxWidget(
|
||||
this._context,
|
||||
@@ -48,7 +48,7 @@ class SuggestionBoxWidget {
|
||||
padding: EdgeInsets.zero,
|
||||
itemCount: _listData.length,
|
||||
itemBuilder: (BuildContext context, int index) => ListTile(
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 10),
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
onTap: () {
|
||||
if (_onSelectedSuggestion != null) {
|
||||
_onSelectedSuggestion!(_listData[index]);
|
||||
@@ -69,13 +69,13 @@ class SuggestionBoxWidget {
|
||||
children: [
|
||||
Text(
|
||||
'${AppLocalizations.of(_context).prefix_suggestion_search} ',
|
||||
style: TextStyle(fontSize: 15, color: AppColor.baseTextColor),
|
||||
style: const TextStyle(fontSize: 15, color: AppColor.baseTextColor),
|
||||
),
|
||||
Expanded(child: Text(
|
||||
'"${_listData[index]}"',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 15, color: AppColor.colorNameEmail),
|
||||
style: const TextStyle(fontSize: 15, color: AppColor.colorNameEmail),
|
||||
))
|
||||
],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user