TF-1487 Apply linter rule
This commit is contained in:
@@ -27,27 +27,21 @@ class EmailDataSourceImpl extends EmailDataSource {
|
||||
Future<Email> getEmailContent(AccountId accountId, EmailId emailId) {
|
||||
return Future.sync(() async {
|
||||
return await emailAPI.getEmailContent(accountId, emailId);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> sendEmail(AccountId accountId, EmailRequest emailRequest, {CreateNewMailboxRequest? mailboxRequest}) {
|
||||
return Future.sync(() async {
|
||||
return await emailAPI.sendEmail(accountId, emailRequest, mailboxRequest: mailboxRequest);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<Email>> markAsRead(AccountId accountId, List<Email> emails, ReadActions readActions) {
|
||||
return Future.sync(() async {
|
||||
return await emailAPI.markAsRead(accountId, emails, readActions);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -59,9 +53,7 @@ class EmailDataSourceImpl extends EmailDataSource {
|
||||
) {
|
||||
return Future.sync(() async {
|
||||
return await emailAPI.downloadAttachments(attachments, accountId, baseDownloadUrl, accountRequest);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -74,54 +66,42 @@ class EmailDataSourceImpl extends EmailDataSource {
|
||||
) {
|
||||
return Future.sync(() async {
|
||||
return await emailAPI.exportAttachment(attachment, accountId, baseDownloadUrl, accountRequest, cancelToken);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<EmailId>> moveToMailbox(AccountId accountId, MoveToMailboxRequest moveRequest) {
|
||||
return Future.sync(() async {
|
||||
return await emailAPI.moveToMailbox(accountId, moveRequest);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<Email>> markAsStar(AccountId accountId, List<Email> emails, MarkStarAction markStarAction) {
|
||||
return Future.sync(() async {
|
||||
return await emailAPI.markAsStar(accountId, emails, markStarAction);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Email> saveEmailAsDrafts(AccountId accountId, Email email) {
|
||||
return Future.sync(() async {
|
||||
return await emailAPI.saveEmailAsDrafts(accountId, email);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> removeEmailDrafts(AccountId accountId, EmailId emailId) {
|
||||
return Future.sync(() async {
|
||||
return await emailAPI.removeEmailDrafts(accountId, emailId);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Email> updateEmailDrafts(AccountId accountId, Email newEmail, EmailId oldEmailId) {
|
||||
return Future.sync(() async {
|
||||
return await emailAPI.updateEmailDrafts(accountId, newEmail, oldEmailId);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -141,26 +121,20 @@ class EmailDataSourceImpl extends EmailDataSource {
|
||||
baseDownloadUrl,
|
||||
accountRequest,
|
||||
onReceiveController);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<EmailId>> deleteMultipleEmailsPermanently(AccountId accountId, List<EmailId> emailIds) {
|
||||
return Future.sync(() async {
|
||||
return await emailAPI.deleteMultipleEmailsPermanently(accountId, emailIds);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> deleteEmailPermanently(AccountId accountId, EmailId emailId) {
|
||||
return Future.sync(() async {
|
||||
return await emailAPI.deleteEmailPermanently(accountId, emailId);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
}
|
||||
@@ -19,17 +19,13 @@ class HtmlDataSourceImpl extends HtmlDataSource {
|
||||
) {
|
||||
return Future.sync(() async {
|
||||
return await _htmlAnalyzer.transformEmailContent(emailContent, mapUrlDownloadCID, _dioClient);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<EmailContent> addTooltipWhenHoverOnLink(EmailContent emailContent) {
|
||||
return Future.sync(() async {
|
||||
return await _htmlAnalyzer.addTooltipWhenHoverOnLink(emailContent);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
}
|
||||
@@ -18,8 +18,6 @@ class MdnDataSourceImpl extends MdnDataSource {
|
||||
Future<MDN?> sendReceiptToSender(AccountId accountId, SendReceiptToSenderRequest request) {
|
||||
return Future.sync(() async {
|
||||
return await _mdnAPI.sendReceiptToSender(accountId, request);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
}
|
||||
@@ -192,9 +192,9 @@ class EmailView extends GetWidget<SingleEmailController> {
|
||||
buildIconWeb(
|
||||
icon: SvgPicture.asset(
|
||||
imagePaths.icNewer,
|
||||
color: controller.emailSupervisorController.nextEmailActivated
|
||||
? AppColor.primaryColor
|
||||
: AppColor.colorAttachmentIcon,
|
||||
colorFilter: controller.emailSupervisorController.nextEmailActivated
|
||||
? AppColor.primaryColor.asFilter()
|
||||
: AppColor.colorAttachmentIcon.asFilter(),
|
||||
width: IconUtils.defaultIconSize,
|
||||
height: IconUtils.defaultIconSize,
|
||||
fit: BoxFit.fill),
|
||||
@@ -205,9 +205,9 @@ class EmailView extends GetWidget<SingleEmailController> {
|
||||
imagePaths.icOlder,
|
||||
width: IconUtils.defaultIconSize,
|
||||
height: IconUtils.defaultIconSize,
|
||||
color: controller.emailSupervisorController.previousEmailActivated
|
||||
? AppColor.primaryColor
|
||||
: AppColor.colorAttachmentIcon,
|
||||
colorFilter: controller.emailSupervisorController.previousEmailActivated
|
||||
? AppColor.primaryColor.asFilter()
|
||||
: AppColor.colorAttachmentIcon.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
tooltip: AppLocalizations.of(context).older,
|
||||
onTap: controller.emailSupervisorController.backToPreviousEmail),
|
||||
@@ -341,7 +341,7 @@ class EmailView extends GetWidget<SingleEmailController> {
|
||||
SvgPicture.asset(imagePaths.icAttachment,
|
||||
width: 20,
|
||||
height: 20,
|
||||
color: AppColor.colorAttachmentIcon,
|
||||
colorFilter: AppColor.colorAttachmentIcon.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
const SizedBox(width: 5),
|
||||
Expanded(child: Text(
|
||||
@@ -472,7 +472,7 @@ class EmailView extends GetWidget<SingleEmailController> {
|
||||
width: 24,
|
||||
height: 24,
|
||||
fit: BoxFit.fill,
|
||||
color: AppColor.colorTextButton
|
||||
colorFilter: AppColor.colorTextButton.asFilter()
|
||||
),
|
||||
AppLocalizations.of(context).mark_as_unread,
|
||||
email,
|
||||
@@ -500,7 +500,7 @@ class EmailView extends GetWidget<SingleEmailController> {
|
||||
width: 24,
|
||||
height: 24,
|
||||
fit: BoxFit.fill,
|
||||
color: AppColor.colorTextButton
|
||||
colorFilter: AppColor.colorTextButton.asFilter()
|
||||
),
|
||||
currentMailbox?.isSpam == true
|
||||
? AppLocalizations.of(context).remove_from_spam
|
||||
@@ -528,7 +528,7 @@ class EmailView extends GetWidget<SingleEmailController> {
|
||||
width: 24,
|
||||
height: 24,
|
||||
fit: BoxFit.fill,
|
||||
color: AppColor.colorTextButton),
|
||||
colorFilter: AppColor.colorTextButton.asFilter()),
|
||||
AppLocalizations.of(context).quickCreatingRule,
|
||||
email,
|
||||
iconLeftPadding: responsiveUtils.isMobile(context)
|
||||
|
||||
@@ -62,7 +62,7 @@ class AppBarMailWidgetBuilder extends StatelessWidget {
|
||||
_imagePaths.icBack,
|
||||
width: 14,
|
||||
height: 14,
|
||||
color: AppColor.colorTextButton,
|
||||
colorFilter: AppColor.colorTextButton.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
if (!isSearchIsRunning)
|
||||
Container(
|
||||
@@ -134,9 +134,9 @@ class AppBarMailWidgetBuilder extends StatelessWidget {
|
||||
buildIconWeb(
|
||||
icon: SvgPicture.asset(
|
||||
_imagePaths.icDeleteComposer,
|
||||
color: mailboxContain?.isTrash == false
|
||||
? AppColor.colorTextButton
|
||||
: AppColor.colorDeletePermanentlyButton,
|
||||
colorFilter: mailboxContain?.isTrash == false
|
||||
? AppColor.colorTextButton.asFilter()
|
||||
: AppColor.colorDeletePermanentlyButton.asFilter(),
|
||||
width: BuildUtils.isWeb ? 18 : 20,
|
||||
height: BuildUtils.isWeb ? 18 : 20,
|
||||
fit: BoxFit.fill),
|
||||
|
||||
@@ -89,7 +89,7 @@ class AttachmentFileTileBuilder extends StatelessWidget{
|
||||
imagePaths.icDownloadAttachment,
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: AppColor.primaryColor,
|
||||
colorFilter: AppColor.primaryColor.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
onTap: () => onDownloadAttachmentFileActionClick?.call(_attachment)
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user