win32_clipboard 0.1.1 copy "win32_clipboard: ^0.1.1" to clipboard
win32_clipboard: ^0.1.1 copied to clipboard

A package that provides a friendly Dart API for accessing the Windows Clipboard.

A package that provides a friendly Dart API for accessing the Windows Clipboard.

This package builds on top of the Dart win32 package, offering a high-level Dart wrapper that avoids the need for users to understand FFI or write directly to the Win32 API.

Part of the Dart | Windows suite of Windows packages.

ci Package: win32_clipboard Publisher: win32.pub Language: Dart License: BSD-3-Clause codecov

Usage #

Retrieve text from the clipboard #

import 'package:win32_clipboard/win32_clipboard.dart';

void main() {
  if (Clipboard.hasText) {
    print('Clipboard text: ${Clipboard.getText()}');
  }
}

Write text to the clipboard #

import 'package:win32_clipboard/win32_clipboard.dart';

void main() {
  if (Clipboard.setText('Hello, world!')) {
    print('Clipboard now contains: ${Clipboard.getText()}');
  }
}

Retrieve a list of available clipboard formats #

import 'package:win32_clipboard/win32_clipboard.dart';

void main() {
  print('Clipboard has ${Clipboard.numberOfFormats} format(s)');
  for (final format in Clipboard.formats) {
    print('- $format');
  }
}

Clear the clipboard #

import 'package:win32_clipboard/win32_clipboard.dart';

void main() {
  if (Clipboard.clear()) {
    print('Clipboard contents cleared successfully.');
  }
}

To learn more, see the API Documentation.

Feature requests and bugs #

Please file feature requests and bugs at the issue tracker.

8
likes
0
pub points
55%
popularity

Publisher

verified publisherhalildurmus.dev

A package that provides a friendly Dart API for accessing the Windows Clipboard.

Homepage
Repository (GitHub)
View/report issues

Topics

#clipboard #win32 #ffi #windows

License

unknown (license)

Dependencies

ffi, win32

More

Packages that depend on win32_clipboard