From dc1b01f883779911cd9bd63a5953cb2b50f2356b Mon Sep 17 00:00:00 2001 From: Leandro Borges Ferreira Date: Sun, 26 Feb 2023 17:16:36 +0100 Subject: [PATCH] Moving modal to the middle of the screen when message is big --- .../lib/src/message_widget/reactions/reactions_align.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/stream_chat_flutter/lib/src/message_widget/reactions/reactions_align.dart b/packages/stream_chat_flutter/lib/src/message_widget/reactions/reactions_align.dart index 639fad4c..3fedbeff 100644 --- a/packages/stream_chat_flutter/lib/src/message_widget/reactions/reactions_align.dart +++ b/packages/stream_chat_flutter/lib/src/message_widget/reactions/reactions_align.dart @@ -66,6 +66,10 @@ double _portraitAlign( // possible. const constant = 1300; + print('is attachment: $isAttachment'); + print('shiftFactor: $shiftFactor'); + print('divFactor: $divFactor'); + if (user?.id == message.user?.id) { if (divFactor >= 1.0 || isAttachment) { result = shiftFactor - maxWidth / constant; @@ -109,7 +113,7 @@ double _landScapeAlign( result = 0; } else if (user?.id == message.user?.id) { if (divFactor >= 1.7) { - result = shiftFactor - maxWidth / constant; + result = 0; } else { // Small messages, it is simpler to align then. result = 1 - divFactor * 0.6;