dvRefuseIfClipboardBlocked function

void dvRefuseIfClipboardBlocked(
  1. String operation
)

Throws when the clipboard is locked, naming why.

Refused rather than silently doing nothing. A copy that reports success and copies nothing is indistinguishable from a clipboard that is broken, and the application cannot tell the person at the screen which it is.

Implementation

void dvRefuseIfClipboardBlocked(String operation) {
  if (!_clipboard) return;
  throw StateError(
    'The kiosk policy blocks the clipboard, so $operation is refused. This '
    'is dartvel.kiosk.input.clipboard: disabled, not a failure of the '
    'platform binding.',
  );
}