Giter Club home page Giter Club logo

clipboard_watcher's Introduction

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

clipboard_watcher's People

Contributors

lijy91 avatar ademar111190 avatar boparaiamritcsb avatar jpnurmi avatar leobuaa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.