Skip to content

Commit 4fca56a

Browse files
Add identifier copy button (#612)
1 parent 7be6489 commit 4fca56a

1 file changed

Lines changed: 19 additions & 8 deletions

File tree

commet/lib/ui/organisms/user_profile/user_profile_view.dart

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import 'package:commet/ui/atoms/tiny_pill.dart';
1212
import 'package:commet/ui/navigation/adaptive_dialog.dart';
1313
import 'package:commet/utils/color_utils.dart';
1414
import 'package:flutter/material.dart';
15+
import 'package:flutter/services.dart';
1516
import 'package:intl/intl.dart';
1617
import 'package:tiamat/tiamat.dart' as tiamat;
1718

@@ -366,14 +367,24 @@ class _UserProfileViewState extends State<UserProfileView> {
366367
return Padding(
367368
padding: const EdgeInsets.fromLTRB(0, 0, 0, 4),
368369
child: Opacity(
369-
opacity: 0.8,
370-
child: Text(
371-
widget.identifier,
372-
style: Theme.of(context).textTheme.labelSmall?.copyWith(
373-
fontFamily: "Code",
374-
color: Theme.of(context).colorScheme.onSurface),
375-
),
376-
),
370+
opacity: 0.8,
371+
child: Row(
372+
children: [
373+
Text(
374+
widget.identifier,
375+
style: Theme.of(context).textTheme.labelSmall?.copyWith(
376+
fontFamily: "Code",
377+
color: Theme.of(context).colorScheme.onSurface),
378+
),
379+
tiamat.IconButton(
380+
icon: Icons.copy,
381+
onPressed: () =>
382+
Clipboard.setData(ClipboardData(text: widget.identifier)),
383+
size: Theme.of(context).textTheme.labelSmall?.fontSize ?? 12,
384+
iconColor: Theme.of(context).colorScheme.onSurface,
385+
),
386+
],
387+
)),
377388
);
378389
}
379390

0 commit comments

Comments
 (0)