Search packages, repositories and app categories

Package detailsv0.3.0

clipboard_watcher

This plugin allows Flutter apps to watch clipboard changes.

AndroidiOSmacOSWindowsLinux
30-day downloads
4.3K
Likes
43
Pub points
140

Install package

flutter pub add clipboard_watcher

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The clipboard_watcher package enables Flutter applications to monitor real-time changes to the system clipboard on multiple platforms. It provides a simple API to listen for clipboard updates, making it ideal for apps that need to react to copied text or data. The plugin supports Android, iOS, macOS, Windows, and Linux, ensuring cross-platform compatibility. Developers can use it to build tools like clipboard history managers, automation utilities, or text processing apps that respond dynamically to user copy actions.

Use cases

  • Clipboard history tracking
  • Automated text processing
  • Cross-platform clipboard monitoring
  • Data transfer automation
  • Real-time text capture

Key features

  • Real-time clipboard listening
  • Multi-platform support
  • Simple event-based API
  • Cross-platform consistency
  • Lightweight and efficient

Suitable for

  • Developers building clipboard-aware apps
  • Tools requiring automatic text extraction
  • Apps needing real-time data sync from clipboard
  • Automation and productivity utilities
  • Cross-platform desktop and mobile apps

Considerations

  • Requires appropriate permissions on some platforms
  • May have limited functionality on older OS versions
  • Background operation depends on platform-specific behavior
  • Not suitable for sensitive data without encryption
  • Performance impact if polling too frequently

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

🚀 Ship Your App Faster: Try Fastforge - The simplest way to build, package and distribute your Flutter apps.

clipboard_watcher

pub version All Contributors

This plugin allows Flutter apps to watch clipboard changes.


English | 简体中文


Platform Support

Platform Support
Linux ✔️ Fully supported
macOS ✔️ Fully supported
Windows ✔️ Fully supported
iOS 14+ Needs user permission to read data copied from others apps
Old versions are fully supported out of the box
Android 10+ Only works when the app is in the foreground
Old versions are fully supported out of the box

Quick Start

Installation

Add this to your package's pubspec.yaml file:

dependencies:
  clipboard_watcher: ^0.2.0
Usage
class HomePage extends StatefulWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> with ClipboardListener {
  @override
  void initState() {
    clipboardWatcher.addListener(this);
    // start watch
    clipboardWatcher.start();
    super.initState();
  }

  @override
  void dispose() {
    clipboardWatcher.removeListener(this);
    // stop watch
    clipboardWatcher.stop();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    // ...
  }

  @override
  void onClipboardChanged() async {
    ClipboardData? newClipboardData = await Clipboard.getData(Clipboard.kTextPlain);
    print(newClipboardData?.text ?? "");
  }
}

Please see the example app of this plugin for a full example.

Who's using it?

  • Biyi - A convenient translation and dictionary app.

Contributors

LiJianying
LiJianying

💻
Ademar
Ademar

💻
Amritpal Singh
Amritpal Singh

💻
J-P Nurmi
J-P Nurmi

💻
Leo Peng
Leo Peng

💻
Add your contributions

License

MIT

Categories

Source repository

Projects using this package