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?
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?
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.
You can do it by importing import 'package:flutter/services.dart';
and then by using the following snippet Clipboard.setData(ClipboardData(text: 'ToTheMoon123456'));
**No package required!