win32_clipboard
2.0.3, released 7 months ago by halildurmus.dev
Type‑safe Dart API for reading, writing and monitoring the Windows clipboard.
What it does
Provides high‑level functions to get/set text, file lists and custom data on the Windows clipboard. Includes a stream‑based monitor for clipboard change notifications, all built on top of win32 FFI.
AI-written summary of version 2.0.3, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need clipboard access in a Windows‑only Flutter or Dart desktop app
- You want a type‑safe, high‑level API without handling raw Win32 calls
- You need real‑time clipboard change notifications
Skip it when
- Your app targets iOS, Android, Web or other non‑Windows platforms
- You prefer a pure‑Dart solution without native dependencies
Strengths
- Type‑safe, high‑level abstraction over Win32 clipboard
- Stream‑based change monitoring without blocking the main isolate
- Supports text, file lists and custom formats
Weaknesses
- Works only on Windows
- Requires win32 FFI and native build steps
Setup
- Kind
- FFI (native library)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 4
import 'package:win32_clipboard/win32_clipboard.dart';
void main() async {
Clipboard.setText('Hello, clipboard!');
final text = Clipboard.getText();
print(text);
final monitor = ClipboardChangeMonitor();
await monitor.start();
monitor.events.listen((_) => print('Clipboard changed'));
// ...
await monitor.close();
}Alternatives
Packages that do the same job and could replace win32_clipboard.
- pubspec_parse
Parse pubspec.yaml files with a type‑safe API and detailed error reporting.
93Compare - deep_pick
Type-safe API for manual JSON parsing with useful error messages.
91Compare - dart_either
Either monad for Dart and Flutter supporting type-safe error handling and railway-oriented programming.
81Compare - pubspec_manager
Type-safe API to read, modify, and write pubspec.yaml while preserving comments.
78Compare
Works with
Packages commonly used together with win32_clipboard: ones it builds on, ones built on it, and its own family.
- ffiwin32_clipboard depends on itUtilities for working with Foreign Function Interface (FFI) code in Dart.
- win32win32_clipboard depends on itCall common Windows APIs and COM objects directly from Dart using FFI.
- ffi_leak_trackerwin32_clipboard depends on itTracks and detects native memory leaks in Dart FFI allocations.
- win32_registrySame familyType‑safe Dart API for accessing and managing the Windows Registry
- filepicker_windowsSame familyWindows file and directory picker using native dialog controls
- win32_gamepadSame familyType-safe Dart API for accessing Windows gamepads via Win32