TF-1831 Remove manage account button inside popup menu in Setting View
Signed-off-by: dab246 <tdvu@linagora.com> (cherry picked from commit 2f0e62a1f4c2279716cbabaedbe3969e6af3f69a)
This commit is contained in:
+29
-13
@@ -8,21 +8,37 @@ import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
|||||||
mixin UserSettingPopupMenuMixin {
|
mixin UserSettingPopupMenuMixin {
|
||||||
final _imagePaths = Get.find<ImagePaths>();
|
final _imagePaths = Get.find<ImagePaths>();
|
||||||
|
|
||||||
List<PopupMenuEntry> popupMenuUserSettingActionTile(BuildContext context, UserProfile? userProfile,
|
List<PopupMenuEntry> popupMenuUserSettingActionTile(
|
||||||
{Function? onLogoutAction, Function? onSettingAction}) {
|
BuildContext context,
|
||||||
|
UserProfile? userProfile,
|
||||||
|
{
|
||||||
|
Function? onLogoutAction,
|
||||||
|
Function? onSettingAction
|
||||||
|
}
|
||||||
|
) {
|
||||||
return [
|
return [
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
enabled: false,
|
enabled: false,
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
child: _userInformation(context, userProfile)),
|
child: _userInformation(context, userProfile)
|
||||||
const PopupMenuDivider(height: 0.5),
|
),
|
||||||
PopupMenuItem(
|
if (onSettingAction != null)
|
||||||
padding: EdgeInsets.zero,
|
...[
|
||||||
child: _settingAction(context, onSettingAction)),
|
const PopupMenuDivider(height: 0.5),
|
||||||
const PopupMenuDivider(height: 0.5),
|
PopupMenuItem(
|
||||||
PopupMenuItem(
|
padding: EdgeInsets.zero,
|
||||||
padding: EdgeInsets.zero,
|
child: _settingAction(context, onSettingAction)
|
||||||
child: _logoutAction(context, onLogoutAction)),
|
),
|
||||||
|
const PopupMenuDivider(height: 0.5),
|
||||||
|
],
|
||||||
|
if (onLogoutAction != null)
|
||||||
|
...[
|
||||||
|
const PopupMenuDivider(height: 0.5),
|
||||||
|
PopupMenuItem(
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
child: _logoutAction(context, onLogoutAction)
|
||||||
|
),
|
||||||
|
]
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -215,13 +215,6 @@ class ManageAccountDashBoardController extends ReloadableController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void goToSettings() {
|
|
||||||
popAndPush(
|
|
||||||
AppRoutes.settings,
|
|
||||||
arguments: ManageAccountArguments(sessionCurrent)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void backToMailboxDashBoard({BuildContext? context}) {
|
void backToMailboxDashBoard({BuildContext? context}) {
|
||||||
if (context != null && canBack(context)) {
|
if (context != null && canBack(context)) {
|
||||||
popBack(result: vacationResponse.value);
|
popBack(result: vacationResponse.value);
|
||||||
|
|||||||
@@ -132,17 +132,20 @@ class ManageAccountDashBoardView extends GetWidget<ManageAccountDashBoardControl
|
|||||||
..backgroundColor(Colors.white)
|
..backgroundColor(Colors.white)
|
||||||
..textColor(Colors.black)
|
..textColor(Colors.black)
|
||||||
..context(context)
|
..context(context)
|
||||||
..addOnTapAvatarActionWithPositionClick((position) =>
|
..addOnTapAvatarActionWithPositionClick((position) {
|
||||||
controller.openPopupMenuAction(context, position, popupMenuUserSettingActionTile(context,
|
return controller.openPopupMenuAction(
|
||||||
controller.userProfile.value,
|
context,
|
||||||
onLogoutAction: () {
|
position,
|
||||||
popBack();
|
popupMenuUserSettingActionTile(
|
||||||
controller.logout(controller.sessionCurrent, controller.accountId.value);
|
context,
|
||||||
},
|
controller.userProfile.value,
|
||||||
onSettingAction: () {
|
onLogoutAction: () {
|
||||||
popBack();
|
popBack();
|
||||||
controller.goToSettings();
|
controller.logout(controller.sessionCurrent, controller.accountId.value);
|
||||||
})))
|
}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
})
|
||||||
..addBoxShadows([const BoxShadow(
|
..addBoxShadows([const BoxShadow(
|
||||||
color: AppColor.colorShadowBgContentEmail,
|
color: AppColor.colorShadowBgContentEmail,
|
||||||
spreadRadius: 1, blurRadius: 1, offset: Offset(0, 0.5))])
|
spreadRadius: 1, blurRadius: 1, offset: Offset(0, 0.5))])
|
||||||
|
|||||||
Reference in New Issue
Block a user