Answers for "how to copy to clipboard in flutter on press of a button"

4

copy to clipboard flutter

import 'package:flutter/services.dart';

ClipboardData data = ClipboardData(text: '<Text to copy goes here>');
await Clipboard.setData(data);
Posted by: Guest on December-06-2020
0

flutter how to create copy button

RaisedButton(
  child: Text('Copy'),
  onPressed: () {
    ClipboardManager.copyToClipBoard(
            _variableContainingString)
        .then((result) {
      final snackBar = SnackBar(
        content: Text('Copied to Clipboard'),
        action: SnackBarAction(
          label: 'Undo',
          onPressed: () {},
        ),
      );
      Scaffold.of(context).showSnackBar(snackBar);
    });
  },
),
Posted by: Guest on June-19-2021

Code answers related to "how to copy to clipboard in flutter on press of a button"

Code answers related to "Dart"

Browse Popular Code Answers by Language