How to copy a content to Clipboard in pure Dart?

Issue

I would like to copy a Text to Clipboard in a Dart console App.

There is this plugin clipboard_manager but it is specific to flutter.
Is there any way to do this in pure Dart?

Solution

The clippy dart package provides clipboard access for dart. It uses different mechanisms depending on whether you’re on Linux, Mac, and Windows, but provides a simple dart API to copy and also to listen to pastes.

You might look at the server example script, which works for a console application too.

Answered By – spenster

Answer Checked By – Gilberto Lyons (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *