From 3fb48b5bcfe80f1d938c031c29c8c17699d09a9e Mon Sep 17 00:00:00 2001 From: Pupsi28 <larslukasneuhaus@gmx.de> Date: Sun, 12 May 2024 14:30:41 +0200 Subject: [PATCH] added option to reply on long press (and better possibilities to play with chat bubble drag) --- lib/view/pages/talk/components/chatBubble.dart | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/view/pages/talk/components/chatBubble.dart b/lib/view/pages/talk/components/chatBubble.dart index 4ee74e0..8110c1c 100644 --- a/lib/view/pages/talk/components/chatBubble.dart +++ b/lib/view/pages/talk/components/chatBubble.dart @@ -182,6 +182,17 @@ class _ChatBubbleState extends State<ChatBubble> with SingleTickerProviderStateM ], ), ), + Visibility( + visible: widget.bubbleData.isReplyable, + child: ListTile( + leading: const Icon(Icons.reply_outlined), + title: const Text('Antworten'), + onTap: () => { + Provider.of<ChatProps>(context, listen: false).setReferenceMessageId(widget.bubbleData.id, context, widget.chatData.token), + Navigator.of(context).pop(), + }, + ), + ), Visibility( visible: canReact, child: ListTile( @@ -272,7 +283,7 @@ class _ChatBubbleState extends State<ChatBubble> with SingleTickerProviderStateM if(!widget.bubbleData.isReplyable) return; var dx = details.delta.dx - _dragStartPosition.dx; setState(() { - _position = _position.dx.abs() > 30 ? Offset(_position.dx, 0) : Offset(_position.dx + dx, 0); + _position = (_position.dx + dx).abs() > 30 ? Offset(_position.dx, 0) : Offset(_position.dx + dx, 0); }); }, onHorizontalDragEnd: (DragEndDetails details) {