Answers for "flutter allow user to select text"

0

flutter allow user to select text

//Give your scaffold a key defined like so
GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey();

/// Pastes given String to the clipboard and shows Popup-Snackbar
  void copyToClipboard(String toClipboard) {
    ClipboardData data = new ClipboardData(text: toClipboard);
    Clipboard.setData(data);
    _scaffoldKey.currentState.showSnackBar(new SnackBar(
      content: new Text(toClipboard + ' copied to clipboard.'),
    ));
  }
Posted by: Guest on March-24-2021

Code answers related to "flutter allow user to select text"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language