From 7dad61dbbb3af41c7284c47b98ac059d503b3e3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Sun, 23 Jun 2024 13:31:10 +0200 Subject: [PATCH] Fix re-layout in message_view after data is loaded --- .../lib/pages/message_view/message_view.dart | 58 +++++++++++++++++-- 1 file changed, 52 insertions(+), 6 deletions(-) diff --git a/flutter/lib/pages/message_view/message_view.dart b/flutter/lib/pages/message_view/message_view.dart index d49ccc5..d3446e9 100644 --- a/flutter/lib/pages/message_view/message_view.dart +++ b/flutter/lib/pages/message_view/message_view.dart @@ -132,12 +132,58 @@ class _MessageViewPageState extends State { if (message.content != null) ..._buildMessageContent(context, message), SizedBox(height: 8), if (message.senderName != null) _buildMetaCard(context, FontAwesomeIcons.solidSignature, 'Sender', [message.senderName!], () => {/*TODO*/}), - _buildMetaCard(context, FontAwesomeIcons.solidGearCode, 'KeyToken', [message.usedKeyID, if (token != null) token.name], () => {/*TODO*/}), - _buildMetaCard(context, FontAwesomeIcons.solidIdCardClip, 'MessageID', [message.messageID, if (message.userMessageID != null) message.userMessageID!], null), - _buildMetaCard(context, FontAwesomeIcons.solidSnake, 'Channel', [message.channelID, channel?.displayName ?? message.channelInternalName], () => {/*TODO*/}), - _buildMetaCard(context, FontAwesomeIcons.solidTimer, 'Timestamp', [message.timestamp], null), - _buildMetaCard(context, FontAwesomeIcons.solidUser, 'User', [if (user != null) user.userID, if (user?.username != null) user!.username!], () => {/*TODO*/}), //TODO - _buildMetaCard(context, FontAwesomeIcons.solidBolt, 'Priority', [_prettyPrintPriority(message.priority)], () => {/*TODO*/}), //TODO + _buildMetaCard( + context, + FontAwesomeIcons.solidGearCode, + 'KeyToken', + [ + message.usedKeyID, + token?.name ?? '...', + ], + () => {/*TODO*/}), + _buildMetaCard( + context, + FontAwesomeIcons.solidIdCardClip, + 'MessageID', + [ + message.messageID, + message.userMessageID ?? '', + ], + null), + _buildMetaCard( + context, + FontAwesomeIcons.solidSnake, + 'Channel', + [ + message.channelID, + channel?.displayName ?? message.channelInternalName, + ], + () => {/*TODO*/}), + _buildMetaCard( + context, + FontAwesomeIcons.solidTimer, + 'Timestamp', + [ + message.timestamp, + ], + null), + _buildMetaCard( + context, + FontAwesomeIcons.solidUser, + 'User', + [ + user?.userID ?? '...', + user?.username ?? '', + ], + () => {/*TODO*/}), //TODO + _buildMetaCard( + context, + FontAwesomeIcons.solidBolt, + 'Priority', + [ + _prettyPrintPriority(message.priority), + ], + () => {/*TODO*/}), //TODO if (message.senderUserID == userAccUserID) UI.button(text: "Delete Message", onPressed: () {/*TODO*/}, color: Colors.red[900]), ], ),