AlexanderLipski
AlexanderLipski

Reputation: 81

Flutter Web - Missing copy option in SelectableText Widget

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.

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?

Upvotes: 8

Views: 7441

Answers (1)

Shailendra Madda
Shailendra Madda

Reputation: 21551

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.

Upvotes: 1

Related Questions