remove method

Future<void> remove(
  1. Object menuItemId
)

Removes a context menu item. menuItemId The ID of the context menu item to remove. returns Resolves when the context menu has been removed.

Implementation

Future<void> remove(Object menuItemId) async {
  await $js.chrome.contextMenus
      .remove(switch (menuItemId) {
        int() => menuItemId.toJS,
        String() => menuItemId.toJS,
        _ => throw UnsupportedError(
            'Received type: ${menuItemId.runtimeType}. Supported types are: int, String')
      })
      .toDart;
}