add codeblock copy button
This commit is contained in:
parent
027033ad9e
commit
faa7292001
1 changed files with 2 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
import "dart:math";
|
import "dart:math";
|
||||||
|
|
||||||
|
import "package:flutter/services.dart";
|
||||||
import "package:material_ui/material_ui.dart";
|
import "package:material_ui/material_ui.dart";
|
||||||
|
|
||||||
class const CodeBlock(
|
class const CodeBlock(
|
||||||
|
|
@ -28,7 +29,7 @@ class const CodeBlock(
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextButton.icon(
|
TextButton.icon(
|
||||||
onPressed: () {},
|
onPressed: () => Clipboard.setData(.new(text: code)),
|
||||||
icon: Icon(Icons.copy),
|
icon: Icon(Icons.copy),
|
||||||
label: Text("Copy"),
|
label: Text("Copy"),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue