TF-1487 Apply linter rule
This commit is contained in:
@@ -78,9 +78,9 @@ abstract class BaseController extends GetxController
|
||||
return;
|
||||
}
|
||||
|
||||
final _appToast = Get.find<AppToast>();
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
final appToast = Get.find<AppToast>();
|
||||
final imagePaths = Get.find<ImagePaths>();
|
||||
final responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
|
||||
String messageError = '';
|
||||
if (error is MethodLevelErrors) {
|
||||
@@ -92,19 +92,19 @@ abstract class BaseController extends GetxController
|
||||
}
|
||||
|
||||
if (messageError.isNotEmpty && currentContext != null && currentOverlayContext != null) {
|
||||
_appToast.showBottomToast(
|
||||
appToast.showBottomToast(
|
||||
currentOverlayContext!,
|
||||
messageError,
|
||||
leadingIcon: SvgPicture.asset(
|
||||
_imagePaths.icNotConnection,
|
||||
imagePaths.icNotConnection,
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: Colors.white,
|
||||
colorFilter: Colors.white.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
backgroundColor: AppColor.toastErrorBackgroundColor,
|
||||
textColor: Colors.white,
|
||||
textActionColor: Colors.white,
|
||||
maxWidth: _responsiveUtils.getMaxWidthToast(currentContext!));
|
||||
maxWidth: responsiveUtils.getMaxWidthToast(currentContext!));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,10 +26,10 @@ mixin MessageDialogActionMixin {
|
||||
Color? cancelButtonColor,
|
||||
}
|
||||
) {
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
final responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
final imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
if (_responsiveUtils.isMobile(context)) {
|
||||
if (responsiveUtils.isMobile(context)) {
|
||||
if (showAsBottomSheet) {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
@@ -38,13 +38,13 @@ mixin MessageDialogActionMixin {
|
||||
backgroundColor: Colors.transparent,
|
||||
enableDrag: true,
|
||||
builder: (BuildContext context) => PointerInterceptor(
|
||||
child: (ConfirmDialogBuilder(_imagePaths, showAsBottomSheet: true)
|
||||
child: (ConfirmDialogBuilder(imagePaths, showAsBottomSheet: true)
|
||||
..key(const Key('confirm_dialog_action'))
|
||||
..title(title ?? '')
|
||||
..content(message)
|
||||
..addIcon(icon)
|
||||
..margin(const EdgeInsets.symmetric(vertical: 42, horizontal: 16))
|
||||
..widthDialog(_responsiveUtils.getSizeScreenWidth(context))
|
||||
..widthDialog(responsiveUtils.getSizeScreenWidth(context))
|
||||
..colorConfirmButton(actionButtonColor ?? AppColor.colorTextButton)
|
||||
..colorCancelButton(cancelButtonColor ?? AppColor.colorCancelButton)
|
||||
..paddingTitle(icon != null ? const EdgeInsets.only(top: 24) : EdgeInsets.zero)
|
||||
@@ -76,7 +76,7 @@ mixin MessageDialogActionMixin {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierColor: AppColor.colorDefaultCupertinoActionSheet,
|
||||
builder: (BuildContext context) => PointerInterceptor(child: (ConfirmDialogBuilder(_imagePaths)
|
||||
builder: (BuildContext context) => PointerInterceptor(child: (ConfirmDialogBuilder(imagePaths)
|
||||
..key(const Key('confirm_dialog_action'))
|
||||
..title(title ?? '')
|
||||
..content(message)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
|
||||
import 'package:core/core.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
||||
@@ -24,7 +25,7 @@ mixin PopupMenuWidgetMixin {
|
||||
width: iconSize ?? 20,
|
||||
height: iconSize ?? 20,
|
||||
fit: BoxFit.fill,
|
||||
color: colorIcon
|
||||
colorFilter: colorIcon.asFilter()
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(child: Text(
|
||||
|
||||
@@ -98,8 +98,8 @@ abstract class ReloadableController extends BaseController {
|
||||
} else if (success is GetStoredTokenOidcSuccess) {
|
||||
_handleGetStoredTokenOIDCSuccess(success);
|
||||
} else if (success is GetFCMSubscriptionLocalSuccess) {
|
||||
final _subscriptionId = success.fcmSubscription.subscriptionId;
|
||||
_destroySubscriptionAction(_subscriptionId);
|
||||
final subscriptionId = success.fcmSubscription.subscriptionId;
|
||||
_destroySubscriptionAction(subscriptionId);
|
||||
} else if (success is DestroySubscriptionSuccess) {
|
||||
_checkAuthenticationTypeWhenLogout();
|
||||
}
|
||||
@@ -249,18 +249,18 @@ abstract class ReloadableController extends BaseController {
|
||||
}
|
||||
|
||||
bool fcmEnabled(Session? session, AccountId? accountId) {
|
||||
bool _fcmEnabled = false;
|
||||
bool fcmEnabled = false;
|
||||
try {
|
||||
requireCapability(session!, accountId!, [FirebaseCapability.fcmIdentifier]);
|
||||
if (AppConfig.fcmAvailable) {
|
||||
_fcmEnabled = true;
|
||||
fcmEnabled = true;
|
||||
} else {
|
||||
_fcmEnabled = false;
|
||||
fcmEnabled = false;
|
||||
}
|
||||
} catch (e) {
|
||||
logError('BaseController::fcmEnabled(): exception: $e');
|
||||
}
|
||||
return _fcmEnabled;
|
||||
return fcmEnabled;
|
||||
}
|
||||
|
||||
void logout(Session? session, AccountId? accountId) {
|
||||
|
||||
@@ -3,12 +3,12 @@ import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/utils/style_utils.dart';
|
||||
import 'package:dropdown_button2/dropdown_button2.dart';
|
||||
import 'package:enough_html_editor/enough_html_editor.dart' as enough_html_editor;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:jmap_dart_client/jmap/identities/identity.dart';
|
||||
import 'package:pointer_interceptor/pointer_interceptor.dart';
|
||||
import 'package:rich_text_composer/rich_text_composer.dart' as rich_text_composer;
|
||||
import 'package:rule_filter/rule_filter/rule_condition.dart' as rule_condition;
|
||||
import 'package:tmail_ui_user/features/composer/presentation/model/font_name_type.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/language_and_region/extensions/locale_extension.dart';
|
||||
@@ -54,7 +54,7 @@ class DropDownButtonWidget<T> extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
final imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
return DropdownButtonHideUnderline(
|
||||
child: PointerInterceptor(
|
||||
@@ -91,7 +91,7 @@ class DropDownButtonWidget<T> extends StatelessWidget {
|
||||
overflow: CommonTextStyle.defaultTextOverFlow,
|
||||
)),
|
||||
if (supportSelectionIcon && item == itemSelected)
|
||||
SvgPicture.asset(_imagePaths.icChecked,
|
||||
SvgPicture.asset(imagePaths.icChecked,
|
||||
width: sizeIconChecked,
|
||||
height: sizeIconChecked,
|
||||
fit: BoxFit.fill)
|
||||
@@ -125,13 +125,13 @@ class DropDownButtonWidget<T> extends StatelessWidget {
|
||||
softWrap: CommonTextStyle.defaultSoftWrap,
|
||||
overflow: CommonTextStyle.defaultTextOverFlow,
|
||||
)),
|
||||
iconArrowDown ?? SvgPicture.asset(_imagePaths.icDropDown)
|
||||
iconArrowDown ?? SvgPicture.asset(imagePaths.icDropDown)
|
||||
]),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
onChanged: onChanged,
|
||||
icon: iconArrowDown ?? SvgPicture.asset(_imagePaths.icDropDown),
|
||||
icon: iconArrowDown ?? SvgPicture.asset(imagePaths.icDropDown),
|
||||
buttonPadding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
buttonDecoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(radiusButton),
|
||||
@@ -173,7 +173,7 @@ class DropDownButtonWidget<T> extends StatelessWidget {
|
||||
if (item is FontNameType) {
|
||||
return item.fontFamily;
|
||||
}
|
||||
if (item is enough_html_editor.SafeFont) {
|
||||
if (item is rich_text_composer.SafeFont) {
|
||||
return item.name;
|
||||
}
|
||||
if (item is rule_condition.Field) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
|
||||
import 'package:core/core.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:pointer_interceptor/pointer_interceptor.dart';
|
||||
@@ -40,7 +41,7 @@ class PopupItemWidget extends StatelessWidget {
|
||||
width: iconSize ?? 20,
|
||||
height: iconSize ?? 20,
|
||||
fit: BoxFit.fill,
|
||||
color: colorIcon
|
||||
colorFilter: colorIcon.asFilter()
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(child: Text(
|
||||
|
||||
@@ -133,7 +133,7 @@ class HiveCacheConfig {
|
||||
);
|
||||
registerCacheAdapter<FCMSubscriptionCache>(
|
||||
FCMSubscriptionCacheAdapter(),
|
||||
CachingConstants.FCM_SUBSCRIPTION_HIVE_CACHE_INDENTITY
|
||||
CachingConstants.FCM_SUBSCRIPTION_HIVE_CACHE_IDENTITY
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,17 +17,13 @@ class HiveCacheVersionClient extends CacheVersionClient {
|
||||
return Future.sync(() {
|
||||
final latestVersion = _sharedPreferences.getInt(versionKey);
|
||||
return latestVersion;
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> storeVersion(int newVersion) {
|
||||
return Future.sync(() async {
|
||||
return await _sharedPreferences.setInt(versionKey, newVersion);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
}
|
||||
@@ -13,5 +13,5 @@ class CachingConstants {
|
||||
static const int AUTHENTICATION_INFO_HIVE_CACHE_IDENTIFY = 11;
|
||||
static const int RECENT_LOGIN_URL_HIVE_CACHE_IDENTITY = 12;
|
||||
static const int RECENT_LOGIN_USERNAME_HIVE_CACHE_IDENTITY = 13;
|
||||
static const int FCM_SUBSCRIPTION_HIVE_CACHE_INDENTITY = 14;
|
||||
static const int FCM_SUBSCRIPTION_HIVE_CACHE_IDENTITY = 14;
|
||||
}
|
||||
@@ -30,35 +30,27 @@ class CleanupDataSourceImpl extends CleanupDataSource {
|
||||
Future<void> cleanEmailCache(EmailCleanupRule cleanupRule) {
|
||||
return Future.sync(() async {
|
||||
return await emailCacheManager.clean(cleanupRule);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> cleanRecentSearchCache(RecentSearchCleanupRule cleanupRule) {
|
||||
return Future.sync(() async {
|
||||
return await recentSearchCacheManager.clean(cleanupRule);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> cleanRecentLoginUrlCache(RecentLoginUrlCleanupRule cleanupRule) {
|
||||
return Future.sync(() async {
|
||||
return await recentLoginUrlCacheManager.clean(cleanupRule);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> cleanRecentLoginUsernameCache(RecentLoginUsernameCleanupRule cleanupRule) {
|
||||
return Future.sync(() async {
|
||||
return await recentLoginUsernameCacheManager.clean(cleanupRule);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
}
|
||||
@@ -30,8 +30,6 @@ class ComposerDataSourceImpl extends ComposerDataSource {
|
||||
bytesData: fileInfo.bytes,
|
||||
maxWidth: maxWidth,
|
||||
compress: compress);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
}
|
||||
@@ -25,9 +25,7 @@ class ContactDataSourceImpl extends ContactDataSource {
|
||||
return <DeviceContact>[];
|
||||
}
|
||||
}
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
List<DeviceContact> _toDeviceContact(contact_service.Contact contact) {
|
||||
|
||||
@@ -291,13 +291,11 @@ class ComposerController extends BaseController {
|
||||
void _listenWorker() {
|
||||
uploadInlineImageWorker = ever(uploadController.uploadInlineViewState, (state) {
|
||||
log('ComposerController::_listenWorker(): $state');
|
||||
if (state is Either) {
|
||||
state.fold((failure) => null, (success) {
|
||||
if (success is SuccessAttachmentUploadState) {
|
||||
_handleUploadInlineSuccess(success);
|
||||
}
|
||||
});
|
||||
}
|
||||
state.fold((failure) => null, (success) {
|
||||
if (success is SuccessAttachmentUploadState) {
|
||||
_handleUploadInlineSuccess(success);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -916,7 +914,10 @@ class ComposerController extends BaseController {
|
||||
) async {
|
||||
final newEmailBody = await _getEmailBodyText(context, changedEmail: true);
|
||||
log('ComposerController::_isEmailChanged(): newEmailBody: $newEmailBody');
|
||||
var oldEmailBody = getContentEmail(context) ?? '';
|
||||
var oldEmailBody = '';
|
||||
if (context.mounted) {
|
||||
oldEmailBody = getContentEmail(context) ?? '';
|
||||
}
|
||||
log('ComposerController::_isEmailChanged(): getContentEmail: $oldEmailBody');
|
||||
if (arguments.emailActionType != EmailActionType.compose &&
|
||||
oldEmailBody.isNotEmpty) {
|
||||
@@ -974,7 +975,7 @@ class ComposerController extends BaseController {
|
||||
|
||||
if (arguments != null && userProfile != null && accountId != null) {
|
||||
final isChanged = await _isEmailChanged(context, arguments);
|
||||
if (isChanged) {
|
||||
if (isChanged && context.mounted) {
|
||||
final newEmail = await _generateEmail(
|
||||
context,
|
||||
userProfile,
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
import 'package:core/core.dart';
|
||||
import 'package:enough_html_editor/enough_html_editor.dart';
|
||||
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
import 'package:rich_text_composer/rich_text_composer.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/controller/base_rich_text_controller.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/model/header_style_type.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/model/image_source.dart';
|
||||
|
||||
@@ -96,9 +96,9 @@ mixin RichTextButtonMixin {
|
||||
return buildIconWeb(
|
||||
icon: SvgPicture.asset(
|
||||
path,
|
||||
color: isSelected == true
|
||||
? Colors.black.withOpacity(opacity)
|
||||
: AppColor.colorDefaultRichTextButton.withOpacity(opacity),
|
||||
colorFilter: isSelected == true
|
||||
? Colors.black.withOpacity(opacity).asFilter()
|
||||
: AppColor.colorDefaultRichTextButton.withOpacity(opacity).asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
iconPadding: const EdgeInsets.all(4),
|
||||
colorFocus: Colors.white,
|
||||
@@ -120,12 +120,14 @@ mixin RichTextButtonMixin {
|
||||
|
||||
return tooltip?.isNotEmpty == true
|
||||
? Tooltip(
|
||||
child: SvgPicture.asset(path,
|
||||
color: newColor?.withOpacity(opacity),
|
||||
fit: BoxFit.fill),
|
||||
message: tooltip)
|
||||
: SvgPicture.asset(path,
|
||||
color: newColor?.withOpacity(opacity),
|
||||
message: tooltip,
|
||||
child: SvgPicture.asset(
|
||||
path,
|
||||
colorFilter: newColor?.withOpacity(opacity).asFilter(),
|
||||
fit: BoxFit.fill))
|
||||
: SvgPicture.asset(
|
||||
path,
|
||||
colorFilter: newColor?.withOpacity(opacity).asFilter(),
|
||||
fit: BoxFit.fill);
|
||||
}
|
||||
|
||||
@@ -138,9 +140,10 @@ mixin RichTextButtonMixin {
|
||||
? AppColor.colorDefaultRichTextButton
|
||||
: color;
|
||||
|
||||
return SvgPicture.asset(path,
|
||||
color: newColor?.withOpacity(opacity),
|
||||
fit: BoxFit.fill);
|
||||
return SvgPicture.asset(
|
||||
path,
|
||||
colorFilter: newColor?.withOpacity(opacity).asFilter(),
|
||||
fit: BoxFit.fill);
|
||||
}
|
||||
|
||||
Widget buildIconColorBackgroundTextWithoutTooltip({
|
||||
@@ -166,10 +169,10 @@ mixin RichTextButtonMixin {
|
||||
? AppColor.colorDefaultRichTextButton
|
||||
: colorSelected;
|
||||
return Tooltip(
|
||||
message: tooltip,
|
||||
child: Icon(iconData,
|
||||
color: (newColor ?? AppColor.colorDefaultRichTextButton).withOpacity(opacity),
|
||||
size: 20),
|
||||
message: tooltip,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -223,9 +226,10 @@ mixin RichTextButtonMixin {
|
||||
DropDownMenuHeaderStyleWidget(
|
||||
icon: buildWrapIconStyleText(
|
||||
isSelected: richTextController.isMenuHeaderStyleOpen,
|
||||
icon: SvgPicture.asset(RichTextStyleType.headerStyle.getIcon(_imagePaths),
|
||||
color: AppColor.colorDefaultRichTextButton,
|
||||
fit: BoxFit.fill),
|
||||
icon: SvgPicture.asset(
|
||||
RichTextStyleType.headerStyle.getIcon(_imagePaths),
|
||||
colorFilter: AppColor.colorDefaultRichTextButton.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 5),
|
||||
tooltip: RichTextStyleType.headerStyle.getTooltipButton(context)
|
||||
),
|
||||
|
||||
@@ -47,9 +47,10 @@ class ToolbarRichTextWebBuilder extends StatelessWidget with RichTextButtonMixin
|
||||
child: DropDownMenuHeaderStyleWidget(
|
||||
icon: buildWrapIconStyleText(
|
||||
isSelected: richTextWebController.isMenuHeaderStyleOpen,
|
||||
icon: SvgPicture.asset(RichTextStyleType.headerStyle.getIcon(_imagePaths),
|
||||
color: AppColor.colorDefaultRichTextButton.withOpacity(opacity),
|
||||
fit: BoxFit.fill),
|
||||
icon: SvgPicture.asset(
|
||||
RichTextStyleType.headerStyle.getIcon(_imagePaths),
|
||||
colorFilter: AppColor.colorDefaultRichTextButton.withOpacity(opacity).asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 5),
|
||||
tooltip: RichTextStyleType.headerStyle.getTooltipButton(context)
|
||||
),
|
||||
|
||||
@@ -24,11 +24,12 @@ class AppBarContactWidget extends StatelessWidget {
|
||||
Positioned(
|
||||
left: 0,
|
||||
child: buildIconWeb(
|
||||
icon: SvgPicture.asset(_imagePaths.icCloseComposer,
|
||||
color: AppColor.colorCloseButton,
|
||||
width: 24,
|
||||
height: 24,
|
||||
fit: BoxFit.fill),
|
||||
icon: SvgPicture.asset(
|
||||
_imagePaths.icCloseComposer,
|
||||
colorFilter: AppColor.colorCloseButton.asFilter(),
|
||||
width: 24,
|
||||
height: 24,
|
||||
fit: BoxFit.fill),
|
||||
minSize: 25,
|
||||
iconSize: 25,
|
||||
iconPadding: const EdgeInsets.all(5),
|
||||
|
||||
@@ -59,7 +59,7 @@ class ContactInputTagItem extends StatelessWidget {
|
||||
imagePaths.icClose,
|
||||
width: 20,
|
||||
height: 20,
|
||||
color: AppColor.colorDeleteContactIcon,
|
||||
colorFilter: AppColor.colorDeleteContactIcon.asFilter(),
|
||||
fit: BoxFit.fill)
|
||||
: null,
|
||||
labelStyle: const TextStyle(color: Colors.black, fontSize: 14, fontWeight: FontWeight.normal),
|
||||
|
||||
@@ -325,7 +325,7 @@ class DestinationPickerController extends BaseMailboxController {
|
||||
_imagePaths.icNotConnection,
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: Colors.white,
|
||||
colorFilter: Colors.white.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
backgroundColor: AppColor.toastErrorBackgroundColor,
|
||||
textColor: Colors.white,
|
||||
@@ -371,7 +371,7 @@ class DestinationPickerController extends BaseMailboxController {
|
||||
_imagePaths.icNotConnection,
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: Colors.white,
|
||||
colorFilter: Colors.white.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
backgroundColor: AppColor.toastErrorBackgroundColor,
|
||||
textColor: Colors.white,
|
||||
@@ -416,7 +416,7 @@ class DestinationPickerController extends BaseMailboxController {
|
||||
_imagePaths.icNotConnection,
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: Colors.white,
|
||||
colorFilter: Colors.white.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
backgroundColor: AppColor.toastErrorBackgroundColor,
|
||||
textColor: Colors.white,
|
||||
|
||||
@@ -536,7 +536,10 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
||||
child: Row(
|
||||
children: [
|
||||
Padding(padding: const EdgeInsets.only(left: 5), child: buildIconWeb(
|
||||
icon: SvgPicture.asset(_imagePaths.icBack, color: AppColor.colorTextButton, fit: BoxFit.fill),
|
||||
icon: SvgPicture.asset(
|
||||
_imagePaths.icBack,
|
||||
colorFilter: AppColor.colorTextButton.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
onTap: () => controller.disableSearch(context))),
|
||||
Expanded(child: (SearchAppBarWidget(
|
||||
_imagePaths,
|
||||
|
||||
+1
-64
@@ -94,7 +94,7 @@ class TopBarDestinationPickerBuilder extends StatelessWidget {
|
||||
_imagePaths.icBack,
|
||||
width: 14,
|
||||
height: 14,
|
||||
color: AppColor.primaryColor,
|
||||
colorFilter: AppColor.primaryColor.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
@@ -117,67 +117,4 @@ class TopBarDestinationPickerBuilder extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildIconCreateButton(BuildContext context) {
|
||||
return buildIconWeb(
|
||||
iconSize: 24,
|
||||
colorSelected: Colors.white,
|
||||
splashRadius: 15,
|
||||
iconPadding: const EdgeInsets.all(3),
|
||||
icon: SvgPicture.asset(
|
||||
_imagePaths.icCreateNewFolder,
|
||||
color: mailboxIdDestination != null
|
||||
? AppColor.colorTextButton
|
||||
: AppColor.colorDisableMailboxCreateButton,
|
||||
fit: BoxFit.fill),
|
||||
tooltip: AppLocalizations.of(context).create,
|
||||
onTap: onOpenCreateNewMailboxScreenAction
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildDoneButton(BuildContext context) {
|
||||
return Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
customBorder: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(8))),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 8,
|
||||
horizontal: 8),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).done,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
color: mailboxIdDestination != null
|
||||
? AppColor.colorTextButton
|
||||
: AppColor.colorDisableMailboxCreateButton))),
|
||||
onTap: onSelectedMailboxDestinationAction
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSaveButton(BuildContext context) {
|
||||
return Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
customBorder: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(8))),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 8,
|
||||
horizontal: 8),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).save,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
color: isCreateMailboxValidated
|
||||
? AppColor.colorTextButton
|
||||
: AppColor.colorDisableMailboxCreateButton)
|
||||
)
|
||||
),
|
||||
onTap: isCreateMailboxValidated ? onCreateNewMailboxAction : null
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
),
|
||||
|
||||
@@ -15,7 +15,7 @@ import 'package:jmap_dart_client/jmap/core/unsigned_int.dart';
|
||||
import 'package:jmap_dart_client/jmap/identities/identity.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
||||
import 'package:model/model.dart';
|
||||
import 'package:rich_text_composer/richtext_controller.dart';
|
||||
import 'package:rich_text_composer/rich_text_composer.dart';
|
||||
import 'package:tmail_ui_user/features/base/base_controller.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/controller/rich_text_web_controller.dart';
|
||||
import 'package:tmail_ui_user/features/identity_creator/presentation/model/identity_creator_arguments.dart';
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:core/core.dart';
|
||||
import 'package:enough_html_editor/enough_html_editor.dart' as html_editor_mobile;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:html_editor_enhanced/html_editor.dart' as html_editor_browser;
|
||||
import 'package:html_editor_enhanced/html_editor.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
||||
import 'package:pointer_interceptor/pointer_interceptor.dart';
|
||||
import 'package:rich_text_composer/views/keyboard_richtext.dart';
|
||||
import 'package:rich_text_composer/rich_text_composer.dart';
|
||||
import 'package:rich_text_composer/views/widgets/rich_text_keyboard_toolbar.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/widgets/toolbar_rich_text_builder.dart';
|
||||
import 'package:tmail_ui_user/features/identity_creator/presentation/identity_creator_controller.dart';
|
||||
@@ -374,7 +372,11 @@ class IdentityCreatorView extends GetWidget<IdentityCreatorController> {
|
||||
Positioned(top: 2, right: 8,
|
||||
child: buildIconWeb(
|
||||
iconSize: 24,
|
||||
icon: SvgPicture.asset(_imagePaths.icComposerClose, fit: BoxFit.fill, color: AppColor.colorDeleteContactIcon),
|
||||
icon: SvgPicture.asset(
|
||||
_imagePaths.icComposerClose,
|
||||
fit: BoxFit.fill,
|
||||
colorFilter: AppColor.colorDeleteContactIcon.asFilter()
|
||||
),
|
||||
tooltip: AppLocalizations.of(context).close,
|
||||
onTap: () => controller.closeView(context)))
|
||||
]
|
||||
@@ -405,16 +407,16 @@ class IdentityCreatorView extends GetWidget<IdentityCreatorController> {
|
||||
child: html_editor_browser.HtmlEditor(
|
||||
key: const Key('identity_create_editor_web'),
|
||||
controller: controller.richTextWebController.editorController,
|
||||
htmlEditorOptions: const HtmlEditorOptions(
|
||||
htmlEditorOptions: const html_editor_browser.HtmlEditorOptions(
|
||||
hint: '',
|
||||
darkMode: false,
|
||||
customBodyCssStyle: bodyCssStyleForEditor),
|
||||
blockQuotedContent: initContent,
|
||||
htmlToolbarOptions: const HtmlToolbarOptions(
|
||||
toolbarType: ToolbarType.hide,
|
||||
htmlToolbarOptions: const html_editor_browser.HtmlToolbarOptions(
|
||||
toolbarType: html_editor_browser.ToolbarType.hide,
|
||||
defaultToolbarButtons: []),
|
||||
otherOptions: const OtherOptions(height: 150),
|
||||
callbacks: Callbacks(onBeforeCommand: (currentHtml) {
|
||||
otherOptions: const html_editor_browser.OtherOptions(height: 150),
|
||||
callbacks: html_editor_browser.Callbacks(onBeforeCommand: (currentHtml) {
|
||||
log('IdentityCreatorView::_buildHtmlEditorWeb(): onBeforeCommand : $currentHtml');
|
||||
controller.updateContentHtmlEditor(currentHtml);
|
||||
}, onChangeContent: (changed) {
|
||||
@@ -445,7 +447,7 @@ class IdentityCreatorView extends GetWidget<IdentityCreatorController> {
|
||||
Widget _buildHtmlEditor(BuildContext context, {String? initialContent}) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: html_editor_mobile.HtmlEditor(
|
||||
child: HtmlEditor(
|
||||
key: controller.htmlKey,
|
||||
minHeight: controller.htmlEditorMinHeight,
|
||||
addDefaultSelectionMenuItems: false,
|
||||
|
||||
@@ -27,63 +27,49 @@ class AuthenticationOIDCDataSourceImpl extends AuthenticationOIDCDataSource {
|
||||
return Future.sync(() async {
|
||||
final oidcResponse = await _oidcHttpClient.checkOIDCIsAvailable(oidcRequest);
|
||||
return oidcResponse!;
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<OIDCConfiguration> getOIDCConfiguration(OIDCResponse oidcResponse) {
|
||||
return Future.sync(() async {
|
||||
return await _oidcHttpClient.getOIDCConfiguration(oidcResponse);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<TokenOIDC> getTokenOIDC(String clientId, String redirectUrl, String discoveryUrl, List<String> scopes) {
|
||||
return Future.sync(() async {
|
||||
return await _authenticationClient.getTokenOIDC(clientId, redirectUrl, discoveryUrl, scopes);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<TokenOIDC> getStoredTokenOIDC(String tokenIdHash) {
|
||||
return Future.sync(() async {
|
||||
return await _tokenOidcCacheManager.getTokenOidc(tokenIdHash);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> persistTokenOIDC(TokenOIDC tokenOidc) {
|
||||
return Future.sync(() async {
|
||||
return await _tokenOidcCacheManager.persistOneTokenOidc(tokenOidc);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<OIDCConfiguration> getStoredOidcConfiguration() {
|
||||
return Future.sync(() async {
|
||||
return await _oidcConfigurationCacheManager.getOidcConfiguration();
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> persistAuthorityOidc(String authority) {
|
||||
return Future.sync(() async {
|
||||
return await _oidcConfigurationCacheManager.persistAuthorityOidc(authority);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -101,27 +87,21 @@ class AuthenticationOIDCDataSourceImpl extends AuthenticationOIDCDataSource {
|
||||
discoveryUrl,
|
||||
scopes,
|
||||
refreshToken);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> logout(TokenId tokenId, OIDCConfiguration config) {
|
||||
return Future.sync(() async {
|
||||
return await _authenticationClient.logoutOidc(tokenId, config);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> deleteAuthorityOidc() {
|
||||
return Future.sync(() async {
|
||||
return await _oidcConfigurationCacheManager.deleteAuthorityOidc();
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -137,26 +117,20 @@ class AuthenticationOIDCDataSourceImpl extends AuthenticationOIDCDataSource {
|
||||
redirectUrl,
|
||||
discoveryUrl,
|
||||
scopes);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<String?> getAuthenticationInfo() {
|
||||
return Future.sync(() async {
|
||||
return await _authenticationClient.getAuthenticationInfo();
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> deleteTokenOIDC() {
|
||||
return Future.sync(() async {
|
||||
return await _tokenOidcCacheManager.deleteTokenOidc();
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
}
|
||||
@@ -14,26 +14,20 @@ class HiveAccountDatasourceImpl extends AccountDatasource {
|
||||
Future<Account> getCurrentAccount() {
|
||||
return Future.sync(() async {
|
||||
return await _accountCacheManager.getSelectedAccount();
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> setCurrentAccount(Account newCurrentAccount) {
|
||||
return Future.sync(() async {
|
||||
return await _accountCacheManager.setSelectedAccount(newCurrentAccount);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> deleteCurrentAccount(String accountId) {
|
||||
return Future.sync(() async {
|
||||
return await _accountCacheManager.deleteSelectedAccount(accountId);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
}
|
||||
@@ -24,9 +24,7 @@ class LoginUrlDataSourceImpl implements LoginUrlDataSource {
|
||||
recentLoginUrl.url,
|
||||
recentLoginUrl.toRecentLoginUrlCache());
|
||||
}
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -46,9 +44,7 @@ class LoginUrlDataSourceImpl implements LoginUrlDataSource {
|
||||
: listRecentUrl;
|
||||
|
||||
return newListRecentSUrl;
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
bool _filterRecentUrlCache(RecentLoginUrlCache recentLoginUrlCache, String? pattern) {
|
||||
|
||||
@@ -28,9 +28,7 @@ class LoginUsernameDataSourceImpl implements LoginUsernameDataSource {
|
||||
return listValidRecentUsername.length > newLimit
|
||||
? listValidRecentUsername.sublist(0, newLimit)
|
||||
: listValidRecentUsername;
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -44,9 +42,7 @@ class LoginUsernameDataSourceImpl implements LoginUsernameDataSource {
|
||||
await _recentLoginUsernameCacheClient.insertItem(recentLoginUsername.username,
|
||||
recentLoginUsername.toRecentLoginUsernameCache());
|
||||
}
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
bool _filterRecentLoginUsernameCache(
|
||||
|
||||
@@ -10,7 +10,7 @@ extension OidcConfigurationExtensions on OIDCConfiguration {
|
||||
if (AppConfig.domainRedirectUrl.endsWith('/')) {
|
||||
return AppConfig.domainRedirectUrl + loginRedirectOidcWeb;
|
||||
} else {
|
||||
return AppConfig.domainRedirectUrl + '/' + loginRedirectOidcWeb;
|
||||
return '${AppConfig.domainRedirectUrl}/$loginRedirectOidcWeb';
|
||||
}
|
||||
} else {
|
||||
return redirectOidcMobile;
|
||||
@@ -22,7 +22,7 @@ extension OidcConfigurationExtensions on OIDCConfiguration {
|
||||
if (AppConfig.domainRedirectUrl.endsWith('/')) {
|
||||
return AppConfig.domainRedirectUrl + logoutRedirectOidcWeb;
|
||||
} else {
|
||||
return AppConfig.domainRedirectUrl + '/' + logoutRedirectOidcWeb;
|
||||
return '${AppConfig.domainRedirectUrl}/$logoutRedirectOidcWeb';
|
||||
}
|
||||
} else {
|
||||
return redirectOidcMobile;
|
||||
|
||||
@@ -30,8 +30,8 @@ class LoginView extends BaseLoginView {
|
||||
child: _supportScrollForm(context)
|
||||
? Stack(children: [
|
||||
Center(child: SingleChildScrollView(
|
||||
child: _buildCenterForm(context),
|
||||
scrollDirection: Axis.vertical)),
|
||||
scrollDirection: Axis.vertical,
|
||||
child: _buildCenterForm(context))),
|
||||
Obx(() {
|
||||
if (loginController.loginFormType.value == LoginFormType.credentialForm
|
||||
|| loginController.loginFormType.value == LoginFormType.ssoForm) {
|
||||
@@ -128,7 +128,7 @@ class LoginView extends BaseLoginView {
|
||||
icon: SvgPicture.asset(
|
||||
imagePaths.icBack,
|
||||
alignment: Alignment.center,
|
||||
color: AppColor.primaryColor
|
||||
colorFilter: AppColor.primaryColor.asFilter()
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
@@ -13,7 +13,6 @@ class LoginTextInputBuilder {
|
||||
Key? _key;
|
||||
String? _title;
|
||||
String? _hintText;
|
||||
String? _labelText;
|
||||
String? _prefixText;
|
||||
SetErrorString? _setErrorString;
|
||||
String? _errorText;
|
||||
@@ -44,7 +43,6 @@ class LoginTextInputBuilder {
|
||||
}
|
||||
|
||||
void labelText(String? labelText) {
|
||||
_labelText = labelText;
|
||||
}
|
||||
|
||||
void prefixText(String? prefixText) {
|
||||
|
||||
@@ -43,9 +43,7 @@ class MailboxCacheDataSourceImpl extends MailboxDataSource {
|
||||
Future<void> update({List<Mailbox>? updated, List<Mailbox>? created, List<MailboxId>? destroyed}) {
|
||||
return Future.sync(() async {
|
||||
return await _mailboxCacheManager.update(updated: updated, created: created, destroyed: destroyed);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -53,9 +51,7 @@ class MailboxCacheDataSourceImpl extends MailboxDataSource {
|
||||
return Future.sync(() async {
|
||||
final listMailboxes = await _mailboxCacheManager.getAllMailbox();
|
||||
return listMailboxes;
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -35,18 +35,14 @@ class MailboxDataSourceImpl extends MailboxDataSource {
|
||||
Future<MailboxResponse> getAllMailbox(Session session, AccountId accountId, {Properties? properties}) {
|
||||
return Future.sync(() async {
|
||||
return await mailboxAPI.getAllMailbox(session, accountId, properties: properties);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MailboxChangeResponse> getChanges(Session session, AccountId accountId, State sinceState) {
|
||||
return Future.sync(() async {
|
||||
return await mailboxAPI.getChanges(session, accountId, sinceState);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -63,36 +59,28 @@ class MailboxDataSourceImpl extends MailboxDataSource {
|
||||
Future<Mailbox?> createNewMailbox(AccountId accountId, CreateNewMailboxRequest newMailboxRequest) {
|
||||
return Future.sync(() async {
|
||||
return await mailboxAPI.createNewMailbox(accountId, newMailboxRequest);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Map<Id,SetError>> deleteMultipleMailbox(Session session, AccountId accountId, List<MailboxId> mailboxIds) {
|
||||
return Future.sync(() async {
|
||||
return await mailboxAPI.deleteMultipleMailbox(session, accountId, mailboxIds);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> renameMailbox(AccountId accountId, RenameMailboxRequest request) {
|
||||
return Future.sync(() async {
|
||||
return await mailboxAPI.renameMailbox(accountId, request);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> moveMailbox(AccountId accountId, MoveMailboxRequest request) {
|
||||
return Future.sync(() async {
|
||||
return await mailboxAPI.moveMailbox(accountId, request);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -107,26 +95,20 @@ class MailboxDataSourceImpl extends MailboxDataSource {
|
||||
mailboxId,
|
||||
totalEmailUnread,
|
||||
onProgressController);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> subscribeMailbox(AccountId accountId, SubscribeMailboxRequest request) {
|
||||
return Future.sync(() async {
|
||||
return await mailboxAPI.subscribeMailbox(accountId, request);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<MailboxId>> subscribeMultipleMailbox(AccountId accountId, SubscribeMultipleMailboxRequest subscribeRequest) {
|
||||
return Future.sync(() async {
|
||||
return await mailboxAPI.subscribeMultipleMailbox(accountId, subscribeRequest);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
}
|
||||
@@ -19,9 +19,7 @@ class StateDataSourceImpl extends StateDataSource {
|
||||
return Future.sync(() async {
|
||||
final stateCache = await _stateCacheClient.getItem(stateType.value);
|
||||
return stateCache?.toState();
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -33,8 +31,6 @@ class StateDataSourceImpl extends StateDataSource {
|
||||
} else {
|
||||
return await _stateCacheClient.insertItem(stateCache.type.value, stateCache);
|
||||
}
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ import 'package:core/core.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/session/session.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/state.dart' as jmapState;
|
||||
import 'package:jmap_dart_client/jmap/core/state.dart' as jmap_state;
|
||||
import 'package:model/model.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox/domain/model/mailbox_response.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox/domain/repository/mailbox_repository.dart';
|
||||
@@ -13,7 +13,7 @@ class RefreshAllMailboxInteractor {
|
||||
|
||||
RefreshAllMailboxInteractor(this._mailboxRepository);
|
||||
|
||||
Stream<Either<Failure, Success>> execute(Session session, AccountId accountId, jmapState.State currentState) async* {
|
||||
Stream<Either<Failure, Success>> execute(Session session, AccountId accountId, jmap_state.State currentState) async* {
|
||||
try {
|
||||
yield Right<Failure, Success>(RefreshingState());
|
||||
|
||||
|
||||
@@ -207,43 +207,41 @@ class MailboxController extends BaseMailboxController with MailboxActionHandlerM
|
||||
);
|
||||
|
||||
ever(mailboxDashBoardController.viewState, (state) {
|
||||
if (state is Either) {
|
||||
state.fold((failure) => null, (success) {
|
||||
if (success is MarkAsMultipleEmailReadAllSuccess) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is MarkAsMultipleEmailReadHasSomeEmailFailure) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is MoveMultipleEmailToMailboxAllSuccess) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is MoveMultipleEmailToMailboxHasSomeEmailFailure) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is DeleteMultipleEmailsPermanentlyAllSuccess) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is DeleteMultipleEmailsPermanentlyHasSomeEmailFailure) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is EmptyTrashFolderSuccess) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is MarkAsEmailReadSuccess) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is MoveToMailboxSuccess) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is DeleteEmailPermanentlySuccess) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is SaveEmailAsDraftsSuccess) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is RemoveEmailDraftsSuccess) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is SendEmailSuccess) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is MarkAsMailboxReadAllSuccess) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is MarkAsMailboxReadHasSomeEmailFailure) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is UpdateEmailDraftsSuccess) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
}
|
||||
});
|
||||
}
|
||||
state.fold((failure) => null, (success) {
|
||||
if (success is MarkAsMultipleEmailReadAllSuccess) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is MarkAsMultipleEmailReadHasSomeEmailFailure) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is MoveMultipleEmailToMailboxAllSuccess) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is MoveMultipleEmailToMailboxHasSomeEmailFailure) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is DeleteMultipleEmailsPermanentlyAllSuccess) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is DeleteMultipleEmailsPermanentlyHasSomeEmailFailure) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is EmptyTrashFolderSuccess) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is MarkAsEmailReadSuccess) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is MoveToMailboxSuccess) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is DeleteEmailPermanentlySuccess) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is SaveEmailAsDraftsSuccess) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is RemoveEmailDraftsSuccess) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is SendEmailSuccess) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is MarkAsMailboxReadAllSuccess) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is MarkAsMailboxReadHasSomeEmailFailure) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
} else if (success is UpdateEmailDraftsSuccess) {
|
||||
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
ever(mailboxDashBoardController.dashBoardAction, (action) {
|
||||
@@ -518,7 +516,7 @@ class MailboxController extends BaseMailboxController with MailboxActionHandlerM
|
||||
_imagePaths.icFolderMailbox,
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: Colors.white,
|
||||
colorFilter: Colors.white.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
backgroundColor: AppColor.toastSuccessBackgroundColor,
|
||||
textColor: Colors.white,
|
||||
@@ -544,7 +542,7 @@ class MailboxController extends BaseMailboxController with MailboxActionHandlerM
|
||||
_imagePaths.icNotConnection,
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: Colors.white,
|
||||
colorFilter: Colors.white.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
backgroundColor: AppColor.toastErrorBackgroundColor,
|
||||
textColor: Colors.white,
|
||||
@@ -828,7 +826,7 @@ class MailboxController extends BaseMailboxController with MailboxActionHandlerM
|
||||
_imagePaths.icFolderMailbox,
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: Colors.white,
|
||||
colorFilter: Colors.white.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
backgroundColor: AppColor.toastSuccessBackgroundColor,
|
||||
textColor: Colors.white,
|
||||
@@ -1029,9 +1027,9 @@ class MailboxController extends BaseMailboxController with MailboxActionHandlerM
|
||||
}
|
||||
|
||||
void _unsubscribeMailboxAction(MailboxId mailboxId) {
|
||||
final _accountId = mailboxDashBoardController.accountId.value;
|
||||
final accountId = mailboxDashBoardController.accountId.value;
|
||||
|
||||
if (_accountId != null) {
|
||||
if (accountId != null) {
|
||||
final subscribeRequest = generateSubscribeRequest(
|
||||
mailboxId,
|
||||
MailboxSubscribeState.disabled,
|
||||
@@ -1039,9 +1037,9 @@ class MailboxController extends BaseMailboxController with MailboxActionHandlerM
|
||||
);
|
||||
|
||||
if (subscribeRequest is SubscribeMultipleMailboxRequest) {
|
||||
consumeState(_subscribeMultipleMailboxInteractor.execute(_accountId, subscribeRequest));
|
||||
consumeState(_subscribeMultipleMailboxInteractor.execute(accountId, subscribeRequest));
|
||||
} else if (subscribeRequest is SubscribeMailboxRequest) {
|
||||
consumeState(_subscribeMailboxInteractor.execute(_accountId, subscribeRequest));
|
||||
consumeState(_subscribeMailboxInteractor.execute(accountId, subscribeRequest));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1120,7 +1118,7 @@ class MailboxController extends BaseMailboxController with MailboxActionHandlerM
|
||||
_imagePaths.icFolderMailbox,
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: Colors.white,
|
||||
colorFilter: Colors.white.asFilter(),
|
||||
fit: BoxFit.fill
|
||||
),
|
||||
backgroundColor: AppColor.toastSuccessBackgroundColor,
|
||||
@@ -1136,9 +1134,9 @@ class MailboxController extends BaseMailboxController with MailboxActionHandlerM
|
||||
MailboxId mailboxIdSubscribed,
|
||||
{List<MailboxId>? listDescendantMailboxIds}
|
||||
) {
|
||||
final _accountId = mailboxDashBoardController.accountId.value;
|
||||
final accountId = mailboxDashBoardController.accountId.value;
|
||||
|
||||
if (_accountId != null) {
|
||||
if (accountId != null) {
|
||||
SubscribeRequest? subscribeRequest;
|
||||
|
||||
if (listDescendantMailboxIds != null) {
|
||||
@@ -1157,9 +1155,9 @@ class MailboxController extends BaseMailboxController with MailboxActionHandlerM
|
||||
}
|
||||
|
||||
if (subscribeRequest is SubscribeMultipleMailboxRequest) {
|
||||
consumeState(_subscribeMultipleMailboxInteractor.execute(_accountId, subscribeRequest));
|
||||
consumeState(_subscribeMultipleMailboxInteractor.execute(accountId, subscribeRequest));
|
||||
} else if (subscribeRequest is SubscribeMailboxRequest) {
|
||||
consumeState(_subscribeMailboxInteractor.execute(_accountId, subscribeRequest));
|
||||
consumeState(_subscribeMailboxInteractor.execute(accountId, subscribeRequest));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ class MailboxView extends GetWidget<MailboxController>
|
||||
iconPadding: EdgeInsets.zero,
|
||||
icon: SvgPicture.asset(
|
||||
_imagePaths.icSearchBar,
|
||||
color: AppColor.colorTextButton,
|
||||
colorFilter: AppColor.colorTextButton.asFilter(),
|
||||
fit: BoxFit.fill
|
||||
),
|
||||
tooltip: AppLocalizations.of(context).searchForMailboxes,
|
||||
@@ -232,7 +232,10 @@ class MailboxView extends GetWidget<MailboxController>
|
||||
iconSize: 20,
|
||||
iconPadding: EdgeInsets.zero,
|
||||
splashRadius: 15,
|
||||
icon: SvgPicture.asset(_imagePaths.icAddNewFolder, color: AppColor.colorTextButton, fit: BoxFit.fill),
|
||||
icon: SvgPicture.asset(
|
||||
_imagePaths.icAddNewFolder,
|
||||
colorFilter: AppColor.colorTextButton.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
tooltip: AppLocalizations.of(context).new_mailbox,
|
||||
onTap: () => controller.goToCreateNewMailboxView(context)),
|
||||
],
|
||||
@@ -283,7 +286,8 @@ class MailboxView extends GetWidget<MailboxController>
|
||||
categories.getExpandMode(controller.mailboxCategoriesExpandMode.value) == ExpandMode.EXPAND
|
||||
? _imagePaths.icExpandFolder
|
||||
: _imagePaths.icCollapseFolder,
|
||||
color: AppColor.primaryColor, fit: BoxFit.fill),
|
||||
colorFilter: AppColor.primaryColor.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
tooltip: AppLocalizations.of(context).collapse,
|
||||
onTap: () => controller.toggleMailboxCategories(categories)),
|
||||
Expanded(child: Text(categories.getTitle(context),
|
||||
|
||||
@@ -151,7 +151,7 @@ class MailboxView extends GetWidget<MailboxController>
|
||||
iconPadding: EdgeInsets.zero,
|
||||
icon: SvgPicture.asset(
|
||||
_imagePaths.icSearchBar,
|
||||
color: AppColor.colorTextButton,
|
||||
colorFilter: AppColor.colorTextButton.asFilter(),
|
||||
fit: BoxFit.fill
|
||||
),
|
||||
onTap: () => controller.openSearchViewAction(context)
|
||||
@@ -161,7 +161,10 @@ class MailboxView extends GetWidget<MailboxController>
|
||||
iconSize: 20,
|
||||
iconPadding: EdgeInsets.zero,
|
||||
splashRadius: 15,
|
||||
icon: SvgPicture.asset(_imagePaths.icAddNewFolder, color: AppColor.colorTextButton, fit: BoxFit.fill),
|
||||
icon: SvgPicture.asset(
|
||||
_imagePaths.icAddNewFolder,
|
||||
colorFilter: AppColor.colorTextButton.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
tooltip: AppLocalizations.of(context).new_mailbox,
|
||||
onTap: () => controller.goToCreateNewMailboxView(context)),
|
||||
],
|
||||
@@ -396,7 +399,7 @@ class MailboxView extends GetWidget<MailboxController>
|
||||
iconSize: 28,
|
||||
icon: SvgPicture.asset(
|
||||
_imagePaths.icAppDashboard,
|
||||
color: AppColor.primaryColor,
|
||||
colorFilter: AppColor.primaryColor.asFilter(),
|
||||
fit: BoxFit.fill
|
||||
),
|
||||
tooltip: AppLocalizations.of(context).appGridTittle),
|
||||
@@ -423,7 +426,7 @@ class MailboxView extends GetWidget<MailboxController>
|
||||
controller.mailboxDashBoardController.appGridDashboardController.appDashboardExpandMode.value == ExpandMode.COLLAPSE
|
||||
? _imagePaths.icCollapseFolder
|
||||
: _imagePaths.icExpandFolder,
|
||||
color: AppColor.primaryColor,
|
||||
colorFilter: AppColor.primaryColor.asFilter(),
|
||||
fit: BoxFit.fill
|
||||
)),
|
||||
tooltip: AppLocalizations.of(context).appGridTittle,
|
||||
|
||||
@@ -145,7 +145,7 @@ mixin MailboxWidgetMixin {
|
||||
Key('${contextMenuItem.action.name}_action'),
|
||||
SvgPicture.asset(
|
||||
contextMenuItem.action.getContextMenuIcon(imagePaths),
|
||||
color: contextMenuItem.action.getColorContextMenuIcon(),
|
||||
colorFilter: contextMenuItem.action.getColorContextMenuIcon().asFilter(),
|
||||
width: 24,
|
||||
height: 24
|
||||
),
|
||||
@@ -298,7 +298,7 @@ mixin MailboxWidgetMixin {
|
||||
expandMode == ExpandMode.EXPAND
|
||||
? imagePaths.icExpandFolder
|
||||
: imagePaths.icCollapseFolder,
|
||||
color: AppColor.primaryColor,
|
||||
colorFilter: AppColor.primaryColor.asFilter(),
|
||||
fit: BoxFit.fill
|
||||
),
|
||||
tooltip: expandMode == ExpandMode.EXPAND
|
||||
|
||||
@@ -53,8 +53,8 @@ class MailboxNode with EquatableMixin{
|
||||
}
|
||||
|
||||
List<MailboxNode>? updateNode(MailboxId mailboxId, MailboxNode newNode, {MailboxNode? parent}) {
|
||||
List<MailboxNode>? _children = parent == null ? childrenItems : parent.childrenItems;
|
||||
return _children?.map((MailboxNode child) {
|
||||
List<MailboxNode>? children = parent == null ? childrenItems : parent.childrenItems;
|
||||
return children?.map((MailboxNode child) {
|
||||
if (child.item.id == mailboxId) {
|
||||
return newNode;
|
||||
} else {
|
||||
@@ -91,8 +91,8 @@ class MailboxNode with EquatableMixin{
|
||||
}
|
||||
|
||||
List<MailboxNode>? toggleSelectNode(MailboxNode selectedMailboxMode, {MailboxNode? parent}) {
|
||||
List<MailboxNode>? _children = parent == null ? childrenItems : parent.childrenItems;
|
||||
return _children?.map((MailboxNode child) {
|
||||
List<MailboxNode>? children = parent == null ? childrenItems : parent.childrenItems;
|
||||
return children?.map((MailboxNode child) {
|
||||
if (child.item.id == selectedMailboxMode.item.id) {
|
||||
return child.toggleSelectMailboxNode();
|
||||
} else {
|
||||
@@ -105,8 +105,8 @@ class MailboxNode with EquatableMixin{
|
||||
}
|
||||
|
||||
List<MailboxNode>? toSelectedNode({required SelectMode selectMode, ExpandMode? newExpandMode, MailboxNode? parent}) {
|
||||
List<MailboxNode>? _children = parent == null ? childrenItems : parent.childrenItems;
|
||||
return _children?.map((MailboxNode child) {
|
||||
List<MailboxNode>? children = parent == null ? childrenItems : parent.childrenItems;
|
||||
return children?.map((MailboxNode child) {
|
||||
if (child.hasChildren()) {
|
||||
return child.copyWith(
|
||||
children: toSelectedNode(selectMode: selectMode, newExpandMode: newExpandMode, parent: child),
|
||||
|
||||
@@ -49,7 +49,12 @@ class MailboxNewFolderTileBuilder {
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.only(left: 34),
|
||||
child: _icon != null
|
||||
? SvgPicture.asset(_icon!, width: 24, height: 24, color: AppColor.mailboxIconColor, fit: BoxFit.fill)
|
||||
? SvgPicture.asset(
|
||||
_icon!,
|
||||
width: 24,
|
||||
height: 24,
|
||||
colorFilter: AppColor.mailboxIconColor.asFilter(),
|
||||
fit: BoxFit.fill)
|
||||
: const SizedBox.shrink()),
|
||||
title: Padding(
|
||||
padding: const EdgeInsets.only(left: 8),
|
||||
|
||||
@@ -195,9 +195,9 @@ class MailBoxFolderTileBuilder {
|
||||
_mailboxNode.expandMode == ExpandMode.EXPAND
|
||||
? _imagePaths.icExpandFolder
|
||||
: _imagePaths.icCollapseFolder,
|
||||
color: _mailboxNode.item.allowedToDisplay
|
||||
? AppColor.primaryColor
|
||||
: AppColor.colorIconUnSubscribedMailbox,
|
||||
colorFilter: _mailboxNode.item.allowedToDisplay
|
||||
? AppColor.primaryColor.asFilter()
|
||||
: AppColor.colorIconUnSubscribedMailbox.asFilter(),
|
||||
fit: BoxFit.fill
|
||||
),
|
||||
minSize: 12,
|
||||
|
||||
@@ -82,7 +82,10 @@ class UserInformationWidgetBuilder extends StatelessWidget {
|
||||
Transform(
|
||||
transform: Matrix4.translationValues(14.0, 0.0, 0.0),
|
||||
child: IconButton(
|
||||
icon: SvgPicture.asset(_imagePaths.icCollapseFolder, fit: BoxFit.fill, color: AppColor.colorCollapseMailbox),
|
||||
icon: SvgPicture.asset(
|
||||
_imagePaths.icCollapseFolder,
|
||||
fit: BoxFit.fill,
|
||||
colorFilter: AppColor.colorCollapseMailbox.asFilter()),
|
||||
onPressed: () => {}))
|
||||
]),
|
||||
);
|
||||
|
||||
+2
-2
@@ -13,9 +13,9 @@ class CompositeNameValidator extends Validator<NewNameRequest> {
|
||||
CompositeNameValidator(this._listValidator);
|
||||
|
||||
@override
|
||||
Either<Failure, Success> validate(NewNameRequest newNameRequest) {
|
||||
Either<Failure, Success> validate(NewNameRequest value) {
|
||||
return _listValidator.isNotEmpty
|
||||
? _listValidator.getValidatorNameViewState(newNameRequest)
|
||||
? _listValidator.getValidatorNameViewState(value)
|
||||
: Right<Failure, Success>(VerifyNameViewState());
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -11,11 +11,11 @@ class DuplicateNameValidator extends Validator<NewNameRequest> {
|
||||
DuplicateNameValidator(this._listName);
|
||||
|
||||
@override
|
||||
Either<Failure, Success> validate(NewNameRequest newNameRequest) {
|
||||
if (newNameRequest.value != null) {
|
||||
Either<Failure, Success> validate(NewNameRequest value) {
|
||||
if (value.value != null) {
|
||||
final nameExist = _listName
|
||||
.map((nameItem) => nameItem.toLowerCase())
|
||||
.contains(newNameRequest.value!.toLowerCase());
|
||||
.contains(value.value!.toLowerCase());
|
||||
if (nameExist) {
|
||||
return Left<Failure, Success>(VerifyNameFailure(const DuplicatedNameException()));
|
||||
} else {
|
||||
|
||||
@@ -10,8 +10,8 @@ import 'package:tmail_ui_user/features/mailbox_creator/domain/state/verify_name_
|
||||
class EmailAddressValidator extends Validator<NewNameRequest> {
|
||||
|
||||
@override
|
||||
Either<Failure, Success> validate(NewNameRequest newNameRequest) {
|
||||
if (newNameRequest.value != null && GetUtils.isEmail(newNameRequest.value!)) {
|
||||
Either<Failure, Success> validate(NewNameRequest value) {
|
||||
if (value.value != null && GetUtils.isEmail(value.value!)) {
|
||||
return Right<Failure, Success>(VerifyNameViewState());
|
||||
} else {
|
||||
return Left<Failure, Success>(VerifyNameFailure(const EmailAddressInvalidException()));
|
||||
|
||||
@@ -9,8 +9,8 @@ import 'package:tmail_ui_user/features/mailbox_creator/domain/state/verify_name_
|
||||
class EmptyNameValidator extends Validator<NewNameRequest> {
|
||||
|
||||
@override
|
||||
Either<Failure, Success> validate(NewNameRequest newNameRequest) {
|
||||
if (newNameRequest.value == null || newNameRequest.value!.isEmpty) {
|
||||
Either<Failure, Success> validate(NewNameRequest value) {
|
||||
if (value.value == null || value.value!.isEmpty) {
|
||||
return Left<Failure, Success>(VerifyNameFailure(const EmptyNameException()));
|
||||
} else {
|
||||
return Right<Failure, Success>(VerifyNameViewState());
|
||||
|
||||
+2
-2
@@ -10,8 +10,8 @@ import 'package:tmail_ui_user/features/mailbox_creator/domain/state/verify_name_
|
||||
class SpecialCharacterValidator extends Validator<NewNameRequest> {
|
||||
|
||||
@override
|
||||
Either<Failure, Success> validate(NewNameRequest newNameRequest) {
|
||||
if (newNameRequest.value != null && newNameRequest.value!.hasSpecialCharactersInName()) {
|
||||
Either<Failure, Success> validate(NewNameRequest value) {
|
||||
if (value.value != null && value.value!.hasSpecialCharactersInName()) {
|
||||
return Left<Failure, Success>(VerifyNameFailure(const SpecialCharacterException()));
|
||||
} else {
|
||||
return Right<Failure, Success>(VerifyNameViewState());
|
||||
|
||||
@@ -180,7 +180,7 @@ class MailboxCreatorView extends GetWidget<MailboxCreatorController> {
|
||||
color: AppColor.primaryColor,
|
||||
icon: SvgPicture.asset(
|
||||
_imagePaths.icCollapseFolder,
|
||||
color: AppColor.colorCollapseMailbox,
|
||||
colorFilter: AppColor.colorCollapseMailbox.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
onPressed: () => controller.selectMailboxLocation(context))
|
||||
])),
|
||||
|
||||
@@ -25,9 +25,7 @@ class SearchDataSourceImpl extends SearchDataSource {
|
||||
recentSearch.value,
|
||||
recentSearch.toRecentSearchCache());
|
||||
}
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -47,9 +45,7 @@ class SearchDataSourceImpl extends SearchDataSource {
|
||||
: listRecentSearch;
|
||||
|
||||
return newListRecentSearch;
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
bool _filterRecentSearchCache(RecentSearchCache recentSearchCache, String? pattern) {
|
||||
|
||||
+6
-18
@@ -16,27 +16,21 @@ class SharePreferenceSpamReportDataSourceImpl extends SpamReportDataSource {
|
||||
Future<DateTime> getLastTimeDismissedSpamReported() async {
|
||||
return Future.sync(() async {
|
||||
return await _sharePreferenceSpamReportDataSource.getLastTimeDismissedSpamReported();
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> storeLastTimeDismissedSpamReported(DateTime lastTimeDismissedSpamReported) async {
|
||||
return Future.sync(() async {
|
||||
return await _sharePreferenceSpamReportDataSource.storeLastTimeDismissedSpamReported(lastTimeDismissedSpamReported);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> deleteLastTimeDismissedSpamReported() {
|
||||
return Future.sync(() async {
|
||||
return await _sharePreferenceSpamReportDataSource.deleteLastTimeDismissedSpamReported();
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -54,26 +48,20 @@ class SharePreferenceSpamReportDataSourceImpl extends SpamReportDataSource {
|
||||
Future<void> deleteSpamReportState() {
|
||||
return Future.sync(() async {
|
||||
return await _sharePreferenceSpamReportDataSource.deleteLastTimeDismissedSpamReported();
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<SpamReportState> getSpamReportState() {
|
||||
return Future.sync(() async {
|
||||
return await _sharePreferenceSpamReportDataSource.getSpamReportState();
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> storeSpamReportState(SpamReportState spamReportState) {
|
||||
return Future.sync(() async {
|
||||
return await _sharePreferenceSpamReportDataSource.storeSpamReportState(spamReportState);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-5
@@ -28,12 +28,10 @@ class SpamReportDataSourceImpl extends SpamReportDataSource {
|
||||
}
|
||||
) {
|
||||
return Future.sync(() async {
|
||||
final _unreadSpamEmailsResponse = await _spamReportApi.getUnreadSpamEmailbox(
|
||||
final unreadSpamEmailsResponse = await _spamReportApi.getUnreadSpamEmailbox(
|
||||
accountId, mailboxFilterCondition: mailboxFilterCondition, limit: limit);
|
||||
return _unreadSpamEmailsResponse;
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
return unreadSpamEmailsResponse;
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
+9
-9
@@ -14,15 +14,15 @@ class SharePreferenceSpamReportDataSource extends SpamReportDataSource {
|
||||
|
||||
@override
|
||||
Future<DateTime> getLastTimeDismissedSpamReported() async {
|
||||
final _timeStamp = _sharedPreferences.getInt(MailboxDashboardConstant.keyLastTimeDismissedSpamReported) ?? 0;
|
||||
final _lastTimeDismissedSpamReported = DateTime.fromMillisecondsSinceEpoch(_timeStamp);
|
||||
return _lastTimeDismissedSpamReported;
|
||||
final timeStamp = _sharedPreferences.getInt(MailboxDashboardConstant.keyLastTimeDismissedSpamReported) ?? 0;
|
||||
final lastTimeDismissedSpamReported = DateTime.fromMillisecondsSinceEpoch(timeStamp);
|
||||
return lastTimeDismissedSpamReported;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> storeLastTimeDismissedSpamReported(DateTime lastTimeDismissedSpamReported) async {
|
||||
final _timeStamp = lastTimeDismissedSpamReported.millisecondsSinceEpoch;
|
||||
return await _sharedPreferences.setInt(MailboxDashboardConstant.keyLastTimeDismissedSpamReported,_timeStamp);
|
||||
final timeStamp = lastTimeDismissedSpamReported.millisecondsSinceEpoch;
|
||||
return await _sharedPreferences.setInt(MailboxDashboardConstant.keyLastTimeDismissedSpamReported,timeStamp);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -48,13 +48,13 @@ class SharePreferenceSpamReportDataSource extends SpamReportDataSource {
|
||||
|
||||
@override
|
||||
Future<SpamReportState> getSpamReportState() async {
|
||||
final _spamReportState = _sharedPreferences.getString(MailboxDashboardConstant.keySpamReportState) ?? '';
|
||||
return _spamReportState == SpamReportState.disabled.keyValue ? SpamReportState.disabled : SpamReportState.enabled;
|
||||
final spamReportState = _sharedPreferences.getString(MailboxDashboardConstant.keySpamReportState) ?? '';
|
||||
return spamReportState == SpamReportState.disabled.keyValue ? SpamReportState.disabled : SpamReportState.enabled;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> storeSpamReportState(SpamReportState spamReportState) async {
|
||||
final _spamReportState = spamReportState.keyValue;
|
||||
return await _sharedPreferences.setString(MailboxDashboardConstant.keySpamReportState, _spamReportState);
|
||||
final spamReportState0 = spamReportState.keyValue;
|
||||
return await _sharedPreferences.setString(MailboxDashboardConstant.keySpamReportState, spamReportState0);
|
||||
}
|
||||
}
|
||||
@@ -40,12 +40,12 @@ class SpamReportApi {
|
||||
.build()
|
||||
.execute();
|
||||
|
||||
final _mailboxResponse = result
|
||||
final mailboxResponse = result
|
||||
.parse<GetMailboxResponse>(getMailboxInvocation.methodCallId, GetMailboxResponse.deserialize);
|
||||
|
||||
return Future.sync(() async {
|
||||
final _unreadSpamMailbox = _mailboxResponse?.list.first;
|
||||
return UnreadSpamEmailsResponse(unreadSpamMailbox: _unreadSpamMailbox);
|
||||
final unreadSpamMailbox = mailboxResponse?.list.first;
|
||||
return UnreadSpamEmailsResponse(unreadSpamMailbox: unreadSpamMailbox);
|
||||
}).catchError((error) {
|
||||
throw error;
|
||||
});
|
||||
|
||||
+8
-8
@@ -23,17 +23,17 @@ class GetUnreadSpamMailboxInteractor {
|
||||
) async* {
|
||||
try {
|
||||
yield Right(GetUnreadSpamMailboxLoading());
|
||||
final _lastTimeDissmissedSpamReported = await _spamReportRepository.getLastTimeDismissedSpamReported();
|
||||
final _timeLast = DateTime.now().difference(_lastTimeDissmissedSpamReported);
|
||||
final lastTimeDismissedSpamReported = await _spamReportRepository.getLastTimeDismissedSpamReported();
|
||||
final timeLast = DateTime.now().difference(lastTimeDismissedSpamReported);
|
||||
|
||||
final _checkTimeCondition = (_timeLast.inHours > 0) && (_timeLast.inHours > conditionsForDisplayingSpamReportBanner);
|
||||
final checkTimeCondition = (timeLast.inHours > 0) && (timeLast.inHours > conditionsForDisplayingSpamReportBanner);
|
||||
|
||||
if (_checkTimeCondition) {
|
||||
final _response = await _spamReportRepository.getUnreadSpamMailbox(accountId, mailboxFilterCondition: mailboxFilterCondition, limit: limit);
|
||||
final _unreadSpamMailbox = _response.unreadSpamMailbox;
|
||||
if (checkTimeCondition) {
|
||||
final response = await _spamReportRepository.getUnreadSpamMailbox(accountId, mailboxFilterCondition: mailboxFilterCondition, limit: limit);
|
||||
final unreadSpamMailbox = response.unreadSpamMailbox;
|
||||
|
||||
if (_unreadSpamMailbox!.unreadEmails!.value.value > 0) {
|
||||
yield Right(GetUnreadSpamMailboxSuccess(_unreadSpamMailbox));
|
||||
if (unreadSpamMailbox!.unreadEmails!.value.value > 0) {
|
||||
yield Right(GetUnreadSpamMailboxSuccess(unreadSpamMailbox));
|
||||
} else {
|
||||
yield Left(InvalidSpamReportCondition());
|
||||
}
|
||||
|
||||
+2
-2
@@ -137,12 +137,12 @@ class AdvancedFilterController extends BaseController {
|
||||
|
||||
void selectedMailBox(BuildContext context) async {
|
||||
final accountId = _mailboxDashBoardController.accountId.value;
|
||||
final _session = _mailboxDashBoardController.sessionCurrent;
|
||||
final session = _mailboxDashBoardController.sessionCurrent;
|
||||
if (accountId != null) {
|
||||
final arguments = DestinationPickerArguments(
|
||||
accountId,
|
||||
MailboxActions.select,
|
||||
_session,
|
||||
session,
|
||||
mailboxIdSelected: searchController.searchEmailFilter.value.mailbox?.id);
|
||||
|
||||
if (BuildUtils.isWeb) {
|
||||
|
||||
+5
-5
@@ -573,7 +573,7 @@ class MailboxDashBoardController extends ReloadableController {
|
||||
_imagePaths.icMailboxDrafts,
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: Colors.white,
|
||||
colorFilter: Colors.white.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
backgroundColor: AppColor.toastSuccessBackgroundColor,
|
||||
textColor: Colors.white,
|
||||
@@ -606,7 +606,7 @@ class MailboxDashBoardController extends ReloadableController {
|
||||
_imagePaths.icFolderMailbox,
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: Colors.white,
|
||||
colorFilter: Colors.white.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
backgroundColor: AppColor.toastSuccessBackgroundColor,
|
||||
textColor: Colors.white,
|
||||
@@ -939,7 +939,7 @@ class MailboxDashBoardController extends ReloadableController {
|
||||
_imagePaths.icFolderMailbox,
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: Colors.white,
|
||||
colorFilter: Colors.white.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
backgroundColor: AppColor.toastSuccessBackgroundColor,
|
||||
textColor: Colors.white,
|
||||
@@ -1553,8 +1553,8 @@ class MailboxDashBoardController extends ReloadableController {
|
||||
}
|
||||
|
||||
void storeSpamReportStateAction() {
|
||||
final _storeSpamReportState = enableSpamReport ? SpamReportState.disabled : SpamReportState.enabled;
|
||||
spamReportController.storeSpamReportStateAction(_storeSpamReportState);
|
||||
final storeSpamReportState = enableSpamReport ? SpamReportState.disabled : SpamReportState.enabled;
|
||||
spamReportController.storeSpamReportStateAction(storeSpamReportState);
|
||||
}
|
||||
|
||||
void onDragMailbox(bool isDragging) {
|
||||
|
||||
@@ -62,9 +62,9 @@ class SpamReportController extends BaseController {
|
||||
}
|
||||
|
||||
void getUnreadSpamMailboxAction(AccountId accountId) {
|
||||
final _mailboxFilterCondition = MailboxFilterCondition(role: Role('Spam'));
|
||||
final mailboxFilterCondition = MailboxFilterCondition(role: Role('Spam'));
|
||||
getSpamReportStateAction();
|
||||
consumeState(_getNumberOfUnreadSpamEmailsInteractor.execute(accountId,mailboxFilterCondition: _mailboxFilterCondition));
|
||||
consumeState(_getNumberOfUnreadSpamEmailsInteractor.execute(accountId,mailboxFilterCondition: mailboxFilterCondition));
|
||||
}
|
||||
|
||||
void _storeLastTimeDismissedSpamReportedAction() {
|
||||
@@ -78,9 +78,9 @@ class SpamReportController extends BaseController {
|
||||
bool get enableSpamReport => _spamReportState.value == SpamReportState.enabled;
|
||||
|
||||
void openMailbox(BuildContext context) {
|
||||
final _mailboxDashBoardController = Get.find<MailboxDashBoardController>();
|
||||
final mailboxDashBoardController = Get.find<MailboxDashBoardController>();
|
||||
dismissSpamReportAction();
|
||||
_mailboxDashBoardController.openMailboxAction(context, _presentationSpamMailbox.value!);
|
||||
mailboxDashBoardController.openMailboxAction(context, _presentationSpamMailbox.value!);
|
||||
}
|
||||
|
||||
void storeSpamReportStateAction(SpamReportState spamReportState) {
|
||||
|
||||
@@ -105,6 +105,7 @@ class MailboxDashBoardView extends BaseMailboxDashBoardView {
|
||||
Column(children: [
|
||||
_buildComposerButton(context),
|
||||
Expanded(child: SizedBox(
|
||||
width: ResponsiveUtils.defaultSizeMenu,
|
||||
child: Obx(() {
|
||||
if (controller.searchMailboxActivated.isTrue) {
|
||||
return const SearchMailboxView(
|
||||
@@ -113,8 +114,7 @@ class MailboxDashBoardView extends BaseMailboxDashBoardView {
|
||||
} else {
|
||||
return MailboxView();
|
||||
}
|
||||
}),
|
||||
width: ResponsiveUtils.defaultSizeMenu
|
||||
})
|
||||
))
|
||||
]),
|
||||
Expanded(child: Column(children: [
|
||||
@@ -204,8 +204,8 @@ class MailboxDashBoardView extends BaseMailboxDashBoardView {
|
||||
key: controller.scaffoldKey,
|
||||
drawer: ResponsiveWidget(
|
||||
responsiveUtils: responsiveUtils,
|
||||
mobile: SizedBox(child: MailboxView(), width: ResponsiveUtils.defaultSizeDrawer),
|
||||
tabletLarge: SizedBox(child: MailboxView(), width: ResponsiveUtils.defaultSizeLeftMenuMobile),
|
||||
mobile: SizedBox(width: ResponsiveUtils.defaultSizeDrawer, child: MailboxView()),
|
||||
tabletLarge: SizedBox(width: ResponsiveUtils.defaultSizeLeftMenuMobile, child: MailboxView()),
|
||||
desktop: const SizedBox.shrink()
|
||||
),
|
||||
body: body,
|
||||
@@ -306,16 +306,6 @@ class MailboxDashBoardView extends BaseMailboxDashBoardView {
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () => appGridDashboardController.toggleAppGridDashboard()),
|
||||
child: PortalTarget(
|
||||
child: buildIconWeb(
|
||||
onTap: controller.showAppDashboardAction,
|
||||
splashRadius: 20,
|
||||
icon: SvgPicture.asset(
|
||||
imagePaths.icAppDashboard,
|
||||
width: 28,
|
||||
height: 28,
|
||||
fit: BoxFit.fill
|
||||
),
|
||||
),
|
||||
anchor: const Aligned(
|
||||
follower: Alignment.topRight,
|
||||
target: Alignment.bottomRight
|
||||
@@ -327,6 +317,16 @@ class MailboxDashBoardView extends BaseMailboxDashBoardView {
|
||||
return const SizedBox.shrink();
|
||||
}),
|
||||
visible: appGridDashboardController.isAppGridDashboardOverlayOpen.isTrue,
|
||||
child: buildIconWeb(
|
||||
onTap: controller.showAppDashboardAction,
|
||||
splashRadius: 20,
|
||||
icon: SvgPicture.asset(
|
||||
imagePaths.icAppDashboard,
|
||||
width: 28,
|
||||
height: 28,
|
||||
fit: BoxFit.fill
|
||||
),
|
||||
),
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
+2
-2
@@ -63,8 +63,8 @@ mixin FilterEmailPopupMenuMixin {
|
||||
width: 20,
|
||||
height: 20,
|
||||
fit: BoxFit.fill,
|
||||
color: option != FilterMessageOption.starred
|
||||
? AppColor.colorTextButton
|
||||
colorFilter: option != FilterMessageOption.starred
|
||||
? AppColor.colorTextButton.asFilter()
|
||||
: null),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(child: Text(
|
||||
|
||||
+3
-3
@@ -6,7 +6,7 @@ import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/widgets/ad
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
Future<void> showAdvancedSearchFilterBottomSheet(BuildContext context) async {
|
||||
final ImagePaths _imagePaths = Get.find<ImagePaths>();
|
||||
final ImagePaths imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
await FullScreenActionSheetBuilder(
|
||||
context: context,
|
||||
@@ -19,8 +19,8 @@ Future<void> showAdvancedSearchFilterBottomSheet(BuildContext context) async {
|
||||
cancelWidget: Padding(
|
||||
padding: const EdgeInsets.only(right: 16),
|
||||
child: SvgPicture.asset(
|
||||
_imagePaths.icCloseAdvancedSearch,
|
||||
color: AppColor.colorHintSearchBar,
|
||||
imagePaths.icCloseAdvancedSearch,
|
||||
colorFilter: AppColor.colorHintSearchBar.asFilter(),
|
||||
width: 24,
|
||||
height: 24,
|
||||
),
|
||||
|
||||
+6
-6
@@ -18,15 +18,15 @@ class AdvancedSearchFilterFormBottomView extends GetWidget<AdvancedFilterControl
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
final responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: _isMobileAndLandscapeTablet(context, _responsiveUtils) ? 8 : 20),
|
||||
top: _isMobileAndLandscapeTablet(context, responsiveUtils) ? 8 : 20),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (_isMobileAndLandscapeTablet(context, _responsiveUtils))
|
||||
if (_isMobileAndLandscapeTablet(context, responsiveUtils))
|
||||
...[
|
||||
_buildCheckboxHasAttachment(
|
||||
context,
|
||||
@@ -35,17 +35,17 @@ class AdvancedSearchFilterFormBottomView extends GetWidget<AdvancedFilterControl
|
||||
const SizedBox(height: 24)
|
||||
],
|
||||
Row(
|
||||
mainAxisAlignment: _isMobileAndLandscapeTablet(context, _responsiveUtils)
|
||||
mainAxisAlignment: _isMobileAndLandscapeTablet(context, responsiveUtils)
|
||||
? MainAxisAlignment.spaceEvenly
|
||||
: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
if (!_isMobileAndLandscapeTablet(context, _responsiveUtils))
|
||||
if (!_isMobileAndLandscapeTablet(context, responsiveUtils))
|
||||
Expanded(child: _buildCheckboxHasAttachment(
|
||||
context,
|
||||
currentFocusNode: focusManager?.attachmentCheckboxFocusNode,
|
||||
nextFocusNode: focusManager?.searchButtonFocusNode)),
|
||||
..._buildListButton(context, _responsiveUtils),
|
||||
..._buildListButton(context, responsiveUtils),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
||||
+2
-2
@@ -42,7 +42,7 @@ Widget _buildDropDownButton<T>({
|
||||
DateTime? startDate,
|
||||
DateTime? endDate
|
||||
}) {
|
||||
final ImagePaths _imagePaths = Get.find<ImagePaths>();
|
||||
final ImagePaths imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
return DropdownButtonHideUnderline(
|
||||
child: DropdownButton2<T>(
|
||||
@@ -68,7 +68,7 @@ Widget _buildDropDownButton<T>({
|
||||
.toList(),
|
||||
value: itemSelected,
|
||||
onChanged: onChanged,
|
||||
icon: SvgPicture.asset(_imagePaths.icDropDown),
|
||||
icon: SvgPicture.asset(imagePaths.icDropDown),
|
||||
buttonPadding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
buttonDecoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
|
||||
+3
-3
@@ -28,9 +28,9 @@ class IconOpenAdvancedSearchWidget extends StatelessWidget {
|
||||
minSize: 40,
|
||||
iconPadding: const EdgeInsets.only(right: 2),
|
||||
icon: SvgPicture.asset(_imagePaths.icFilterAdvanced,
|
||||
color: searchController.isAdvancedSearchViewOpen.isTrue || searchController.advancedSearchIsActivated.isTrue
|
||||
? AppColor.colorFilterMessageEnabled
|
||||
: AppColor.colorFilterMessageDisabled,
|
||||
colorFilter: searchController.isAdvancedSearchViewOpen.isTrue || searchController.advancedSearchIsActivated.isTrue
|
||||
? AppColor.colorFilterMessageEnabled.asFilter()
|
||||
: AppColor.colorFilterMessageDisabled.asFilter(),
|
||||
width: 16,
|
||||
height: 16),
|
||||
onTap: () {
|
||||
|
||||
+2
-2
@@ -19,7 +19,7 @@ class DownloadTaskItemWidget extends StatelessWidget with AppLoaderMixin {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
final imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
return Container(
|
||||
padding: EdgeInsets.zero,
|
||||
@@ -36,7 +36,7 @@ class DownloadTaskItemWidget extends StatelessWidget with AppLoaderMixin {
|
||||
height: 30,
|
||||
child: Stack(alignment: Alignment.center, children: [
|
||||
SvgPicture.asset(
|
||||
taskState.attachment.getIcon(_imagePaths),
|
||||
taskState.attachment.getIcon(imagePaths),
|
||||
width: 16,
|
||||
height: 16,
|
||||
fit: BoxFit.fill),
|
||||
|
||||
+9
-9
@@ -12,10 +12,10 @@ class SpamReportBannerWebWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
final _spamReportController = Get.find<SpamReportController>();
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
final spamReportController = Get.find<SpamReportController>();
|
||||
final imagePaths = Get.find<ImagePaths>();
|
||||
return Obx(() {
|
||||
if (!_spamReportController.enableSpamReport || _spamReportController.notShowSpamReportBanner) {
|
||||
if (!spamReportController.enableSpamReport || spamReportController.notShowSpamReportBanner) {
|
||||
return const SizedBox(
|
||||
height: 8,
|
||||
);
|
||||
@@ -36,15 +36,15 @@ class SpamReportBannerWebWidget extends StatelessWidget {
|
||||
Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
_imagePaths.icInfoCircleOutline,
|
||||
imagePaths.icInfoCircleOutline,
|
||||
width: 28,
|
||||
height: 28,
|
||||
color: AppColor.primaryColor,
|
||||
colorFilter: AppColor.primaryColor.asFilter(),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
AppLocalizations.of(context).countNewSpamEmails(
|
||||
_spamReportController.numberOfUnreadSpamEmails),
|
||||
spamReportController.numberOfUnreadSpamEmails),
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
color: AppColor.primaryColor,
|
||||
@@ -66,7 +66,7 @@ class SpamReportBannerWebWidget extends StatelessWidget {
|
||||
fontWeight: FontWeight.w400),
|
||||
backgroundColor: AppColor.colorCreateNewIdentityButton,
|
||||
radius: 10,
|
||||
onTap: () => _spamReportController.openMailbox(context),
|
||||
onTap: () => spamReportController.openMailbox(context),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -75,8 +75,8 @@ class SpamReportBannerWebWidget extends StatelessWidget {
|
||||
top: 16,
|
||||
right: 16,
|
||||
child: buildSVGIconButton(
|
||||
icon: _imagePaths.icCloseComposer,
|
||||
onTap: () => _spamReportController.dismissSpamReportAction(),
|
||||
icon: imagePaths.icCloseComposer,
|
||||
onTap: () => spamReportController.dismissSpamReportAction(),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -42,7 +42,7 @@ class TopBarThreadSelection {
|
||||
buildIconWeb(
|
||||
icon: SvgPicture.asset(
|
||||
imagePaths.icCloseComposer,
|
||||
color: AppColor.colorTextButton,
|
||||
colorFilter: AppColor.colorTextButton.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
tooltip: AppLocalizations.of(context).cancel,
|
||||
onTap: onCancelSelection),
|
||||
@@ -113,9 +113,9 @@ class TopBarThreadSelection {
|
||||
canDeletePermanently
|
||||
? imagePaths.icDeleteComposer
|
||||
: imagePaths.icDelete,
|
||||
color: canDeletePermanently
|
||||
? AppColor.colorDeletePermanentlyButton
|
||||
: AppColor.primaryColor,
|
||||
colorFilter: canDeletePermanently
|
||||
? AppColor.colorDeletePermanentlyButton.asFilter()
|
||||
: AppColor.primaryColor.asFilter(),
|
||||
width: 20,
|
||||
height: 20,
|
||||
fit: BoxFit.fill),
|
||||
|
||||
@@ -18,35 +18,27 @@ class ForwardingDataSourceImpl extends ForwardingDataSource {
|
||||
Future<TMailForward> getForward(AccountId accountId) {
|
||||
return Future.sync(() async {
|
||||
return await _forwardingAPI.getForward(accountId);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<TMailForward> deleteRecipientInForwarding(AccountId accountId, DeleteRecipientInForwardingRequest deleteRequest) {
|
||||
return Future.sync(() async {
|
||||
return await _forwardingAPI.updateForward(accountId, deleteRequest.newTMailForward);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<TMailForward> addRecipientsInForwarding(AccountId accountId, AddRecipientInForwardingRequest addRequest) {
|
||||
return Future.sync(() async {
|
||||
return await _forwardingAPI.updateForward(accountId, addRequest.newTMailForward);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<TMailForward> editLocalCopyInForwarding(AccountId accountId, EditLocalCopyInForwardingRequest editRequest) {
|
||||
return Future.sync(() async {
|
||||
return await _forwardingAPI.updateForward(accountId, editRequest.newTMailForward);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
}
|
||||
@@ -20,35 +20,27 @@ class IdentityDataSourceImpl extends IdentityDataSource {
|
||||
{Properties? properties}) {
|
||||
return Future.sync(() async {
|
||||
return await _identityAPI.getAllIdentities(accountId, properties: properties);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Identity> createNewIdentity(AccountId accountId, CreateNewIdentityRequest identityRequest) {
|
||||
return Future.sync(() async {
|
||||
return await _identityAPI.createNewIdentity(accountId, identityRequest);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> deleteIdentity(AccountId accountId, IdentityId identityId) {
|
||||
return Future.sync(() async {
|
||||
return await _identityAPI.deleteIdentity(accountId, identityId);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> editIdentity(AccountId accountId, EditIdentityRequest editIdentityRequest) {
|
||||
return Future.sync(() async {
|
||||
return await _identityAPI.editIdentity(accountId, editIdentityRequest);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
}
|
||||
+1
-3
@@ -18,8 +18,6 @@ class ManageAccountDataSourceImpl extends ManageAccountDataSource {
|
||||
Future<void> persistLanguage(Locale localeCurrent) {
|
||||
return Future.sync(() async {
|
||||
return await _languageCacheManager.persistLanguage(localeCurrent);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
}
|
||||
@@ -22,9 +22,7 @@ class RuleFilterDataSourceImpl extends RuleFilterDataSource {
|
||||
Future<List<TMailRule>> getAllTMailRule(AccountId accountId) {
|
||||
return Future.sync(() async {
|
||||
return await _ruleFilterAPI.getListTMailRule(accountId);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -34,26 +32,20 @@ class RuleFilterDataSourceImpl extends RuleFilterDataSource {
|
||||
|
||||
return Future.sync(() async {
|
||||
return await _ruleFilterAPI.updateListTMailRule(accountId, deleteEmailRuleRequest.currentEmailRules);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<TMailRule>> createNewEmailRuleFilter(AccountId accountId, CreateNewEmailRuleFilterRequest ruleFilterRequest) {
|
||||
return Future.sync(() async {
|
||||
return await _ruleFilterAPI.updateListTMailRule(accountId, ruleFilterRequest.newListTMailRules);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<TMailRule>> editEmailRuleFilter(AccountId accountId, EditEmailRuleFilterRequest ruleFilterRequest) {
|
||||
return Future.sync(() async {
|
||||
return await _ruleFilterAPI.updateListTMailRule(accountId, ruleFilterRequest.listTMailRulesUpdated);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
}
|
||||
@@ -15,17 +15,13 @@ class VacationDataSourceImpl extends VacationDataSource {
|
||||
Future<List<VacationResponse>> getAllVacationResponse(AccountId accountId) {
|
||||
return Future.sync(() async {
|
||||
return await _vacationAPI.getAllVacationResponse(accountId);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<VacationResponse>> updateVacation(AccountId accountId, VacationResponse vacationResponse) {
|
||||
return Future.sync(() async {
|
||||
return await _vacationAPI.updateVacation(accountId, vacationResponse);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
}
|
||||
@@ -271,8 +271,9 @@ class EmailRulesController extends BaseController {
|
||||
Widget _deleteEmailRuleActionTile(BuildContext context, TMailRule rule) {
|
||||
return (EmailRuleBottomSheetActionTileBuilder(
|
||||
const Key('delete_emailRule_action'),
|
||||
SvgPicture.asset(_imagePaths.icDeleteComposer,
|
||||
color: AppColor.colorActionDeleteConfirmDialog),
|
||||
SvgPicture.asset(
|
||||
_imagePaths.icDeleteComposer,
|
||||
colorFilter: AppColor.colorActionDeleteConfirmDialog.asFilter()),
|
||||
AppLocalizations.of(context).deleteRule,
|
||||
rule,
|
||||
iconLeftPadding: const EdgeInsets.only(left: 12, right: 16),
|
||||
|
||||
@@ -140,7 +140,7 @@ class ForwardView extends GetWidget<ForwardController> with AppLoaderMixin {
|
||||
_imagePaths.icNotConnection,
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: Colors.white,
|
||||
colorFilter: Colors.white.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
backgroundColor: AppColor.toastErrorBackgroundColor,
|
||||
textColor: Colors.white,
|
||||
|
||||
+3
-3
@@ -31,7 +31,7 @@ class EmailForwardItemWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
final imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 4),
|
||||
@@ -53,7 +53,7 @@ class EmailForwardItemWidget extends StatelessWidget {
|
||||
recipientForward.selectMode == SelectMode.ACTIVE ? 12 : 0))
|
||||
),
|
||||
child: Row(children: [
|
||||
_buildAvatarIcon(_imagePaths),
|
||||
_buildAvatarIcon(imagePaths),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
@@ -92,7 +92,7 @@ class EmailForwardItemWidget extends StatelessWidget {
|
||||
buildIconWeb(
|
||||
iconSize: 30,
|
||||
splashRadius: 20,
|
||||
icon: SvgPicture.asset(_imagePaths.icDeleteRecipient),
|
||||
icon: SvgPicture.asset(imagePaths.icDeleteRecipient),
|
||||
onTap: () => onDeleteRecipientCallback?.call(recipientForward)
|
||||
)
|
||||
]),
|
||||
|
||||
+2
-2
@@ -82,6 +82,7 @@ class ListEmailForwardsWidget extends GetWidget<ForwardController> {
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
customBorder: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(5))),
|
||||
onTap: controller.selectAllRecipientForward,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
|
||||
child: Text(
|
||||
@@ -93,7 +94,6 @@ class ListEmailForwardsWidget extends GetWidget<ForwardController> {
|
||||
)
|
||||
),
|
||||
),
|
||||
onTap: controller.selectAllRecipientForward,
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -107,7 +107,7 @@ class ListEmailForwardsWidget extends GetWidget<ForwardController> {
|
||||
buildIconWeb(
|
||||
icon: SvgPicture.asset(
|
||||
_imagePaths.icCloseComposer,
|
||||
color: AppColor.colorTextButton,
|
||||
colorFilter: AppColor.colorTextButton.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
tooltip: AppLocalizations.of(context).cancel,
|
||||
onTap: controller.cancelSelectionMode
|
||||
|
||||
+17
-17
@@ -96,10 +96,10 @@ class MailboxVisibilityController extends BaseMailboxController {
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
final _session = _accountDashBoardController.sessionCurrent.value;
|
||||
final _accountId = _accountDashBoardController.accountId.value;
|
||||
if(_session != null && _accountId != null) {
|
||||
getAllMailbox(_session, _accountId);
|
||||
final session = _accountDashBoardController.sessionCurrent.value;
|
||||
final accountId = _accountDashBoardController.accountId.value;
|
||||
if(session != null && accountId != null) {
|
||||
getAllMailbox(session, accountId);
|
||||
}
|
||||
super.onReady();
|
||||
}
|
||||
@@ -111,22 +111,22 @@ class MailboxVisibilityController extends BaseMailboxController {
|
||||
}
|
||||
|
||||
void subscribeMailbox(MailboxNode mailboxNode) {
|
||||
final _mailboxSubscribeState = mailboxNode.item.isSubscribedMailbox
|
||||
final mailboxSubscribeState = mailboxNode.item.isSubscribedMailbox
|
||||
? MailboxSubscribeState.disabled : MailboxSubscribeState.enabled;
|
||||
final _mailboxSubscribeStateAction = mailboxNode.item.isSubscribedMailbox
|
||||
final mailboxSubscribeStateAction = mailboxNode.item.isSubscribedMailbox
|
||||
? MailboxSubscribeAction.unSubscribe : MailboxSubscribeAction.subscribe;
|
||||
_subscribeMailboxAction(
|
||||
SubscribeMailboxRequest(
|
||||
mailboxNode.item.id,
|
||||
_mailboxSubscribeState,
|
||||
_mailboxSubscribeStateAction,
|
||||
mailboxSubscribeState,
|
||||
mailboxSubscribeStateAction,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
void _subscribeMailboxAction(SubscribeMailboxRequest subscribeMailboxRequest) {
|
||||
final _accountId = _accountDashBoardController.accountId.value;
|
||||
if (_accountId != null) {
|
||||
final accountId = _accountDashBoardController.accountId.value;
|
||||
if (accountId != null) {
|
||||
final subscribeRequest = generateSubscribeRequest(
|
||||
subscribeMailboxRequest.mailboxId,
|
||||
subscribeMailboxRequest.subscribeState,
|
||||
@@ -134,9 +134,9 @@ class MailboxVisibilityController extends BaseMailboxController {
|
||||
);
|
||||
|
||||
if (subscribeRequest is SubscribeMultipleMailboxRequest) {
|
||||
consumeState(_subscribeMultipleMailboxInteractor!.execute(_accountId, subscribeRequest));
|
||||
consumeState(_subscribeMultipleMailboxInteractor!.execute(accountId, subscribeRequest));
|
||||
} else if (subscribeRequest is SubscribeMailboxRequest) {
|
||||
consumeState(_subscribeMailboxInteractor!.execute(_accountId, subscribeRequest));
|
||||
consumeState(_subscribeMailboxInteractor!.execute(accountId, subscribeRequest));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -196,11 +196,11 @@ class MailboxVisibilityController extends BaseMailboxController {
|
||||
}
|
||||
|
||||
void _refreshMailboxChanges(jmap.State? newMailboxState) {
|
||||
final _session = _accountDashBoardController.sessionCurrent.value;
|
||||
final _accountId = _accountDashBoardController.accountId.value;
|
||||
final session = _accountDashBoardController.sessionCurrent.value;
|
||||
final accountId = _accountDashBoardController.accountId.value;
|
||||
final mailboxState = newMailboxState ?? currentMailboxState;
|
||||
if (_session != null && _accountId != null && mailboxState != null) {
|
||||
refreshMailboxChanges(_session, _accountId, mailboxState);
|
||||
if (session != null && accountId != null && mailboxState != null) {
|
||||
refreshMailboxChanges(session, accountId, mailboxState);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ class MailboxVisibilityController extends BaseMailboxController {
|
||||
_imagePaths.icFolderMailbox,
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: Colors.white,
|
||||
colorFilter: Colors.white.asFilter(),
|
||||
fit: BoxFit.fill
|
||||
),
|
||||
backgroundColor: AppColor.toastSuccessBackgroundColor,
|
||||
|
||||
+6
-6
@@ -62,9 +62,9 @@ class MailBoxVisibilityFolderTileBuilder extends StatelessWidget {
|
||||
_mailboxNode.expandMode == ExpandMode.EXPAND
|
||||
? _imagePaths.icExpandFolder
|
||||
: _imagePaths.icCollapseFolder,
|
||||
color: _mailboxNode.item.allowedToDisplay
|
||||
? AppColor.primaryColor
|
||||
: AppColor.colorIconUnSubscribedMailbox,
|
||||
colorFilter: _mailboxNode.item.allowedToDisplay
|
||||
? AppColor.primaryColor.asFilter()
|
||||
: AppColor.colorIconUnSubscribedMailbox.asFilter(),
|
||||
fit: BoxFit.fill
|
||||
),
|
||||
tooltip: _mailboxNode.expandMode == ExpandMode.EXPAND
|
||||
@@ -120,9 +120,9 @@ class MailBoxVisibilityFolderTileBuilder extends StatelessWidget {
|
||||
_mailboxNode.item.getMailboxIcon(_imagePaths),
|
||||
width: 20,
|
||||
height: 20,
|
||||
color: _mailboxNode.item.allowedToDisplay
|
||||
? AppColor.primaryColor
|
||||
: AppColor.colorIconUnSubscribedMailbox,
|
||||
colorFilter: _mailboxNode.item.allowedToDisplay
|
||||
? AppColor.primaryColor.asFilter()
|
||||
: AppColor.colorIconUnSubscribedMailbox.asFilter(),
|
||||
fit: BoxFit.fill
|
||||
),
|
||||
);
|
||||
|
||||
@@ -77,7 +77,7 @@ class ManageAccountDashBoardView extends GetWidget<ManageAccountDashBoardControl
|
||||
Expanded(child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(child: ManageAccountMenuView(), width: ResponsiveUtils.defaultSizeMenu),
|
||||
SizedBox(width: ResponsiveUtils.defaultSizeMenu, child: ManageAccountMenuView()),
|
||||
Expanded(child: Container(
|
||||
color: AppColor.colorBgDesktop,
|
||||
child: Column(children: [
|
||||
|
||||
@@ -134,7 +134,7 @@ class SettingsView extends GetWidget<SettingsController> {
|
||||
_imagePaths.icBack,
|
||||
width: 18,
|
||||
height: 18,
|
||||
color: AppColor.colorTextButton,
|
||||
colorFilter: AppColor.colorTextButton.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(left: 8),
|
||||
|
||||
+2
-3
@@ -30,7 +30,7 @@ class SettingFirstLevelTileBuilder extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(child: Padding(
|
||||
return InkWell(onTap: clickAction,child: Padding(
|
||||
padding: const EdgeInsets.only(top: 24, bottom: 24),
|
||||
child: Row(
|
||||
children: [
|
||||
@@ -76,11 +76,10 @@ class SettingFirstLevelTileBuilder extends StatelessWidget {
|
||||
icon: SvgPicture.asset(
|
||||
_imagePath.icCollapseFolder,
|
||||
fit: BoxFit.fill,
|
||||
color: AppColor.colorCollapseMailbox),
|
||||
colorFilter: AppColor.colorCollapseMailbox.asFilter()),
|
||||
onPressed: clickAction
|
||||
)
|
||||
])),
|
||||
onTap: clickAction,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ class VacationController extends BaseController {
|
||||
onPrimary: Colors.white,
|
||||
onSurface: Colors.black),
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style: TextButton.styleFrom(primary: AppColor.primaryColor))),
|
||||
style: TextButton.styleFrom(foregroundColor: AppColor.primaryColor))),
|
||||
child: child!);
|
||||
}
|
||||
);
|
||||
@@ -207,7 +207,7 @@ class VacationController extends BaseController {
|
||||
onPrimary: Colors.white,
|
||||
onSurface: Colors.black),
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style: TextButton.styleFrom(primary: AppColor.primaryColor))),
|
||||
style: TextButton.styleFrom(foregroundColor: AppColor.primaryColor))),
|
||||
child: MediaQuery(
|
||||
data: const MediaQueryData(alwaysUse24HourFormat: false),
|
||||
child: child!),
|
||||
@@ -270,7 +270,7 @@ class VacationController extends BaseController {
|
||||
|
||||
final messagePlainText = messageTextController.text;
|
||||
final messageHtmlText = (BuildUtils.isWeb ? _vacationMessageHtmlText : await _getMessageHtmlText()) ?? '';
|
||||
if (messagePlainText.isEmpty && messageHtmlText.isEmpty) {
|
||||
if (messagePlainText.isEmpty && messageHtmlText.isEmpty && context.mounted) {
|
||||
_appToast.showToastWithIcon(
|
||||
context,
|
||||
bgColor: AppColor.toastErrorBackgroundColor,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
import 'package:core/core.dart';
|
||||
import 'package:enough_html_editor/enough_html_editor.dart' as html_editor_mobile;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -468,7 +467,7 @@ class VacationView extends GetWidget<VacationController> with RichTextButtonMixi
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return html_editor_mobile.HtmlEditor(
|
||||
return HtmlEditor(
|
||||
key: controller.htmlKey,
|
||||
minHeight: controller.htmlEditorMinHeight,
|
||||
addDefaultSelectionMenuItems: false,
|
||||
|
||||
@@ -18,27 +18,21 @@ class CacheFCMDatasourceImpl extends FCMDatasource {
|
||||
Future<bool> storeStateToRefresh(TypeName typeName, jmap.State newState) {
|
||||
return Future.sync(() async {
|
||||
return await _firebaseCacheManager.storeStateToRefresh(typeName, newState);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<jmap.State> getStateToRefresh(TypeName typeName) {
|
||||
return Future.sync(() async {
|
||||
return await _firebaseCacheManager.getStateToRefresh(typeName);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> deleteStateToRefresh(TypeName typeName) {
|
||||
return Future.sync(() async {
|
||||
return await _firebaseCacheManager.deleteStateToRefresh(typeName);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -64,9 +58,7 @@ class CacheFCMDatasourceImpl extends FCMDatasource {
|
||||
Future<FCMSubscriptionCache> geSubscription() {
|
||||
return Future.sync(() async {
|
||||
return await _firebaseCacheManager.getSubscription();
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -19,9 +19,7 @@ class FcmDatasourceImpl extends FCMDatasource {
|
||||
Future<FirebaseSubscription> getFirebaseSubscriptionByDeviceId(String deviceId) {
|
||||
return Future.sync(() async {
|
||||
return await _fcmApi.getFirebaseSubscriptionByDeviceId(deviceId);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -44,9 +42,7 @@ class FcmDatasourceImpl extends FCMDatasource {
|
||||
return Future.sync(() async {
|
||||
final firebaseSubscription = await _fcmApi.registerNewToken(newTokenRequest);
|
||||
return firebaseSubscription.fromDeviceId(newDeviceId: newTokenRequest.firebaseSubscription.deviceClientId);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -63,8 +59,6 @@ class FcmDatasourceImpl extends FCMDatasource {
|
||||
Future<bool> destroySubscription(String subscriptionId) {
|
||||
return Future.sync(() async {
|
||||
return await _fcmApi.destroySubscription(subscriptionId);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
}
|
||||
@@ -51,11 +51,11 @@ class FCMCacheManager {
|
||||
}
|
||||
|
||||
Future<FCMSubscriptionCache> getSubscription() async {
|
||||
final _fcmSubscription = await _fcmSubscriptionCacheClient.getItem(FCMSubscriptionCache.keyCacheValue);
|
||||
if (_fcmSubscription == null) {
|
||||
final fcmSubscription = await _fcmSubscriptionCacheClient.getItem(FCMSubscriptionCache.keyCacheValue);
|
||||
if (fcmSubscription == null) {
|
||||
throw NotFoundSubscriptionException();
|
||||
} else {
|
||||
return _fcmSubscription;
|
||||
return fcmSubscription;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import 'package:tmail_ui_user/features/caching/utils/caching_constants.dart';
|
||||
|
||||
part 'fcm_subscription.g.dart';
|
||||
|
||||
@HiveType(typeId: CachingConstants.FCM_SUBSCRIPTION_HIVE_CACHE_INDENTITY)
|
||||
@HiveType(typeId: CachingConstants.FCM_SUBSCRIPTION_HIVE_CACHE_IDENTITY)
|
||||
class FCMSubscriptionCache extends HiveObject with EquatableMixin {
|
||||
|
||||
static const String keyCacheValue = 'fcmSubscriptionCache';
|
||||
|
||||
@@ -88,8 +88,8 @@ class FCMRepositoryImpl extends FCMRepository {
|
||||
|
||||
@override
|
||||
Future<FCMSubscription> getSubscription() async {
|
||||
final _fcmSubScription = await _fcmDatasource[DataSourceType.local]!.geSubscription();
|
||||
return FCMSubscription(_fcmSubScription.deviceId, _fcmSubScription.subscriptionId);
|
||||
final fcmSubScription = await _fcmDatasource[DataSourceType.local]!.geSubscription();
|
||||
return FCMSubscription(fcmSubScription.deviceId, fcmSubScription.subscriptionId);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@ class GetFCMSubscriptionLocalInteractor {
|
||||
Stream<Either<Failure, Success>> execute() async* {
|
||||
try {
|
||||
yield Right<Failure, Success>(GetFCMSubscriptionLocalLoading());
|
||||
final _subscription = await _fcmRepository.getSubscription();
|
||||
yield Right<Failure, Success>(GetFCMSubscriptionLocalSuccess(_subscription));
|
||||
final subscription = await _fcmRepository.getSubscription();
|
||||
yield Right<Failure, Success>(GetFCMSubscriptionLocalSuccess(subscription));
|
||||
} catch (e) {
|
||||
yield Left<Failure, Success>(GetFCMSubscriptionLocalFailure(e));
|
||||
}
|
||||
|
||||
@@ -14,8 +14,6 @@ class QuotasDataSourceImpl extends QuotasDataSource{
|
||||
Future<QuotasResponse> getQuotas(AccountId accountId) {
|
||||
return Future.sync(() async {
|
||||
return await _quotasAPI.getQuotas(accountId);
|
||||
}).catchError((error) {
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
}
|
||||
@@ -252,7 +252,7 @@ class RulesFilterCreatorController extends BaseMailboxController {
|
||||
AppRoutes.destinationPicker,
|
||||
arguments: arguments);
|
||||
|
||||
if (destinationMailbox is PresentationMailbox) {
|
||||
if (destinationMailbox is PresentationMailbox && context.mounted) {
|
||||
mailboxSelected.value = destinationMailbox;
|
||||
errorRuleActionValue.value = _getErrorStringByInputValue(
|
||||
context,
|
||||
|
||||
+2
-2
@@ -27,7 +27,7 @@ class RuleFilterButtonField<T> extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
final imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
return InkWell(
|
||||
onTap: () => tapActionCallback?.call(value),
|
||||
@@ -51,7 +51,7 @@ class RuleFilterButtonField<T> extends StatelessWidget {
|
||||
softWrap: CommonTextStyle.defaultSoftWrap,
|
||||
overflow: CommonTextStyle.defaultTextOverFlow,
|
||||
)),
|
||||
SvgPicture.asset(_imagePaths.icDropDown)
|
||||
SvgPicture.asset(imagePaths.icDropDown)
|
||||
]),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -190,26 +190,24 @@ class SearchEmailController extends BaseController
|
||||
|
||||
void _initWorkerListener() {
|
||||
dashBoardViewStateWorker = ever(mailboxDashBoardController.viewState, (viewState) {
|
||||
if (viewState is Either) {
|
||||
viewState.map((success) {
|
||||
if (success is MarkAsEmailReadSuccess ||
|
||||
success is MoveToMailboxSuccess ||
|
||||
success is MarkAsStarEmailSuccess ||
|
||||
success is DeleteEmailPermanentlySuccess ||
|
||||
success is MarkAsMultipleEmailReadAllSuccess ||
|
||||
success is MarkAsMultipleEmailReadHasSomeEmailFailure ||
|
||||
success is MarkAsStarMultipleEmailAllSuccess ||
|
||||
success is MarkAsStarMultipleEmailHasSomeEmailFailure ||
|
||||
success is MoveMultipleEmailToMailboxAllSuccess ||
|
||||
success is MoveMultipleEmailToMailboxHasSomeEmailFailure ||
|
||||
success is EmptyTrashFolderSuccess ||
|
||||
success is DeleteMultipleEmailsPermanentlyAllSuccess ||
|
||||
success is DeleteMultipleEmailsPermanentlyHasSomeEmailFailure
|
||||
) {
|
||||
_refreshEmailChanges();
|
||||
}
|
||||
});
|
||||
}
|
||||
viewState.map((success) {
|
||||
if (success is MarkAsEmailReadSuccess ||
|
||||
success is MoveToMailboxSuccess ||
|
||||
success is MarkAsStarEmailSuccess ||
|
||||
success is DeleteEmailPermanentlySuccess ||
|
||||
success is MarkAsMultipleEmailReadAllSuccess ||
|
||||
success is MarkAsMultipleEmailReadHasSomeEmailFailure ||
|
||||
success is MarkAsStarMultipleEmailAllSuccess ||
|
||||
success is MarkAsStarMultipleEmailHasSomeEmailFailure ||
|
||||
success is MoveMultipleEmailToMailboxAllSuccess ||
|
||||
success is MoveMultipleEmailToMailboxHasSomeEmailFailure ||
|
||||
success is EmptyTrashFolderSuccess ||
|
||||
success is DeleteMultipleEmailsPermanentlyAllSuccess ||
|
||||
success is DeleteMultipleEmailsPermanentlyHasSomeEmailFailure
|
||||
) {
|
||||
_refreshEmailChanges();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -500,7 +498,10 @@ class SearchEmailController extends BaseController
|
||||
mailboxOption: Some(mailboxSelected),
|
||||
beforeOption: const None()
|
||||
);
|
||||
_searchEmailAction(context);
|
||||
|
||||
if (context.mounted) {
|
||||
_searchEmailAction(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -530,7 +531,7 @@ class SearchEmailController extends BaseController
|
||||
AppRoutes.contact,
|
||||
arguments: arguments);
|
||||
|
||||
if (newContact is EmailAddress) {
|
||||
if (newContact is EmailAddress && context.mounted) {
|
||||
_dispatchApplyContactAction(
|
||||
context,
|
||||
listContactSelected,
|
||||
|
||||
@@ -111,7 +111,7 @@ class SearchEmailView extends GetWidget<SearchEmailController>
|
||||
icon: SvgPicture.asset(_imagePaths.icBack,
|
||||
width: 18,
|
||||
height: 18,
|
||||
color: AppColor.colorTextButton,
|
||||
colorFilter: AppColor.colorTextButton.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
tooltip: AppLocalizations.of(context).back,
|
||||
onTap: () => controller.closeSearchView(context)
|
||||
@@ -241,9 +241,9 @@ class SearchEmailView extends GetWidget<SearchEmailController>
|
||||
const SizedBox(width: 4),
|
||||
SvgPicture.asset(
|
||||
_imagePaths.icChevronDownOutline,
|
||||
color: filterSelected
|
||||
? AppColor.primaryColor
|
||||
: AppColor.colorDefaultRichTextButton,
|
||||
colorFilter: filterSelected
|
||||
? AppColor.primaryColor.asFilter()
|
||||
: AppColor.colorDefaultRichTextButton.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
]
|
||||
])
|
||||
@@ -469,8 +469,11 @@ class SearchEmailView extends GetWidget<SearchEmailController>
|
||||
return (EmailActionCupertinoActionSheetActionBuilder(
|
||||
const Key('mark_as_spam_or_un_spam_action'),
|
||||
SvgPicture.asset(
|
||||
mailboxContain?.isSpam == true ? _imagePaths.icNotSpam : _imagePaths.icSpam,
|
||||
width: 28, height: 28, fit: BoxFit.fill, color: AppColor.colorTextButton),
|
||||
mailboxContain?.isSpam == true ? _imagePaths.icNotSpam : _imagePaths.icSpam,
|
||||
width: 28,
|
||||
height: 28,
|
||||
fit: BoxFit.fill,
|
||||
colorFilter: AppColor.colorTextButton.asFilter()),
|
||||
mailboxContain?.isSpam == true
|
||||
? AppLocalizations.of(context).remove_from_spam
|
||||
: AppLocalizations.of(context).mark_as_spam,
|
||||
@@ -553,9 +556,9 @@ class SearchEmailView extends GetWidget<SearchEmailController>
|
||||
const SizedBox(width: 4),
|
||||
SvgPicture.asset(
|
||||
_imagePaths.icChevronDownOutline,
|
||||
color: filterSelected
|
||||
? AppColor.primaryColor
|
||||
: AppColor.colorDefaultRichTextButton,
|
||||
colorFilter: filterSelected
|
||||
? AppColor.primaryColor.asFilter()
|
||||
: AppColor.colorDefaultRichTextButton.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
])
|
||||
),
|
||||
@@ -607,9 +610,9 @@ class SearchEmailView extends GetWidget<SearchEmailController>
|
||||
const SizedBox(width: 4),
|
||||
SvgPicture.asset(
|
||||
_imagePaths.icChevronDownOutline,
|
||||
color: filterSelected
|
||||
? AppColor.primaryColor
|
||||
: AppColor.colorDefaultRichTextButton,
|
||||
colorFilter: filterSelected
|
||||
? AppColor.primaryColor.asFilter()
|
||||
: AppColor.colorDefaultRichTextButton.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
])
|
||||
),
|
||||
|
||||
@@ -38,9 +38,10 @@ class AppBarSelectionMode extends StatelessWidget {
|
||||
|
||||
return Row(children: [
|
||||
buildIconWeb(
|
||||
icon: SvgPicture.asset(_imagePaths.icCloseComposer,
|
||||
color: AppColor.colorTextButton,
|
||||
fit: BoxFit.fill),
|
||||
icon: SvgPicture.asset(
|
||||
_imagePaths.icCloseComposer,
|
||||
colorFilter: AppColor.colorTextButton.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
minSize: 25,
|
||||
iconSize: 25,
|
||||
iconPadding: const EdgeInsets.all(5),
|
||||
@@ -128,11 +129,11 @@ class AppBarSelectionMode extends StatelessWidget {
|
||||
splashRadius: 15,
|
||||
icon: SvgPicture.asset(
|
||||
canDeletePermanently
|
||||
? _imagePaths.icDeleteComposer
|
||||
: _imagePaths.icDelete,
|
||||
color: canDeletePermanently
|
||||
? AppColor.colorDeletePermanentlyButton
|
||||
: AppColor.primaryColor,
|
||||
? _imagePaths.icDeleteComposer
|
||||
: _imagePaths.icDelete,
|
||||
colorFilter: canDeletePermanently
|
||||
? AppColor.colorDeletePermanentlyButton.asFilter()
|
||||
: AppColor.primaryColor.asFilter(),
|
||||
width: 20,
|
||||
height: 20,
|
||||
fit: BoxFit.fill),
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user