TF-2311 Sync use variables in BaseController to avoid wasting memory
Signed-off-by: dab246 <tdvu@linagora.com> Signed-off-by: dab246 <tdvu@linagora.com> (cherry picked from commit 21ac80615f7bc9e832fd72cb8ae6875c967d3cea)
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/state/success.dart';
|
||||
import 'package:core/presentation/utils/app_toast.dart';
|
||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||
import 'package:core/presentation/views/bottom_popup/confirmation_dialog_action_sheet_builder.dart';
|
||||
import 'package:core/presentation/views/dialog/confirmation_dialog_builder.dart';
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
@@ -42,9 +39,6 @@ class EmailRulesController extends BaseController {
|
||||
EditEmailRuleFilterInteractor? _editEmailRuleFilterInteractor;
|
||||
|
||||
final _accountDashBoardController = Get.find<ManageAccountDashBoardController>();
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
final _appToast = Get.find<AppToast>();
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
|
||||
final listEmailRule = <TMailRule>[].obs;
|
||||
|
||||
@@ -111,7 +105,7 @@ class EmailRulesController extends BaseController {
|
||||
void _createNewRuleFilterSuccess(CreateNewRuleFilterSuccess success) {
|
||||
if (success.newListRules.isNotEmpty == true) {
|
||||
if (currentOverlayContext != null && currentContext != null) {
|
||||
_appToast.showToastSuccessMessage(
|
||||
appToast.showToastSuccessMessage(
|
||||
currentOverlayContext!,
|
||||
AppLocalizations.of(currentContext!).newFilterWasCreated);
|
||||
}
|
||||
@@ -152,7 +146,7 @@ class EmailRulesController extends BaseController {
|
||||
void _editEmailRuleFilterSuccess(EditEmailRuleFilterSuccess success) {
|
||||
if (success.listRulesUpdated.isNotEmpty == true) {
|
||||
if (currentOverlayContext != null && currentContext != null) {
|
||||
_appToast.showToastSuccessMessage(
|
||||
appToast.showToastSuccessMessage(
|
||||
currentOverlayContext!,
|
||||
AppLocalizations.of(currentContext!).yourFilterHasBeenUpdated);
|
||||
}
|
||||
@@ -162,7 +156,7 @@ class EmailRulesController extends BaseController {
|
||||
}
|
||||
|
||||
void deleteEmailRule(BuildContext context, TMailRule emailRule) {
|
||||
if (_responsiveUtils.isMobile(context)) {
|
||||
if (responsiveUtils.isMobile(context)) {
|
||||
(ConfirmationDialogActionSheetBuilder(context)
|
||||
..messageText(AppLocalizations.of(context).messageConfirmationDialogDeleteEmailRule(emailRule.name))
|
||||
..onCancelAction(AppLocalizations.of(context).cancel, () =>
|
||||
@@ -176,10 +170,10 @@ class EmailRulesController extends BaseController {
|
||||
context: context,
|
||||
barrierColor: AppColor.colorDefaultCupertinoActionSheet,
|
||||
builder: (BuildContext context) =>
|
||||
PointerInterceptor(child: (ConfirmDialogBuilder(_imagePaths)
|
||||
PointerInterceptor(child: (ConfirmDialogBuilder(imagePaths)
|
||||
..title(AppLocalizations.of(context).deleteEmailRule)
|
||||
..content(AppLocalizations.of(context).messageConfirmationDialogDeleteEmailRule(emailRule.name))
|
||||
..addIcon(SvgPicture.asset(_imagePaths.icRemoveDialog,
|
||||
..addIcon(SvgPicture.asset(imagePaths.icRemoveDialog,
|
||||
fit: BoxFit.fill))
|
||||
..marginIcon(EdgeInsets.zero)
|
||||
..colorConfirmButton(AppColor.colorConfirmActionDialog)
|
||||
@@ -236,7 +230,7 @@ class EmailRulesController extends BaseController {
|
||||
|
||||
void _handleDeleteEmailRuleSuccess(DeleteEmailRuleSuccess success) {
|
||||
if (currentOverlayContext != null && currentContext != null) {
|
||||
_appToast.showToastSuccessMessage(
|
||||
appToast.showToastSuccessMessage(
|
||||
currentOverlayContext!,
|
||||
AppLocalizations.of(currentContext!).toastMessageDeleteEmailRuleSuccessfully);
|
||||
}
|
||||
@@ -267,7 +261,7 @@ class EmailRulesController extends BaseController {
|
||||
return (EmailRuleBottomSheetActionTileBuilder(
|
||||
const Key('delete_emailRule_action'),
|
||||
SvgPicture.asset(
|
||||
_imagePaths.icDeleteComposer,
|
||||
imagePaths.icDeleteComposer,
|
||||
colorFilter: AppColor.colorActionDeleteConfirmDialog.asFilter()),
|
||||
AppLocalizations.of(context).deleteRule,
|
||||
rule,
|
||||
@@ -284,7 +278,7 @@ class EmailRulesController extends BaseController {
|
||||
Widget _editEmailRuleActionTile(BuildContext context, TMailRule rule) {
|
||||
return (EmailRuleBottomSheetActionTileBuilder(
|
||||
const Key('edit_emailRule_action'),
|
||||
SvgPicture.asset(_imagePaths.icEdit),
|
||||
SvgPicture.asset(imagePaths.icEdit),
|
||||
AppLocalizations.of(context).editRule,
|
||||
rule,
|
||||
iconLeftPadding: const EdgeInsets.only(left: 12, right: 16),
|
||||
|
||||
@@ -8,31 +8,29 @@ import 'package:tmail_ui_user/features/manage_account/presentation/email_rules/w
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/menu/settings_utils.dart';
|
||||
|
||||
class EmailRulesView extends GetWidget<EmailRulesController> with AppLoaderMixin {
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
EmailRulesView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: _responsiveUtils.isWebDesktop(context)
|
||||
backgroundColor: controller.responsiveUtils.isWebDesktop(context)
|
||||
? AppColor.colorBgDesktop
|
||||
: Colors.white,
|
||||
body: Container(
|
||||
width: double.infinity,
|
||||
margin: SettingsUtils.getMarginViewForSettingDetails(context, _responsiveUtils),
|
||||
margin: SettingsUtils.getMarginViewForSettingDetails(context, controller.responsiveUtils),
|
||||
child: SingleChildScrollView(
|
||||
physics: const ClampingScrollPhysics(),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
EmailRulesHeaderWidget(
|
||||
imagePaths: _imagePaths,
|
||||
responsiveUtils: _responsiveUtils,
|
||||
imagePaths: controller.imagePaths,
|
||||
responsiveUtils: controller.responsiveUtils,
|
||||
createRule: () => controller.goToCreateNewRule(context),
|
||||
),
|
||||
SizedBox(height: _responsiveUtils.isWebDesktop(context) ? 24 : 16),
|
||||
SizedBox(height: controller.responsiveUtils.isWebDesktop(context) ? 24 : 16),
|
||||
_buildLoadingView(),
|
||||
const ListEmailRulesWidget()
|
||||
],
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/state/failure.dart';
|
||||
import 'package:core/presentation/state/success.dart';
|
||||
import 'package:core/presentation/utils/app_toast.dart';
|
||||
import 'package:core/presentation/utils/keyboard_utils.dart';
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -41,8 +39,6 @@ class ForwardController extends BaseController {
|
||||
EditLocalCopyInForwardingInteractor? _editLocalCopyInForwardingInteractor;
|
||||
|
||||
final accountDashBoardController = Get.find<ManageAccountDashBoardController>();
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
final _appToast = Get.find<AppToast>();
|
||||
|
||||
final selectionMode = Rx<SelectMode>(SelectMode.INACTIVE);
|
||||
final listRecipientForward = RxList<RecipientForward>();
|
||||
@@ -120,7 +116,7 @@ class ForwardController extends BaseController {
|
||||
AppLocalizations.of(context).remove,
|
||||
onConfirmAction: () => _handleDeleteRecipientAction({emailAddress}),
|
||||
showAsBottomSheet: true,
|
||||
icon: SvgPicture.asset(_imagePaths.icDeleteDialogRecipients, fit: BoxFit.fill),
|
||||
icon: SvgPicture.asset(imagePaths.icDeleteDialogRecipients, fit: BoxFit.fill),
|
||||
titleStyle: const TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w600,
|
||||
@@ -153,7 +149,7 @@ class ForwardController extends BaseController {
|
||||
|
||||
void _handleDeleteRecipientSuccess(DeleteRecipientInForwardingSuccess success) {
|
||||
if (currentOverlayContext != null && currentContext != null) {
|
||||
_appToast.showToastSuccessMessage(
|
||||
appToast.showToastSuccessMessage(
|
||||
currentOverlayContext!,
|
||||
AppLocalizations.of(currentContext!).toastMessageDeleteRecipientSuccessfully);
|
||||
}
|
||||
@@ -205,7 +201,7 @@ class ForwardController extends BaseController {
|
||||
AppLocalizations.of(currentContext!).remove,
|
||||
onConfirmAction: () => _handleDeleteRecipientAction(listEmailAddress),
|
||||
showAsBottomSheet: true,
|
||||
icon: SvgPicture.asset(_imagePaths.icDeleteDialogRecipients, fit: BoxFit.fill),
|
||||
icon: SvgPicture.asset(imagePaths.icDeleteDialogRecipients, fit: BoxFit.fill),
|
||||
titleStyle: const TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w600,
|
||||
@@ -255,7 +251,7 @@ class ForwardController extends BaseController {
|
||||
|
||||
void _handleAddRecipientsSuccess(AddRecipientsInForwardingSuccess success) {
|
||||
if (currentOverlayContext != null && currentContext != null) {
|
||||
_appToast.showToastSuccessMessage(
|
||||
appToast.showToastSuccessMessage(
|
||||
currentOverlayContext!,
|
||||
AppLocalizations.of(currentContext!).toastMessageAddRecipientsSuccessfully);
|
||||
}
|
||||
@@ -281,7 +277,7 @@ class ForwardController extends BaseController {
|
||||
|
||||
void _handleEditLocalCopySuccess(EditLocalCopyInForwardingSuccess success) {
|
||||
if (currentOverlayContext != null && currentContext != null) {
|
||||
_appToast.showToastSuccessMessage(
|
||||
appToast.showToastSuccessMessage(
|
||||
currentOverlayContext!,
|
||||
success.forward.localCopy
|
||||
? AppLocalizations.of(currentContext!).toastMessageLocalCopyEnable
|
||||
@@ -306,11 +302,11 @@ class ForwardController extends BaseController {
|
||||
|
||||
void handleExceptionCallback(BuildContext context, bool isListEmailEmpty) {
|
||||
if (isListEmailEmpty) {
|
||||
_appToast.showToastErrorMessage(
|
||||
appToast.showToastErrorMessage(
|
||||
context,
|
||||
AppLocalizations.of(context).emptyListEmailForward);
|
||||
} else {
|
||||
_appToast.showToastErrorMessage(
|
||||
appToast.showToastErrorMessage(
|
||||
context,
|
||||
AppLocalizations.of(context).incorrectEmailFormat);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/state/success.dart';
|
||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||
import 'package:core/presentation/utils/style_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
@@ -15,33 +13,31 @@ import 'package:tmail_ui_user/features/manage_account/presentation/menu/settings
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
class ForwardView extends GetWidget<ForwardController> with AppLoaderMixin {
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
ForwardView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: SettingsUtils.getBackgroundColor(context, _responsiveUtils),
|
||||
backgroundColor: SettingsUtils.getBackgroundColor(context, controller.responsiveUtils),
|
||||
body: Container(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
color: SettingsUtils.getContentBackgroundColor(context, _responsiveUtils),
|
||||
decoration: SettingsUtils.getBoxDecorationForContent(context, _responsiveUtils),
|
||||
margin: SettingsUtils.getMarginViewForForwardSettingDetails(context, _responsiveUtils),
|
||||
color: SettingsUtils.getContentBackgroundColor(context, controller.responsiveUtils),
|
||||
decoration: SettingsUtils.getBoxDecorationForContent(context, controller.responsiveUtils),
|
||||
margin: SettingsUtils.getMarginViewForForwardSettingDetails(context, controller.responsiveUtils),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (_responsiveUtils.isWebDesktop(context))
|
||||
if (controller.responsiveUtils.isWebDesktop(context))
|
||||
...[
|
||||
ForwardHeaderWidget(imagePaths: _imagePaths, responsiveUtils: _responsiveUtils),
|
||||
ForwardHeaderWidget(imagePaths: controller.imagePaths, responsiveUtils: controller.responsiveUtils),
|
||||
const Divider(height: 1, color: AppColor.colorDividerHeaderSetting)
|
||||
],
|
||||
Expanded(child: SingleChildScrollView(
|
||||
physics: const ClampingScrollPhysics(),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
if (!_responsiveUtils.isWebDesktop(context))
|
||||
if (!controller.responsiveUtils.isWebDesktop(context))
|
||||
_buildTitleHeader(context),
|
||||
_buildKeepLocalSwitchButton(context),
|
||||
Obx(() => controller.currentForward.value != null
|
||||
@@ -51,7 +47,7 @@ class ForwardView extends GetWidget<ForwardController> with AppLoaderMixin {
|
||||
_buildLoadingView(),
|
||||
Obx(() {
|
||||
if (controller.listRecipientForward.isNotEmpty) {
|
||||
return ListEmailForwardsWidget();
|
||||
return const ListEmailForwardsWidget();
|
||||
} else {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
@@ -68,7 +64,7 @@ class ForwardView extends GetWidget<ForwardController> with AppLoaderMixin {
|
||||
return Container(
|
||||
color: Colors.transparent,
|
||||
width: double.infinity,
|
||||
padding: SettingsUtils.getPaddingTitleHeaderForwarding(context, _responsiveUtils),
|
||||
padding: SettingsUtils.getPaddingTitleHeaderForwarding(context, controller.responsiveUtils),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).forwardingSettingExplanation,
|
||||
style: const TextStyle(
|
||||
@@ -85,7 +81,7 @@ class ForwardView extends GetWidget<ForwardController> with AppLoaderMixin {
|
||||
return controller.listRecipientForward.isNotEmpty
|
||||
? Container(
|
||||
color: Colors.transparent,
|
||||
padding: SettingsUtils.getPaddingKeepLocalSwitchButtonForwarding(context, _responsiveUtils),
|
||||
padding: SettingsUtils.getPaddingKeepLocalSwitchButtonForwarding(context, controller.responsiveUtils),
|
||||
child: Row(children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 16),
|
||||
@@ -93,8 +89,8 @@ class ForwardView extends GetWidget<ForwardController> with AppLoaderMixin {
|
||||
onTap: controller.handleEditLocalCopy,
|
||||
child: SvgPicture.asset(
|
||||
controller.currentForwardLocalCopyState
|
||||
? _imagePaths.icSwitchOn
|
||||
: _imagePaths.icSwitchOff,
|
||||
? controller.imagePaths.icSwitchOn
|
||||
: controller.imagePaths.icSwitchOff,
|
||||
fit: BoxFit.fill,
|
||||
width: 36,
|
||||
height: 24))),
|
||||
|
||||
+3
-8
@@ -1,6 +1,4 @@
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||
import 'package:core/presentation/views/button/icon_button_web.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
@@ -15,16 +13,13 @@ import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
class ListEmailForwardsWidget extends GetWidget<ForwardController> {
|
||||
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
|
||||
ListEmailForwardsWidget({Key? key}) : super(key: key);
|
||||
const ListEmailForwardsWidget({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
color: Colors.transparent,
|
||||
padding: SettingsUtils.getPaddingListRecipientForwarding(context, _responsiveUtils),
|
||||
padding: SettingsUtils.getPaddingListRecipientForwarding(context, controller.responsiveUtils),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
@@ -106,7 +101,7 @@ class ListEmailForwardsWidget extends GetWidget<ForwardController> {
|
||||
children: [
|
||||
buildIconWeb(
|
||||
icon: SvgPicture.asset(
|
||||
_imagePaths.icClose,
|
||||
controller.imagePaths.icClose,
|
||||
colorFilter: AppColor.colorTextButton.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
tooltip: AppLocalizations.of(context).cancel,
|
||||
|
||||
+9
-12
@@ -1,6 +1,5 @@
|
||||
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_portal/flutter_portal.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -12,24 +11,22 @@ import 'package:tmail_ui_user/main/utils/app_utils.dart';
|
||||
|
||||
class LanguageAndRegionView extends GetWidget<LanguageAndRegionController> {
|
||||
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
|
||||
LanguageAndRegionView({Key? key}) : super(key: key);
|
||||
const LanguageAndRegionView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Portal(
|
||||
child: Scaffold(
|
||||
backgroundColor: _responsiveUtils.isWebDesktop(context)
|
||||
backgroundColor: controller.responsiveUtils.isWebDesktop(context)
|
||||
? AppColor.colorBgDesktop
|
||||
: Colors.white,
|
||||
body: Container(
|
||||
width: double.infinity,
|
||||
margin: _responsiveUtils.isWebDesktop(context)
|
||||
margin: controller.responsiveUtils.isWebDesktop(context)
|
||||
? const EdgeInsets.all(24)
|
||||
: EdgeInsets.symmetric(horizontal: SettingsUtils.getHorizontalPadding(context, _responsiveUtils)),
|
||||
color: _responsiveUtils.isWebDesktop(context) ? null : Colors.white,
|
||||
decoration: _responsiveUtils.isWebDesktop(context)
|
||||
: EdgeInsets.symmetric(horizontal: SettingsUtils.getHorizontalPadding(context, controller.responsiveUtils)),
|
||||
color: controller.responsiveUtils.isWebDesktop(context) ? null : Colors.white,
|
||||
decoration: controller.responsiveUtils.isWebDesktop(context)
|
||||
? BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
border: Border.all(color: AppColor.colorBorderBodyThread, width: 1),
|
||||
@@ -37,15 +34,15 @@ class LanguageAndRegionView extends GetWidget<LanguageAndRegionController> {
|
||||
: null,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(
|
||||
_responsiveUtils.isWebDesktop(context) ? 20 : 0),
|
||||
controller.responsiveUtils.isWebDesktop(context) ? 20 : 0),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
right: AppUtils.isDirectionRTL(context)
|
||||
? _responsiveUtils.isWebDesktop(context) ? 24 : 0
|
||||
? controller.responsiveUtils.isWebDesktop(context) ? 24 : 0
|
||||
: 0,
|
||||
left: AppUtils.isDirectionRTL(context)
|
||||
? 0
|
||||
: _responsiveUtils.isWebDesktop(context) ? 24 : 0,
|
||||
: controller.responsiveUtils.isWebDesktop(context) ? 24 : 0,
|
||||
top: 24
|
||||
),
|
||||
child: Column(
|
||||
|
||||
+3
-7
@@ -1,7 +1,5 @@
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/state/success.dart';
|
||||
import 'package:core/presentation/utils/app_toast.dart';
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -40,8 +38,6 @@ class MailboxVisibilityController extends BaseMailboxController {
|
||||
SubscribeMailboxInteractor? _subscribeMailboxInteractor;
|
||||
SubscribeMultipleMailboxInteractor? _subscribeMultipleMailboxInteractor;
|
||||
final _accountDashBoardController = Get.find<ManageAccountDashBoardController>();
|
||||
final _appToast = Get.find<AppToast>();
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
final mailboxListScrollController = ScrollController();
|
||||
|
||||
MailboxVisibilityController(
|
||||
@@ -221,7 +217,7 @@ class MailboxVisibilityController extends BaseMailboxController {
|
||||
{List<MailboxId>? listDescendantMailboxIds}
|
||||
) {
|
||||
if (currentOverlayContext != null && currentContext != null) {
|
||||
_appToast.showToastMessage(
|
||||
appToast.showToastMessage(
|
||||
currentOverlayContext!,
|
||||
AppLocalizations.of(currentContext!).toastMsgHideFolderSuccess,
|
||||
actionName: AppLocalizations.of(currentContext!).undo,
|
||||
@@ -233,10 +229,10 @@ class MailboxVisibilityController extends BaseMailboxController {
|
||||
)
|
||||
),
|
||||
leadingSVGIconColor: Colors.white,
|
||||
leadingSVGIcon: _imagePaths.icFolderMailbox,
|
||||
leadingSVGIcon: imagePaths.icFolderMailbox,
|
||||
backgroundColor: AppColor.toastSuccessBackgroundColor,
|
||||
textColor: Colors.white,
|
||||
actionIcon: SvgPicture.asset(_imagePaths.icUndo),
|
||||
actionIcon: SvgPicture.asset(imagePaths.icUndo),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+7
-12
@@ -1,7 +1,5 @@
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/state/success.dart';
|
||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||
import 'package:core/presentation/views/list/tree_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -21,19 +19,16 @@ class MailboxVisibilityView extends GetWidget<MailboxVisibilityController>
|
||||
with AppLoaderMixin,
|
||||
MailboxWidgetMixin {
|
||||
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
MailboxVisibilityView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SettingDetailViewBuilder(
|
||||
responsiveUtils: _responsiveUtils,
|
||||
responsiveUtils: controller.responsiveUtils,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (_responsiveUtils.isWebDesktop(context))
|
||||
if (controller.responsiveUtils.isWebDesktop(context))
|
||||
...[
|
||||
const SizedBox(height: 24),
|
||||
const MailboxVisibilityHeaderWidget(),
|
||||
@@ -46,7 +41,7 @@ class MailboxVisibilityView extends GetWidget<MailboxVisibilityController>
|
||||
],
|
||||
_buildLoadingView(),
|
||||
Expanded(child: Padding(
|
||||
padding: MailboxVisibilityUtils.getPaddingListView(context, _responsiveUtils),
|
||||
padding: MailboxVisibilityUtils.getPaddingListView(context, controller.responsiveUtils),
|
||||
child: _buildListMailbox(context)
|
||||
))
|
||||
]
|
||||
@@ -100,8 +95,8 @@ class MailboxVisibilityView extends GetWidget<MailboxVisibilityController>
|
||||
return Column(children: [
|
||||
buildHeaderMailboxCategory(
|
||||
context,
|
||||
_responsiveUtils,
|
||||
_imagePaths,
|
||||
controller.responsiveUtils,
|
||||
controller.imagePaths,
|
||||
categories,
|
||||
controller,
|
||||
padding: const EdgeInsets.all(8),
|
||||
@@ -139,7 +134,7 @@ class MailboxVisibilityView extends GetWidget<MailboxVisibilityController>
|
||||
isExpanded: mailboxNode.expandMode == ExpandMode.EXPAND,
|
||||
paddingChild: const EdgeInsetsDirectional.only(start: 10),
|
||||
parent: MailBoxVisibilityFolderTileBuilder(
|
||||
_imagePaths,
|
||||
controller.imagePaths,
|
||||
mailboxNode,
|
||||
onClickExpandMailboxNodeAction: (mailboxNode) {
|
||||
controller.toggleMailboxFolder(mailboxNode, controller.mailboxListScrollController);
|
||||
@@ -148,7 +143,7 @@ class MailboxVisibilityView extends GetWidget<MailboxVisibilityController>
|
||||
),
|
||||
children: _buildListChildTileWidget(context, mailboxNode)).build()
|
||||
: MailBoxVisibilityFolderTileBuilder(
|
||||
_imagePaths,
|
||||
controller.imagePaths,
|
||||
mailboxNode,
|
||||
onClickExpandMailboxNodeAction: (mailboxNode) {
|
||||
controller.toggleMailboxFolder(mailboxNode, controller.mailboxListScrollController);
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/base/base_bindings.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/repository/account_repository.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/usecases/get_authenticated_account_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/usecases/update_authentication_account_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/data/datasource/manage_account_datasource.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/data/datasource_impl/manage_account_datasource_impl.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/data/local/language_cache_manager.dart';
|
||||
@@ -26,10 +23,7 @@ class ManageAccountDashBoardBindings extends BaseBindings {
|
||||
|
||||
@override
|
||||
void bindingsController() {
|
||||
Get.put(ManageAccountDashBoardController(
|
||||
Get.find<GetAuthenticatedAccountInteractor>(),
|
||||
Get.find<UpdateAuthenticationAccountInteractor>()
|
||||
));
|
||||
Get.put(ManageAccountDashBoardController());
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -45,9 +39,7 @@ class ManageAccountDashBoardBindings extends BaseBindings {
|
||||
}
|
||||
|
||||
@override
|
||||
void bindingsInteractor() {
|
||||
Get.lazyPut(() => UpdateAuthenticationAccountInteractor(Get.find<AccountRepository>()));
|
||||
}
|
||||
void bindingsInteractor() {}
|
||||
|
||||
@override
|
||||
void bindingsRepository() {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
import 'package:core/core.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:forward/forward/capability_forward.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -13,8 +12,6 @@ import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:rule_filter/rule_filter/capability_rule_filter.dart';
|
||||
import 'package:tmail_ui_user/features/base/action/ui_action.dart';
|
||||
import 'package:tmail_ui_user/features/base/reloadable/reloadable_controller.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/usecases/get_authenticated_account_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/usecases/update_authentication_account_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/domain/state/get_user_profile_state.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/domain/state/get_all_vacation_state.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/domain/state/update_vacation_state.dart';
|
||||
@@ -40,9 +37,6 @@ import 'package:tmail_ui_user/main/routes/route_utils.dart';
|
||||
|
||||
class ManageAccountDashBoardController extends ReloadableController {
|
||||
|
||||
final _appToast = Get.find<AppToast>();
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
|
||||
GetAllVacationInteractor? _getAllVacationInteractor;
|
||||
UpdateVacationInteractor? _updateVacationInteractor;
|
||||
|
||||
@@ -56,14 +50,6 @@ class ManageAccountDashBoardController extends ReloadableController {
|
||||
|
||||
Session? sessionCurrent;
|
||||
|
||||
ManageAccountDashBoardController(
|
||||
GetAuthenticatedAccountInteractor getAuthenticatedAccountInteractor,
|
||||
UpdateAuthenticationAccountInteractor updateAuthenticationAccountInteractor
|
||||
) : super(
|
||||
getAuthenticatedAccountInteractor,
|
||||
updateAuthenticationAccountInteractor
|
||||
);
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
_initialPageLevel();
|
||||
@@ -74,7 +60,6 @@ class ManageAccountDashBoardController extends ReloadableController {
|
||||
|
||||
@override
|
||||
void handleSuccessViewState(Success success) {
|
||||
super.handleSuccessViewState(success);
|
||||
if (success is GetUserProfileSuccess) {
|
||||
userProfile.value = success.userProfile;
|
||||
} else if (success is GetAllVacationSuccess) {
|
||||
@@ -83,13 +68,15 @@ class ManageAccountDashBoardController extends ReloadableController {
|
||||
}
|
||||
} else if (success is UpdateVacationSuccess) {
|
||||
_handleUpdateVacationSuccess(success);
|
||||
} else {
|
||||
super.handleSuccessViewState(success);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void handleReloaded(Session session) {
|
||||
sessionCurrent = session;
|
||||
accountId.value = session.accounts.keys.first;
|
||||
accountId.value = session.personalAccount.accountId;
|
||||
_getUserProfile();
|
||||
_bindingInteractorForMenuItemView(sessionCurrent, accountId.value);
|
||||
_getVacationResponse();
|
||||
@@ -100,22 +87,20 @@ class ManageAccountDashBoardController extends ReloadableController {
|
||||
log('ManageAccountDashBoardController::_getArguments(): $arguments');
|
||||
if (arguments is ManageAccountArguments) {
|
||||
sessionCurrent = arguments.session;
|
||||
accountId.value = arguments.session?.accounts.keys.first;
|
||||
accountId.value = arguments.session?.personalAccount.accountId;
|
||||
_getUserProfile();
|
||||
_bindingInteractorForMenuItemView(sessionCurrent, accountId.value);
|
||||
_getVacationResponse();
|
||||
if (arguments.menuSettingCurrent != null) {
|
||||
_goToSettingMenuCurrent(arguments.menuSettingCurrent!);
|
||||
}
|
||||
} else {
|
||||
if (kIsWeb) {
|
||||
reload();
|
||||
}
|
||||
} else if (PlatformInfo.isWeb) {
|
||||
reload();
|
||||
}
|
||||
}
|
||||
|
||||
void _initialPageLevel() {
|
||||
if (currentContext != null && _responsiveUtils.isWebDesktop(currentContext!)) {
|
||||
if (currentContext != null && responsiveUtils.isWebDesktop(currentContext!)) {
|
||||
settingsPageLevel.value = SettingsPageLevel.level1;
|
||||
} else {
|
||||
settingsPageLevel.value = SettingsPageLevel.universal;
|
||||
@@ -261,7 +246,7 @@ class ManageAccountDashBoardController extends ReloadableController {
|
||||
void _handleUpdateVacationSuccess(UpdateVacationSuccess success) {
|
||||
if (success.listVacationResponse.isNotEmpty) {
|
||||
if (currentContext != null && currentOverlayContext != null) {
|
||||
_appToast.showToastSuccessMessage(
|
||||
appToast.showToastSuccessMessage(
|
||||
currentOverlayContext!,
|
||||
AppLocalizations.of(currentContext!).yourVacationResponderIsDisabledSuccessfully);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||
import 'package:core/presentation/views/image/avatar_builder.dart';
|
||||
import 'package:core/presentation/views/responsive/responsive_widget.dart';
|
||||
@@ -28,9 +27,6 @@ import 'package:tmail_ui_user/main/routes/route_navigation.dart';
|
||||
class ManageAccountDashBoardView extends GetWidget<ManageAccountDashBoardController>
|
||||
with UserSettingPopupMenuMixin {
|
||||
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
ManageAccountDashBoardView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
@@ -43,7 +39,7 @@ class ManageAccountDashBoardView extends GetWidget<ManageAccountDashBoardControl
|
||||
body: GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
child: ResponsiveWidget(
|
||||
responsiveUtils: _responsiveUtils,
|
||||
responsiveUtils: controller.responsiveUtils,
|
||||
desktop: Column(children: [
|
||||
Row(children: [
|
||||
Container(width: 256, color: Colors.white,
|
||||
@@ -54,7 +50,7 @@ class ManageAccountDashBoardView extends GetWidget<ManageAccountDashBoardControl
|
||||
text: AppLocalizations.of(context).app_name,
|
||||
textAlign: TextAlign.center,
|
||||
textStyle: const TextStyle(color: Colors.black, fontSize: 20, fontWeight: FontWeight.bold),
|
||||
logoSVG: _imagePaths.icTMailLogo,
|
||||
logoSVG: controller.imagePaths.icTMailLogo,
|
||||
onTapCallback: () => controller.backToMailboxDashBoard(context),
|
||||
),
|
||||
Obx(() {
|
||||
@@ -78,7 +74,10 @@ class ManageAccountDashBoardView extends GetWidget<ManageAccountDashBoardControl
|
||||
Expanded(child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(width: ResponsiveUtils.defaultSizeMenu, child: ManageAccountMenuView()),
|
||||
const SizedBox(
|
||||
width: ResponsiveUtils.defaultSizeMenu,
|
||||
child: ManageAccountMenuView()
|
||||
),
|
||||
Expanded(child: Container(
|
||||
color: AppColor.colorBgDesktop,
|
||||
child: Column(children: [
|
||||
@@ -162,7 +161,7 @@ class ManageAccountDashBoardView extends GetWidget<ManageAccountDashBoardControl
|
||||
case AccountMenuItem.profiles:
|
||||
return ProfilesView();
|
||||
case AccountMenuItem.languageAndRegion:
|
||||
return LanguageAndRegionView();
|
||||
return const LanguageAndRegionView();
|
||||
case AccountMenuItem.emailRules:
|
||||
if(controller.isRuleFilterCapabilitySupported){
|
||||
return EmailRulesView();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
|
||||
import 'package:core/core.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/manage_account_dashboard_controller.dart';
|
||||
@@ -9,7 +10,8 @@ import 'package:tmail_ui_user/main/routes/route_navigation.dart';
|
||||
class ManageAccountMenuController extends GetxController {
|
||||
|
||||
final dashBoardController = Get.find<ManageAccountDashBoardController>();
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
final responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
final imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
final listAccountMenuItem = RxList<AccountMenuItem>([
|
||||
AccountMenuItem.profiles,
|
||||
@@ -46,7 +48,7 @@ class ManageAccountMenuController extends GetxController {
|
||||
listAccountMenuItem.value = newListMenuSetting;
|
||||
|
||||
if (listAccountMenuItem.isNotEmpty) {
|
||||
if (currentContext != null && _responsiveUtils.isWebDesktop(currentContext!)) {
|
||||
if (currentContext != null && responsiveUtils.isWebDesktop(currentContext!)) {
|
||||
selectAccountMenuItem(listAccountMenuItem.first);
|
||||
} else {
|
||||
selectAccountMenuItem(AccountMenuItem.none);
|
||||
|
||||
@@ -10,21 +10,18 @@ import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
class ManageAccountMenuView extends GetWidget<ManageAccountMenuController> {
|
||||
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
ManageAccountMenuView({Key? key}) : super(key: key);
|
||||
const ManageAccountMenuView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Drawer(
|
||||
elevation: _responsiveUtils.isDesktop(context) ? 0 : 16.0,
|
||||
elevation: controller.responsiveUtils.isDesktop(context) ? 0 : 16.0,
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
body: SafeArea(right: false, bottom: false,
|
||||
child: Column(
|
||||
children: [
|
||||
if (!_responsiveUtils.isWebDesktop(context))
|
||||
if (!controller.responsiveUtils.isWebDesktop(context))
|
||||
Container(
|
||||
color: Colors.white,
|
||||
padding: const EdgeInsets.only(top: 16, bottom: 16, left: 16),
|
||||
@@ -34,7 +31,7 @@ class ManageAccountMenuView extends GetWidget<ManageAccountMenuController> {
|
||||
text: AppLocalizations.of(context).app_name,
|
||||
textAlign: TextAlign.center,
|
||||
textStyle: const TextStyle(color: Colors.black, fontSize: 20, fontWeight: FontWeight.bold),
|
||||
logoSVG: _imagePaths.icTMailLogo
|
||||
logoSVG: controller.imagePaths.icTMailLogo
|
||||
),
|
||||
Obx(() {
|
||||
if (controller.dashBoardController.appInformation.value != null) {
|
||||
@@ -52,10 +49,10 @@ class ManageAccountMenuView extends GetWidget<ManageAccountMenuController> {
|
||||
}),
|
||||
])
|
||||
),
|
||||
if (!_responsiveUtils.isWebDesktop(context))
|
||||
if (!controller.responsiveUtils.isWebDesktop(context))
|
||||
const Divider(color: AppColor.colorDividerMailbox, height: 1),
|
||||
Expanded(child: Container(
|
||||
color: _responsiveUtils.isWebDesktop(context) ? AppColor.colorBgDesktop : Colors.white,
|
||||
color: controller.responsiveUtils.isWebDesktop(context) ? AppColor.colorBgDesktop : Colors.white,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -65,8 +62,8 @@ class ManageAccountMenuView extends GetWidget<ManageAccountMenuController> {
|
||||
key: const Key('back_to_dashboard_button'),
|
||||
text: AppLocalizations.of(context).back,
|
||||
icon: DirectionUtils.isDirectionRTLByLanguage(context)
|
||||
? _imagePaths.icArrowRight
|
||||
: _imagePaths.icBack,
|
||||
? controller.imagePaths.icArrowRight
|
||||
: controller.imagePaths.icBack,
|
||||
borderRadius: 10,
|
||||
backgroundColor: AppColor.colorBgMailboxSelected,
|
||||
iconColor: AppColor.colorTextButton,
|
||||
@@ -133,7 +130,7 @@ class ManageAccountMenuView extends GetWidget<ManageAccountMenuController> {
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
||||
child: Row(children: [
|
||||
SvgPicture.asset(_imagePaths.icSignOut, fit: BoxFit.fill),
|
||||
SvgPicture.asset(controller.imagePaths.icSignOut, fit: BoxFit.fill),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(child: Text(
|
||||
AppLocalizations.of(context).sign_out,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/manage_account_dashboard_controller.dart';
|
||||
@@ -6,6 +8,8 @@ import 'package:tmail_ui_user/features/manage_account/presentation/model/setting
|
||||
|
||||
class SettingsController extends GetxController {
|
||||
final manageAccountDashboardController = Get.find<ManageAccountDashBoardController>();
|
||||
final responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
final imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
void selectSettings(AccountMenuItem accountMenuItem) {
|
||||
log('SettingsController::selectSettings(): $accountMenuItem');
|
||||
|
||||
+23
-28
@@ -1,6 +1,4 @@
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox/presentation/widgets/user_information_widget.dart';
|
||||
@@ -11,10 +9,7 @@ import 'package:tmail_ui_user/features/manage_account/presentation/model/account
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
class SettingsFirstLevelView extends GetWidget<SettingsController> {
|
||||
SettingsFirstLevelView({Key? key}) : super(key: key);
|
||||
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
const SettingsFirstLevelView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -22,40 +17,40 @@ class SettingsFirstLevelView extends GetWidget<SettingsController> {
|
||||
child: Column(children: [
|
||||
Obx(() => UserInformationWidget(
|
||||
userProfile: controller.manageAccountDashboardController.userProfile.value,
|
||||
padding: SettingsUtils.getPaddingInFirstLevel(context, _responsiveUtils),
|
||||
padding: SettingsUtils.getPaddingInFirstLevel(context, controller.responsiveUtils),
|
||||
titlePadding: const EdgeInsetsDirectional.only(start: 16))),
|
||||
Divider(
|
||||
color: AppColor.colorDividerComposer,
|
||||
height: 1,
|
||||
indent: SettingsUtils.getHorizontalPadding(context, _responsiveUtils),
|
||||
endIndent: SettingsUtils.getHorizontalPadding(context, _responsiveUtils)
|
||||
indent: SettingsUtils.getHorizontalPadding(context, controller.responsiveUtils),
|
||||
endIndent: SettingsUtils.getHorizontalPadding(context, controller.responsiveUtils)
|
||||
),
|
||||
SettingFirstLevelTileBuilder(
|
||||
AppLocalizations.of(context).profiles,
|
||||
AccountMenuItem.profiles.getIcon(_imagePaths),
|
||||
AccountMenuItem.profiles.getIcon(controller.imagePaths),
|
||||
subtitle: AppLocalizations.of(context).profilesSettingExplanation,
|
||||
() => controller.selectSettings(AccountMenuItem.profiles)
|
||||
),
|
||||
Divider(
|
||||
color: AppColor.colorDividerComposer,
|
||||
height: 1,
|
||||
indent: SettingsUtils.getHorizontalPadding(context, _responsiveUtils),
|
||||
endIndent: SettingsUtils.getHorizontalPadding(context, _responsiveUtils)
|
||||
indent: SettingsUtils.getHorizontalPadding(context, controller.responsiveUtils),
|
||||
endIndent: SettingsUtils.getHorizontalPadding(context, controller.responsiveUtils)
|
||||
),
|
||||
Obx(() {
|
||||
if (controller.manageAccountDashboardController.isRuleFilterCapabilitySupported) {
|
||||
return Column(children: [
|
||||
SettingFirstLevelTileBuilder(
|
||||
AccountMenuItem.emailRules.getName(context),
|
||||
AccountMenuItem.emailRules.getIcon(_imagePaths),
|
||||
AccountMenuItem.emailRules.getIcon(controller.imagePaths),
|
||||
subtitle: AppLocalizations.of(context).emailRuleSettingExplanation,
|
||||
() => controller.selectSettings(AccountMenuItem.emailRules)
|
||||
),
|
||||
Divider(
|
||||
color: AppColor.colorDividerComposer,
|
||||
height: 1,
|
||||
indent: SettingsUtils.getHorizontalPadding(context, _responsiveUtils),
|
||||
endIndent: SettingsUtils.getHorizontalPadding(context, _responsiveUtils)
|
||||
indent: SettingsUtils.getHorizontalPadding(context, controller.responsiveUtils),
|
||||
endIndent: SettingsUtils.getHorizontalPadding(context, controller.responsiveUtils)
|
||||
),
|
||||
]);
|
||||
} else {
|
||||
@@ -67,15 +62,15 @@ class SettingsFirstLevelView extends GetWidget<SettingsController> {
|
||||
return Column(children: [
|
||||
SettingFirstLevelTileBuilder(
|
||||
AccountMenuItem.forward.getName(context),
|
||||
AccountMenuItem.forward.getIcon(_imagePaths),
|
||||
AccountMenuItem.forward.getIcon(controller.imagePaths),
|
||||
subtitle: AppLocalizations.of(context).forwardingSettingExplanation,
|
||||
() => controller.selectSettings(AccountMenuItem.forward)
|
||||
),
|
||||
Divider(
|
||||
color: AppColor.colorDividerComposer,
|
||||
height: 1,
|
||||
indent: SettingsUtils.getHorizontalPadding(context, _responsiveUtils),
|
||||
endIndent: SettingsUtils.getHorizontalPadding(context, _responsiveUtils)
|
||||
indent: SettingsUtils.getHorizontalPadding(context, controller.responsiveUtils),
|
||||
endIndent: SettingsUtils.getHorizontalPadding(context, controller.responsiveUtils)
|
||||
),
|
||||
]);
|
||||
} else {
|
||||
@@ -87,15 +82,15 @@ class SettingsFirstLevelView extends GetWidget<SettingsController> {
|
||||
return Column(children: [
|
||||
SettingFirstLevelTileBuilder(
|
||||
AccountMenuItem.vacation.getName(context),
|
||||
AccountMenuItem.vacation.getIcon(_imagePaths),
|
||||
AccountMenuItem.vacation.getIcon(controller.imagePaths),
|
||||
subtitle: AppLocalizations.of(context).vacationSettingExplanation,
|
||||
() => controller.selectSettings(AccountMenuItem.vacation)
|
||||
),
|
||||
Divider(
|
||||
color: AppColor.colorDividerComposer,
|
||||
height: 1,
|
||||
indent: SettingsUtils.getHorizontalPadding(context, _responsiveUtils),
|
||||
endIndent: SettingsUtils.getHorizontalPadding(context, _responsiveUtils)
|
||||
indent: SettingsUtils.getHorizontalPadding(context, controller.responsiveUtils),
|
||||
endIndent: SettingsUtils.getHorizontalPadding(context, controller.responsiveUtils)
|
||||
),
|
||||
]);
|
||||
} else {
|
||||
@@ -105,31 +100,31 @@ class SettingsFirstLevelView extends GetWidget<SettingsController> {
|
||||
Column(children: [
|
||||
SettingFirstLevelTileBuilder(
|
||||
AccountMenuItem.mailboxVisibility.getName(context),
|
||||
AccountMenuItem.mailboxVisibility.getIcon(_imagePaths),
|
||||
AccountMenuItem.mailboxVisibility.getIcon(controller.imagePaths),
|
||||
subtitle: AppLocalizations.of(context).folderVisibilitySubtitle,
|
||||
() => controller.selectSettings(AccountMenuItem.mailboxVisibility)
|
||||
),
|
||||
Divider(
|
||||
color: AppColor.colorDividerComposer,
|
||||
height: 1,
|
||||
indent: SettingsUtils.getHorizontalPadding(context, _responsiveUtils),
|
||||
endIndent: SettingsUtils.getHorizontalPadding(context, _responsiveUtils)
|
||||
indent: SettingsUtils.getHorizontalPadding(context, controller.responsiveUtils),
|
||||
endIndent: SettingsUtils.getHorizontalPadding(context, controller.responsiveUtils)
|
||||
),
|
||||
]),
|
||||
SettingFirstLevelTileBuilder(
|
||||
AccountMenuItem.languageAndRegion.getName(context),
|
||||
AccountMenuItem.languageAndRegion.getIcon(_imagePaths),
|
||||
AccountMenuItem.languageAndRegion.getIcon(controller.imagePaths),
|
||||
() => controller.selectSettings(AccountMenuItem.languageAndRegion)
|
||||
),
|
||||
Divider(
|
||||
color: AppColor.colorDividerComposer,
|
||||
height: 1,
|
||||
indent: SettingsUtils.getHorizontalPadding(context, _responsiveUtils),
|
||||
endIndent: SettingsUtils.getHorizontalPadding(context, _responsiveUtils)
|
||||
indent: SettingsUtils.getHorizontalPadding(context, controller.responsiveUtils),
|
||||
endIndent: SettingsUtils.getHorizontalPadding(context, controller.responsiveUtils)
|
||||
),
|
||||
SettingFirstLevelTileBuilder(
|
||||
AppLocalizations.of(context).sign_out,
|
||||
_imagePaths.icSignOut,
|
||||
controller.imagePaths.icSignOut,
|
||||
() => controller.manageAccountDashboardController.logout(
|
||||
controller.manageAccountDashboardController.sessionCurrent,
|
||||
controller.manageAccountDashboardController.accountId.value)
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||
import 'package:core/presentation/utils/style_utils.dart';
|
||||
import 'package:core/presentation/views/button/icon_button_web.dart';
|
||||
import 'package:core/utils/direction_utils.dart';
|
||||
@@ -27,10 +25,8 @@ import 'package:tmail_ui_user/main/utils/app_utils.dart';
|
||||
typedef CloseSettingsViewAction = void Function();
|
||||
|
||||
class SettingsView extends GetWidget<SettingsController> {
|
||||
SettingsView({Key? key, this.closeAction}) : super(key: key);
|
||||
const SettingsView({Key? key, this.closeAction}) : super(key: key);
|
||||
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
final CloseSettingsViewAction? closeAction;
|
||||
|
||||
@override
|
||||
@@ -44,7 +40,7 @@ class SettingsView extends GetWidget<SettingsController> {
|
||||
SizedBox.fromSize(
|
||||
size: const Size.fromHeight(52),
|
||||
child: Padding(
|
||||
padding: SettingsUtils.getPaddingAppBar(context, _responsiveUtils),
|
||||
padding: SettingsUtils.getPaddingAppBar(context, controller.responsiveUtils),
|
||||
child: _buildAppbar(context))),
|
||||
const Divider(color: AppColor.colorDividerComposer, height: 1),
|
||||
Obx(() {
|
||||
@@ -138,8 +134,8 @@ class SettingsView extends GetWidget<SettingsController> {
|
||||
child: Row(mainAxisSize: MainAxisSize.min, children: [
|
||||
SvgPicture.asset(
|
||||
DirectionUtils.isDirectionRTLByLanguage(context)
|
||||
? _imagePaths.icCollapseFolder
|
||||
: _imagePaths.icBack,
|
||||
? controller.imagePaths.icCollapseFolder
|
||||
: controller.imagePaths.icBack,
|
||||
colorFilter: AppColor.colorTextButton.asFilter(),
|
||||
fit: BoxFit.fill),
|
||||
Container(
|
||||
@@ -179,7 +175,7 @@ class SettingsView extends GetWidget<SettingsController> {
|
||||
|
||||
Widget _buildCloseSettingButton(BuildContext context) {
|
||||
return buildIconWeb(
|
||||
icon: SvgPicture.asset(_imagePaths.icClose, width: 28, height: 28, fit: BoxFit.fill),
|
||||
icon: SvgPicture.asset(controller.imagePaths.icClose, width: 28, height: 28, fit: BoxFit.fill),
|
||||
tooltip: AppLocalizations.of(context).close,
|
||||
onTap: closeAction);
|
||||
}
|
||||
@@ -188,7 +184,7 @@ class SettingsView extends GetWidget<SettingsController> {
|
||||
return Obx(() {
|
||||
switch (controller.manageAccountDashboardController.settingsPageLevel.value) {
|
||||
case SettingsPageLevel.universal:
|
||||
return SettingsFirstLevelView();
|
||||
return const SettingsFirstLevelView();
|
||||
case SettingsPageLevel.level1:
|
||||
return _viewDisplayedOfAccountMenuItem();
|
||||
}
|
||||
@@ -201,7 +197,7 @@ class SettingsView extends GetWidget<SettingsController> {
|
||||
case AccountMenuItem.profiles:
|
||||
return ProfilesView();
|
||||
case AccountMenuItem.languageAndRegion:
|
||||
return LanguageAndRegionView();
|
||||
return const LanguageAndRegionView();
|
||||
case AccountMenuItem.emailRules:
|
||||
if (controller.manageAccountDashboardController.isRuleFilterCapabilitySupported) {
|
||||
return EmailRulesView();
|
||||
|
||||
+9
-17
@@ -1,10 +1,7 @@
|
||||
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/state/failure.dart';
|
||||
import 'package:core/presentation/state/success.dart';
|
||||
import 'package:core/presentation/utils/app_toast.dart';
|
||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||
import 'package:core/presentation/views/dialog/confirmation_dialog_builder.dart';
|
||||
import 'package:core/utils/platform_info.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -42,9 +39,6 @@ import 'package:tmail_ui_user/main/routes/route_navigation.dart';
|
||||
class IdentitiesController extends BaseController {
|
||||
|
||||
final _accountDashBoardController = Get.find<ManageAccountDashBoardController>();
|
||||
final _appToast = Get.find<AppToast>();
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
|
||||
final GetAllIdentitiesInteractor _getAllIdentitiesInteractor;
|
||||
final CreateNewIdentityInteractor _createNewIdentityInteractor;
|
||||
@@ -179,7 +173,7 @@ class IdentitiesController extends BaseController {
|
||||
|
||||
void _createNewIdentitySuccess(CreateNewIdentitySuccess success) {
|
||||
if (currentOverlayContext != null && currentContext != null) {
|
||||
_appToast.showToastSuccessMessage(
|
||||
appToast.showToastSuccessMessage(
|
||||
currentOverlayContext!,
|
||||
AppLocalizations.of(currentContext!).you_have_created_a_new_identity);
|
||||
}
|
||||
@@ -189,7 +183,7 @@ class IdentitiesController extends BaseController {
|
||||
|
||||
void _createNewDefaultIdentitySuccess(CreateNewDefaultIdentitySuccess success) {
|
||||
if (currentOverlayContext != null && currentContext != null) {
|
||||
_appToast.showToastSuccessMessage(
|
||||
appToast.showToastSuccessMessage(
|
||||
currentOverlayContext!,
|
||||
AppLocalizations.of(currentContext!).you_have_created_a_new_default_identity);
|
||||
}
|
||||
@@ -202,8 +196,8 @@ class IdentitiesController extends BaseController {
|
||||
context: context,
|
||||
barrierColor: AppColor.colorDefaultCupertinoActionSheet,
|
||||
builder: (BuildContext context) => DeleteIdentityDialogBuilder(
|
||||
responsiveUtils: _responsiveUtils,
|
||||
imagePaths: _imagePaths,
|
||||
responsiveUtils: responsiveUtils,
|
||||
imagePaths: imagePaths,
|
||||
onDeleteIdentityAction: () => _deleteIdentityAction(identity),
|
||||
));
|
||||
}
|
||||
@@ -220,10 +214,10 @@ class IdentitiesController extends BaseController {
|
||||
|
||||
void _deleteIdentitySuccess(DeleteIdentitySuccess success) {
|
||||
if (currentOverlayContext != null && currentContext != null) {
|
||||
_appToast.showToastSuccessMessage(
|
||||
appToast.showToastSuccessMessage(
|
||||
currentOverlayContext!,
|
||||
AppLocalizations.of(currentContext!).identity_has_been_deleted,
|
||||
leadingSVGIcon: _imagePaths.icDeleteToast);
|
||||
leadingSVGIcon: imagePaths.icDeleteToast);
|
||||
}
|
||||
|
||||
_refreshAllIdentities();
|
||||
@@ -234,10 +228,10 @@ class IdentitiesController extends BaseController {
|
||||
showDialog(
|
||||
context: currentContext!,
|
||||
barrierColor: AppColor.colorDefaultCupertinoActionSheet,
|
||||
builder: (BuildContext context) => (ConfirmDialogBuilder(_imagePaths)
|
||||
builder: (BuildContext context) => (ConfirmDialogBuilder(imagePaths)
|
||||
..key(const Key('dialog_message_delete_identity_failed'))
|
||||
..title(AppLocalizations.of(context).delete_failed)
|
||||
..addIcon(SvgPicture.asset(_imagePaths.icDeleteDialogFailed, fit: BoxFit.fill))
|
||||
..addIcon(SvgPicture.asset(imagePaths.icDeleteDialogFailed, fit: BoxFit.fill))
|
||||
..marginIcon(EdgeInsets.zero)
|
||||
..styleTitle(const TextStyle(fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -291,7 +285,7 @@ class IdentitiesController extends BaseController {
|
||||
|
||||
void _editIdentitySuccess(EditIdentitySuccess success) {
|
||||
if (currentOverlayContext != null && currentContext != null) {
|
||||
_appToast.showToastSuccessMessage(
|
||||
appToast.showToastSuccessMessage(
|
||||
currentOverlayContext!,
|
||||
AppLocalizations.of(currentContext!).you_are_changed_your_identity_successfully);
|
||||
}
|
||||
@@ -299,7 +293,5 @@ class IdentitiesController extends BaseController {
|
||||
_refreshAllIdentities();
|
||||
}
|
||||
|
||||
ImagePaths get imagePaths => _imagePaths;
|
||||
|
||||
bool get isSignatureShow => identitySelected.value != null;
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/base/mixin/app_loader_mixin.dart';
|
||||
@@ -10,16 +8,13 @@ import 'package:tmail_ui_user/features/manage_account/presentation/profiles/iden
|
||||
|
||||
class IdentitiesView extends GetWidget<IdentitiesController> with PopupMenuWidgetMixin, AppLoaderMixin {
|
||||
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
IdentitiesView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: const EdgeInsets.all(24),
|
||||
child: _responsiveUtils.isWebDesktop(context)
|
||||
child: controller.responsiveUtils.isWebDesktop(context)
|
||||
? _buildIdentitiesViewWebDesktop(context)
|
||||
: _buildIdentitiesViewMobile(context),
|
||||
);
|
||||
@@ -35,8 +30,8 @@ class IdentitiesView extends GetWidget<IdentitiesController> with PopupMenuWidge
|
||||
const SizedBox(height: 12),
|
||||
IdentitiesRadioListBuilder(
|
||||
controller: controller,
|
||||
responsiveUtils: _responsiveUtils,
|
||||
imagePaths: _imagePaths
|
||||
responsiveUtils: controller.responsiveUtils,
|
||||
imagePaths: controller.imagePaths
|
||||
)
|
||||
],
|
||||
);
|
||||
@@ -55,8 +50,8 @@ class IdentitiesView extends GetWidget<IdentitiesController> with PopupMenuWidge
|
||||
const SizedBox(width: 12),
|
||||
Expanded(child: IdentitiesRadioListBuilder(
|
||||
controller: controller,
|
||||
responsiveUtils: _responsiveUtils,
|
||||
imagePaths: _imagePaths
|
||||
responsiveUtils: controller.responsiveUtils,
|
||||
imagePaths: controller.imagePaths
|
||||
)),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -26,7 +26,6 @@ import 'package:tmail_ui_user/main/routes/route_navigation.dart';
|
||||
class VacationController extends BaseController {
|
||||
|
||||
final _accountDashBoardController = Get.find<ManageAccountDashBoardController>();
|
||||
final _appToast = Get.find<AppToast>();
|
||||
final _settingController = Get.find<SettingsController>();
|
||||
|
||||
final GetAllVacationInteractor _getAllVacationInteractor;
|
||||
@@ -242,7 +241,7 @@ class VacationController extends BaseController {
|
||||
final fromDate = vacationPresentation.value.fromDate;
|
||||
if (fromDate == null) {
|
||||
if (currentOverlayContext != null && currentContext != null) {
|
||||
_appToast.showToastErrorMessage(
|
||||
appToast.showToastErrorMessage(
|
||||
currentOverlayContext!,
|
||||
AppLocalizations.of(currentContext!).errorMessageWhenStartDateVacationIsEmpty);
|
||||
}
|
||||
@@ -253,7 +252,7 @@ class VacationController extends BaseController {
|
||||
final toDate = vacationPresentation.value.toDate;
|
||||
if (vacationStopEnabled && toDate != null && toDate.isBefore(fromDate)) {
|
||||
if (currentOverlayContext != null && currentContext != null) {
|
||||
_appToast.showToastErrorMessage(
|
||||
appToast.showToastErrorMessage(
|
||||
currentOverlayContext!,
|
||||
AppLocalizations.of(currentContext!).errorMessageWhenEndDateVacationIsInValid);
|
||||
}
|
||||
@@ -263,7 +262,7 @@ class VacationController extends BaseController {
|
||||
final messageHtmlText = (PlatformInfo.isWeb ? _vacationMessageHtmlText : await _getMessageHtmlText()) ?? '';
|
||||
if (messageHtmlText.isEmpty && context.mounted) {
|
||||
if (currentOverlayContext != null && currentContext != null) {
|
||||
_appToast.showToastErrorMessage(
|
||||
appToast.showToastErrorMessage(
|
||||
currentOverlayContext!,
|
||||
AppLocalizations.of(currentContext!).errorMessageWhenMessageVacationIsEmpty);
|
||||
}
|
||||
@@ -299,7 +298,7 @@ class VacationController extends BaseController {
|
||||
void _handleUpdateVacationSuccess(UpdateVacationSuccess success) {
|
||||
if (success.listVacationResponse.isNotEmpty) {
|
||||
if (currentOverlayContext != null && currentContext != null) {
|
||||
_appToast.showToastSuccessMessage(
|
||||
appToast.showToastSuccessMessage(
|
||||
currentOverlayContext!,
|
||||
AppLocalizations.of(currentContext!).vacationSettingSaved);
|
||||
}
|
||||
|
||||
@@ -22,9 +22,6 @@ import 'package:tmail_ui_user/main/utils/app_utils.dart';
|
||||
|
||||
class VacationView extends GetWidget<VacationController> with RichTextButtonMixin {
|
||||
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
VacationView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
@@ -52,18 +49,18 @@ class VacationView extends GetWidget<VacationController> with RichTextButtonMixi
|
||||
|
||||
Widget _buildVacationFormView(BuildContext context) {
|
||||
return SettingDetailViewBuilder(
|
||||
responsiveUtils: _responsiveUtils,
|
||||
responsiveUtils: controller.responsiveUtils,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
onTapGestureDetector: () => controller.clearFocusEditor(context),
|
||||
child: SingleChildScrollView(
|
||||
physics: const ClampingScrollPhysics(),
|
||||
controller: controller.scrollController,
|
||||
child: Padding(
|
||||
padding: VacationUtils.getPaddingView(context, _responsiveUtils),
|
||||
padding: VacationUtils.getPaddingView(context, controller.responsiveUtils),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (_responsiveUtils.isWebDesktop(context))
|
||||
if (controller.responsiveUtils.isWebDesktop(context))
|
||||
...[
|
||||
Text(
|
||||
AppLocalizations.of(context).vacation,
|
||||
@@ -94,7 +91,9 @@ class VacationView extends GetWidget<VacationController> with RichTextButtonMixi
|
||||
controller.updateVacationPresentation(newStatus: newStatus);
|
||||
},
|
||||
child: SvgPicture.asset(
|
||||
controller.isVacationDeactivated ? _imagePaths.icSwitchOff : _imagePaths.icSwitchOn,
|
||||
controller.isVacationDeactivated
|
||||
? controller.imagePaths.icSwitchOff
|
||||
: controller.imagePaths.icSwitchOn,
|
||||
fit: BoxFit.fill,
|
||||
width: 24,
|
||||
height: 24
|
||||
@@ -121,7 +120,7 @@ class VacationView extends GetWidget<VacationController> with RichTextButtonMixi
|
||||
absorbing: controller.isVacationDeactivated,
|
||||
child: Opacity(
|
||||
opacity: controller.isVacationDeactivated ? 0.3 : 1.0,
|
||||
child: _responsiveUtils.isPortraitMobile(context)
|
||||
child: controller.responsiveUtils.isPortraitMobile(context)
|
||||
? Column(children: [
|
||||
BorderButtonField<DateTime>(
|
||||
label: AppLocalizations.of(context).startDate,
|
||||
@@ -175,8 +174,8 @@ class VacationView extends GetWidget<VacationController> with RichTextButtonMixi
|
||||
},
|
||||
child: SvgPicture.asset(
|
||||
controller.vacationPresentation.value.vacationStopEnabled
|
||||
? _imagePaths.icSwitchOn
|
||||
: _imagePaths.icSwitchOff,
|
||||
? controller.imagePaths.icSwitchOn
|
||||
: controller.imagePaths.icSwitchOff,
|
||||
fit: BoxFit.fill,
|
||||
width: 24,
|
||||
height: 24
|
||||
@@ -201,7 +200,7 @@ class VacationView extends GetWidget<VacationController> with RichTextButtonMixi
|
||||
absorbing: !controller.canChangeEndDate,
|
||||
child: Opacity(
|
||||
opacity: !controller.canChangeEndDate ? 0.3 : 1.0,
|
||||
child: _responsiveUtils.isPortraitMobile(context)
|
||||
child: controller.responsiveUtils.isPortraitMobile(context)
|
||||
? Column(children: [
|
||||
BorderButtonField<DateTime>(
|
||||
label: AppLocalizations.of(context).endDate,
|
||||
@@ -245,7 +244,7 @@ class VacationView extends GetWidget<VacationController> with RichTextButtonMixi
|
||||
const SizedBox(height: 24),
|
||||
Obx(() => AbsorbPointer(
|
||||
absorbing: controller.isVacationDeactivated,
|
||||
child: _responsiveUtils.isPortraitMobile(context)
|
||||
child: controller.responsiveUtils.isPortraitMobile(context)
|
||||
? Opacity(
|
||||
opacity: controller.isVacationDeactivated ? 0.3 : 1.0,
|
||||
child: TextInputFieldBuilder(
|
||||
@@ -289,7 +288,7 @@ class VacationView extends GetWidget<VacationController> with RichTextButtonMixi
|
||||
}
|
||||
|
||||
Widget _buildListButtonAction(BuildContext context) {
|
||||
if (_responsiveUtils.isWebDesktop(context)) {
|
||||
if (controller.responsiveUtils.isWebDesktop(context)) {
|
||||
return Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: buildTextButton(
|
||||
@@ -305,7 +304,7 @@ class VacationView extends GetWidget<VacationController> with RichTextButtonMixi
|
||||
onTap: () => controller.saveVacation(context)),
|
||||
);
|
||||
} else {
|
||||
if (_responsiveUtils.isPortraitMobile(context)) {
|
||||
if (controller.responsiveUtils.isPortraitMobile(context)) {
|
||||
return Row(children: [
|
||||
Expanded(
|
||||
child: buildTextButton(
|
||||
|
||||
Reference in New Issue
Block a user