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 {
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
List<PopupMenuEntry> popupMenuUserSettingActionTile(BuildContext context, UserProfile? userProfile,
|
||||
{Function? onLogoutAction, Function? onSettingAction}) {
|
||||
List<PopupMenuEntry> popupMenuUserSettingActionTile(
|
||||
BuildContext context,
|
||||
UserProfile? userProfile,
|
||||
{
|
||||
Function? onLogoutAction,
|
||||
Function? onSettingAction
|
||||
}
|
||||
) {
|
||||
return [
|
||||
PopupMenuItem(
|
||||
enabled: false,
|
||||
padding: EdgeInsets.zero,
|
||||
child: _userInformation(context, userProfile)),
|
||||
const PopupMenuDivider(height: 0.5),
|
||||
PopupMenuItem(
|
||||
padding: EdgeInsets.zero,
|
||||
child: _settingAction(context, onSettingAction)),
|
||||
const PopupMenuDivider(height: 0.5),
|
||||
PopupMenuItem(
|
||||
padding: EdgeInsets.zero,
|
||||
child: _logoutAction(context, onLogoutAction)),
|
||||
enabled: false,
|
||||
padding: EdgeInsets.zero,
|
||||
child: _userInformation(context, userProfile)
|
||||
),
|
||||
if (onSettingAction != null)
|
||||
...[
|
||||
const PopupMenuDivider(height: 0.5),
|
||||
PopupMenuItem(
|
||||
padding: EdgeInsets.zero,
|
||||
child: _settingAction(context, onSettingAction)
|
||||
),
|
||||
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}) {
|
||||
if (context != null && canBack(context)) {
|
||||
popBack(result: vacationResponse.value);
|
||||
|
||||
@@ -132,17 +132,20 @@ class ManageAccountDashBoardView extends GetWidget<ManageAccountDashBoardControl
|
||||
..backgroundColor(Colors.white)
|
||||
..textColor(Colors.black)
|
||||
..context(context)
|
||||
..addOnTapAvatarActionWithPositionClick((position) =>
|
||||
controller.openPopupMenuAction(context, position, popupMenuUserSettingActionTile(context,
|
||||
controller.userProfile.value,
|
||||
onLogoutAction: () {
|
||||
popBack();
|
||||
controller.logout(controller.sessionCurrent, controller.accountId.value);
|
||||
},
|
||||
onSettingAction: () {
|
||||
popBack();
|
||||
controller.goToSettings();
|
||||
})))
|
||||
..addOnTapAvatarActionWithPositionClick((position) {
|
||||
return controller.openPopupMenuAction(
|
||||
context,
|
||||
position,
|
||||
popupMenuUserSettingActionTile(
|
||||
context,
|
||||
controller.userProfile.value,
|
||||
onLogoutAction: () {
|
||||
popBack();
|
||||
controller.logout(controller.sessionCurrent, controller.accountId.value);
|
||||
}
|
||||
)
|
||||
);
|
||||
})
|
||||
..addBoxShadows([const BoxShadow(
|
||||
color: AppColor.colorShadowBgContentEmail,
|
||||
spreadRadius: 1, blurRadius: 1, offset: Offset(0, 0.5))])
|
||||
|
||||
Reference in New Issue
Block a user