From afc49a7a2acd1295b08b26ec347621e40659e2ed Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 8 Dec 2024 17:16:18 +0800 Subject: [PATCH] :iphone: Chat responsive --- lib/screens/chat/room.dart | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/lib/screens/chat/room.dart b/lib/screens/chat/room.dart index 5f9d097..26219b1 100644 --- a/lib/screens/chat/room.dart +++ b/lib/screens/chat/room.dart @@ -306,20 +306,26 @@ class _ChatRoomScreenState extends State { ); } - return ChatMessage( - data: message, - isMerged: canMerge, - hasMerged: canMergePrevious, - isPending: _messageController.unconfirmedMessages.contains(message.uuid), - onReply: (value) { - _inputGlobalKey.currentState?.setReply(value); - }, - onEdit: (value) { - _inputGlobalKey.currentState?.setEdit(value); - }, - onDelete: (value) { - _inputGlobalKey.currentState?.deleteMessage(value); - }, + return Align( + alignment: Alignment.centerLeft, + child: Container( + constraints: BoxConstraints(maxWidth: 480), + child: ChatMessage( + data: message, + isMerged: canMerge, + hasMerged: canMergePrevious, + isPending: _messageController.unconfirmedMessages.contains(message.uuid), + onReply: (value) { + _inputGlobalKey.currentState?.setReply(value); + }, + onEdit: (value) { + _inputGlobalKey.currentState?.setEdit(value); + }, + onDelete: (value) { + _inputGlobalKey.currentState?.deleteMessage(value); + }, + ), + ), ); }, ),