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.
This commit is contained in:
parent
7ff98649e9
commit
44e94555f2
1 changed files with 2 additions and 1 deletions
|
@ -12,7 +12,8 @@ class MessageText extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return GestureDetector(
|
return InkWell(
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
onLongPress: () async {
|
onLongPress: () async {
|
||||||
await Clipboard.setData(ClipboardData(text: message.content));
|
await Clipboard.setData(ClipboardData(text: message.content));
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
|
|
Loading…
Reference in a new issue