FLUTTER ECOSYSTEM

leanflutter/clipboard_watcher

このプラグインにより、Flutterアプリがクリップボードの変更を監視できます。

クリップボードウォッチャー のプロジェクト画像
Stars
60
Forks
21
最終プッシュ(UTC)
2026/09/19
プロジェクト状態
公開中
LeanFlutter GitHub avatar
GITHUB Organization

LeanFlutter ↗

To make the flutter even simpler

言語C++CMakeSwiftRubyKotlinDartCObjective-C

技術トピック

このリポジトリが公開するパッケージ

使用している依存関係

依存関係一覧 3 件

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

README を開く / 閉じる

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

clipboard_watcher

pub version https://img.shields.io/discord/884679008049037342.svg https://img.shields.io/badge/dynamic/json?label=Visits%20Count&query=value&url=https://api.countapi.xyz/hit/leanflutter.clipboard_watcher/visits 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

💻
https://raw.githubusercontent.com/all-contributors/all-contributors-cli/1b8533af435da9854653492b1327a23a4dbd0a10/assets/logo-small.svg Add your contributions

License

MIT