0

I have a text and a URL link like this:

Title https://example.net

Now I can copy them to the clipboard and paste them separately like above but I would like to paste them so it is a text with hyperlink, like this:

Title

How do I do this in flutter?

I have tried doing the following

final title = 'Title';
final url = 'https://example.net';
inal htmlLink = '<a href="$url">$title</a>';
final uri = Uri.dataFromString(htmlLink, mimeType: 'text/html');
pajoe
  • 1
  • check this article, https://www.fluttercampus.com/guide/206/how-to-create-text-hyperlink-in-flutter/ – JB Jason Apr 22 '23 at 10:30

1 Answers1

0

Set your data with

await Clipboard.setData(ClipboardData(text: "your text"));

Please visit below link

Copy to clipboard

Developer
  • 582
  • 1
  • 3
  • 12
  • I do not want to copy only tex, i want to copy text with link embeded just like a hyperlink – pajoe May 01 '23 at 07:28