From 44e94555f24e0bd067e2a3a85af9d6e2d2be4983 Mon Sep 17 00:00:00 2001 From: Nutcake Date: Sat, 11 Nov 2023 10:51:24 +0100 Subject: [PATCH] Add ripple effect to text-copy action Generally the use of GestureDetector is discouraged in favor of InkWell unless you have a very specific reason to use it. InkWells automatically generate ripple effects if there is a parent material widget in the tree to indicate to a user that a given widget is interactible. --- lib/widgets/messages/message_text.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/widgets/messages/message_text.dart b/lib/widgets/messages/message_text.dart index 1fa6ad6..c085df5 100644 --- a/lib/widgets/messages/message_text.dart +++ b/lib/widgets/messages/message_text.dart @@ -12,7 +12,8 @@ class MessageText extends StatelessWidget { @override Widget build(BuildContext context) { - return GestureDetector( + return InkWell( + borderRadius: BorderRadius.circular(16), onLongPress: () async { await Clipboard.setData(ClipboardData(text: message.content)); if (context.mounted) {