feat: proper separate getter for clipboard content

This commit is contained in:
Aliaksei Tratseuski 2024-04-30 23:25:51 +04:00
parent 47f3d5f53c
commit 6eb5299d46
2 changed files with 2 additions and 2 deletions

View file

@ -33,7 +33,7 @@ sealed class ConsoleLog {
/// data available for copy in dialog /// data available for copy in dialog
String? get shareableData => '$title\n' String? get shareableData => '$title\n'
'$content'; '{\n$content\n}';
static final DateFormat _formatter = DateFormat('hh:mm:ss'); static final DateFormat _formatter = DateFormat('hh:mm:ss');
String get timeString => _formatter.format(time); String get timeString => _formatter.format(time);

View file

@ -112,7 +112,7 @@ class ConsoleItemDialog extends StatelessWidget {
// A button to copy the request to the clipboard // A button to copy the request to the clipboard
if (log.shareableData?.isNotEmpty ?? false) if (log.shareableData?.isNotEmpty ?? false)
TextButton( TextButton(
onPressed: () => PlatformAdapter.setClipboard(log.content), onPressed: () => PlatformAdapter.setClipboard(log.shareableData!),
child: Text('console_page.copy'.tr()), child: Text('console_page.copy'.tr()),
), ),
// close dialog // close dialog