utils/native_context_menu library

Functions

debugBuildContextMenuPayload({required List<CNPopupMenuEntry> items, required Offset position, required int? resolveColor(Color? color), bool? isDark, Map<PopupMenuIconKey, Uint8List?> customIconBytes = const {}, Map<CNPopupMenuEntry, String> assetPaths = const {}}) → Map<String, Object?>
Builds the method channel payload of showNativeContextMenu.
dismissNativeContextMenu() → Future<void>
Closes a native context menu that is open, which then answers null.
encodeNativeContextMenu(BuildContext context, List<CNPopupMenuEntry> items) → Future<Map<String, Object?>?>
items encoded for a native menu, icons included, or null when context is gone by the time the icons are drawn. Used by the CNContextMenu preview view, which builds its menu natively.
showNativeContextMenu(BuildContext context, {required List<CNPopupMenuEntry> items, required Offset globalPosition}) → Future<List<int>?>
Shows items as a native menu at globalPosition (Flutter's global logical coordinates) and returns the path of the chosen item, or null when the menu was closed without a choice.