getContent method

  1. @override
String getContent()
override

Implementation

@override
String getContent() {
  var result =
      Process.runSync('/usr/bin/xclip', ['-selection', 'clipboard', '-o']);
  if (result.exitCode != 0) {
    throw Exception('Failed to get clipboard content.');
  }
  return result.stdout.toString();
}