TF-3766 Change context menu style for search email view on mobile

Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
dab246
2025-06-12 14:14:06 +07:00
committed by Dat H. Pham
parent 075243a54b
commit 95d9ddc9ad
4 changed files with 141 additions and 128 deletions
@@ -1,5 +1,6 @@
import 'package:core/presentation/extensions/color_extension.dart';
import 'package:core/presentation/views/bottom_popup/cupertino_action_sheet_builder.dart';
import 'package:core/utils/platform_info.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@@ -20,30 +21,37 @@ mixin PopupContextMenuActionMixin {
OnContextMenuActionClick? onContextMenuActionClick,
}
) async {
await showModalBottomSheet(
context: context,
showDragHandle: true,
useSafeArea: true,
isScrollControlled: true,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(16.0),
topRight: Radius.circular(16.0),
),
),
backgroundColor: Colors.white,
barrierColor: Colors.black.withOpacity(0.2),
builder: (_) {
return ColoredBox(
color: Colors.white,
child: ContextMenuDialogView(
actions: itemActions ?? [],
onContextMenuActionClick: (menuAction) =>
onContextMenuActionClick?.call(menuAction),
if (actionTiles.isNotEmpty) {
await (CupertinoActionSheetBuilder(context, key: key)
..addTiles(actionTiles)
..addCancelButton(cancelButton ?? buildCancelButton(context)))
.show();
} else {
await showModalBottomSheet(
context: context,
showDragHandle: true,
useSafeArea: true,
isScrollControlled: true,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(16.0),
topRight: Radius.circular(16.0),
),
);
},
);
),
backgroundColor: Colors.white,
barrierColor: Colors.black.withOpacity(0.2),
builder: (_) {
return ColoredBox(
color: Colors.white,
child: ContextMenuDialogView(
actions: itemActions ?? [],
onContextMenuActionClick: (menuAction) =>
onContextMenuActionClick?.call(menuAction),
),
);
},
);
}
}
void openPopupMenuAction(