I am trying to use the Flutter SelectableText
Widget to make sure it is possible to copy the Text in my web application, but there is no 'copy' option appearing in the Context Menu.
I am using the following Code ("select all" and "copy" should be given as default toolbar options https://api.flutter.dev/flutter/material/SelectableText/toolbarOptions.html):
SelectableText(
'Hello from Flutter',
),
Can anyone help me with this problem?
When long tab on Text widget, a tooltip show up with 'copy'. When click on the 'copy' the text content should copy to system clipboard.
In Flutter, the text presented by the Text widget is undetectable (even on the web). To make text selectable, you can use the SelectableText widget.
I tried this it's working but we can't select a part of the text but we can select whole.
child: SelectableText(sample.sourceCode,
cursorColor: Colors.red,
showCursor: true,
toolbarOptions: ToolbarOptions(
copy: true,
selectAll: true,
cut: false,
paste: false
),
style: TextStyle(color: Colors.black, fontStyle: FontStyle.normal))
in web use Ctrl
+ A
and Ctrl
+ C
to copy the whole text.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With