made app modules movable in their order #84

Merged
MineTec merged 2 commits from develop-reorderableAppModules into develop 2025-02-09 17:36:21 +00:00
Showing only changes of commit 8f58893553 - Show all commits

View File

@ -282,14 +282,15 @@ class _ChatBubbleState extends State<ChatBubble> with SingleTickerProviderStateM
if(!widget.bubbleData.isReplyable) return; if(!widget.bubbleData.isReplyable) return;
var dx = details.delta.dx - _dragStartPosition.dx; var dx = details.delta.dx - _dragStartPosition.dx;
setState(() { setState(() {
_position = (_position.dx + dx).abs() > 30 ? Offset(_position.dx, 0) : Offset(_position.dx + dx, 0); _position = (_position.dx + dx).abs() > 60 ? Offset(_position.dx, 0) : Offset(_position.dx + dx, 0);
}); });
}, },
onHorizontalDragEnd: (DragEndDetails details) { onHorizontalDragEnd: (DragEndDetails details) {
var isAction = _position.dx.abs() > 50;
setState(() { setState(() {
_position = const Offset(0, 0); _position = const Offset(0, 0);
}); });
if(widget.bubbleData.isReplyable) { if(widget.bubbleData.isReplyable && isAction) {
Provider.of<ChatProps>(context, listen: false).setReferenceMessageId(widget.bubbleData.id, context, widget.chatData.token); Provider.of<ChatProps>(context, listen: false).setReferenceMessageId(widget.bubbleData.id, context, widget.chatData.token);
} }
}, },