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?> ?> -
itemsencoded for a native menu, icons included, or null whencontextis gone by the time the icons are drawn. Used by theCNContextMenupreview view, which builds its menu natively. -
showNativeContextMenu(
BuildContext context, {required List< CNPopupMenuEntry> items, required Offset globalPosition}) → Future<List< int> ?> -
Shows
itemsas a native menu atglobalPosition(Flutter's global logical coordinates) and returns the path of the chosen item, or null when the menu was closed without a choice.