Skip to content

Commit 7c747bb

Browse files
xVemupeiwenqin
andauthored
add logger content can copy; (#9)
history logger can clearl; Co-authored-by: peiwenqin <[email protected]>
1 parent a68957b commit 7c747bb

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

lib/src/utils/ansi_parser.dart

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import 'package:flutter/gestures.dart';
12
import 'package:flutter/material.dart';
3+
import 'package:flutter/services.dart';
24

35
class AnsiParser {
46
static const TEXT = 0, BRACKET = 1, CODE = 2;
@@ -117,11 +119,15 @@ class AnsiParser {
117119

118120
TextSpan createSpan(String text) {
119121
return TextSpan(
120-
text: text,
121-
style: TextStyle(
122-
color: foreground,
123-
backgroundColor: background,
124-
),
125-
);
122+
text: text,
123+
style: TextStyle(
124+
color: foreground,
125+
backgroundColor: background,
126+
),
127+
recognizer: LongPressGestureRecognizer()
128+
..onLongPress = () {
129+
Clipboard.setData(ClipboardData(text: text));
130+
// Toast.toast("Copy to paste board");
131+
});
126132
}
127133
}

0 commit comments

Comments
 (0)