copy static method

Future<void> copy(
  1. String text
)

copy receives a string text and saves to Clipboard returns void

Implementation

static Future<void> copy(String text) async {
  if (text.isNotEmpty) {
    Clipboard.setData(ClipboardData(text: text));
    return;
  } else {
    throw ('Please enter a string');
  }
}