disableContextMenu static method

Future<void> disableContextMenu()

Disable the browser's context menu.

By default, when the app starts, the browser's context menu is already enabled.

This is an asynchronous action. The context menu can be considered to be disabled at the time that the Future resolves. enabled won't reflect the change until that time.

See also:

Implementation

static Future<void> disableContextMenu() {
  assert(kIsWeb, 'This has no effect on platforms other than web.');
  return _instance._channel.invokeMethod<void>(
    'disableContextMenu',
  ).then((_) {
    _instance._enabled = false;
  });
}