Skip to content
Snippets Groups Projects
Commit 88c46e5b authored by vjrj's avatar vjrj
Browse files

Copy qr also in payments

parent d4ebed9b
No related branches found
No related tags found
No related merge requests found
...@@ -40,13 +40,8 @@ void showTooltip(BuildContext context, String title, String message) { ...@@ -40,13 +40,8 @@ void showTooltip(BuildContext context, String title, String message) {
); );
} }
void copyPublicKeyToClipboard(BuildContext context) { void copyPublicKeyToClipboard(BuildContext context, [String? uri]) {
/* final DataWriterItem item = DataWriterItem(); FlutterClipboard.copy(uri ?? SharedPreferencesHelper().getPubKey()).then(
item.add(Formats.plainText(SharedPreferencesHelper().getPubKey()));
ClipboardWriter.instance.write(<DataWriterItem>[item]).then((dynamic value) =>
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(tr('key_copied_to_clipboard'))))); */
FlutterClipboard.copy(SharedPreferencesHelper().getPubKey()).then(
(dynamic value) => ScaffoldMessenger.of(context).showSnackBar( (dynamic value) => ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(tr('key_copied_to_clipboard'))))); SnackBar(content: Text(tr('key_copied_to_clipboard')))));
} }
......
...@@ -16,6 +16,10 @@ class CardTerminalScreen extends StatelessWidget { ...@@ -16,6 +16,10 @@ class CardTerminalScreen extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final String duniterUri = getQrUri(
pubKey: SharedPreferencesHelper().getPubKey(),
locale: context.locale.toLanguageTag(),
amount: amount);
return Card( return Card(
key: receiveQrKey, key: receiveQrKey,
elevation: 8, elevation: 8,
...@@ -90,11 +94,9 @@ class CardTerminalScreen extends StatelessWidget { ...@@ -90,11 +94,9 @@ class CardTerminalScreen extends StatelessWidget {
child: Column(children: <Widget>[ child: Column(children: <Widget>[
if (!amount.contains('+')) if (!amount.contains('+'))
Expanded( Expanded(
child: QrImage( child: GestureDetector(
data: getQrUri( onTap: () => copyPublicKeyToClipboard(context, duniterUri),
pubKey: SharedPreferencesHelper().getPubKey(), child: QrImage(data: duniterUri),
locale: context.locale.toLanguageTag(),
amount: amount),
// size: smallScreen(context) ? 95.0 : 140.0) // size: smallScreen(context) ? 95.0 : 140.0)
)) ))
])), ])),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment