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

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

example/main.dart

// Copyright (c) 2023, Halil Durmus. Please see the AUTHORS file for details.
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

import 'package:win32_clipboard/win32_clipboard.dart';

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

  print('Clipboard is ${Clipboard.isEmpty ? 'empty' : 'not empty'}.');

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

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

  if (Clipboard.clear()) {
    print('Clipboard contents cleared successfully.');
  }
}
5
likes
140
pub points
53%
popularity

Publisher

verified publisherhalildurmus.dev

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

Repository (GitHub)
View/report issues

Topics

#clipboard #win32 #ffi #windows

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

ffi, win32

More

Packages that depend on win32_clipboard