搜尋套件、儲存庫與 APP 分類

套件詳情v0.3.0

clipboard_watcher

此外掛程式允許 Flutter 應用程式監視剪貼簿變更。

AndroidiOSmacOSWindowsLinux
近 30 天下載
4280
喜歡數
43
Pub 分數
140

安裝套件

flutter pub add clipboard_watcher

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

clipboard_watcher 包讓 Flutter 應用程式能在多個平台上監控系統剪貼簿的即時變更。它提供簡單的 API 來聽取剪貼簿更新,非常適合需要回應複製文字或資料的應用程式。此外,該外掛支援 Android、iOS、macOS、Windows 與 Linux,確保跨平台相容性。開發者可利用它來建構剪貼簿歷史記錄管理器、自動化工具,或動態回應使用者複製動作的文字處理應用。

適用情境

  • 剪貼簿歷史記錄追蹤
  • 自動文本處理
  • 跨平台剪貼簿監控
  • 數據傳輸自動化
  • 即時文字捕獲

主要特色

  • 即時剪貼簿監聽
  • 多平台支援
  • 簡單的事件驅動式 API
  • 跨平台一致性
  • 輕量且高效

適合對象

  • 開發剪貼簿感知應用的開發者
  • 需要自動文字提取的工具
  • 需要從剪貼簿即時同步資料的應用程式
  • 自動化與生產力工具
  • 跨平台桌面與行動應用程式

使用建議

  • 某些平台需要適當的權限
  • 在較舊的作業系統版本上可能功能受限
  • 背景作業依賴於平台特定的行為
  • 未加密,不適用於敏感資料
  • 如果輪詢過於頻繁,性能影響

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

🚀 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

所屬分類

原始碼儲存庫

使用此套件的專案