🐛 Bug fixes and optimization
This commit is contained in:
@ -94,7 +94,6 @@ class _AttachmentListState extends State<AttachmentList> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
getMetadataList();
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,17 @@ class ChatMessage extends StatelessWidget {
|
||||
if (isContentPreviewing) {
|
||||
widget = buildContent();
|
||||
} else if (isMerged) {
|
||||
widget = buildContent().paddingOnly(left: 52);
|
||||
widget = Column(
|
||||
children: [
|
||||
buildContent().paddingOnly(left: 52),
|
||||
if (item.attachments?.isNotEmpty ?? false)
|
||||
AttachmentList(
|
||||
key: Key('m${item.uuid}attachments'),
|
||||
parentId: item.uuid,
|
||||
attachmentsId: item.attachments ?? List.empty(),
|
||||
).paddingSymmetric(vertical: 4),
|
||||
],
|
||||
);
|
||||
} else if (isReply) {
|
||||
widget = Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@ -149,6 +159,7 @@ class ChatMessage extends StatelessWidget {
|
||||
).paddingSymmetric(horizontal: 12),
|
||||
if (item.attachments?.isNotEmpty ?? false)
|
||||
AttachmentList(
|
||||
key: Key('m${item.uuid}attachments'),
|
||||
parentId: item.uuid,
|
||||
attachmentsId: item.attachments ?? List.empty(),
|
||||
).paddingSymmetric(vertical: 4),
|
||||
|
@ -75,7 +75,7 @@ class _ChatMessageInputState extends State<ChatMessageInput> {
|
||||
'uuid': const Uuid().v4(),
|
||||
'type': 'm.text',
|
||||
'content': encodeMessage(_textController.value.text),
|
||||
'attachments': _attachments,
|
||||
'attachments': List.from(_attachments),
|
||||
'reply_to': _replyTo?.id,
|
||||
};
|
||||
|
||||
@ -96,6 +96,7 @@ class _ChatMessageInputState extends State<ChatMessageInput> {
|
||||
updatedAt: DateTime.now(),
|
||||
content: payload['content'] as Map<String, dynamic>,
|
||||
type: payload['type'] as String,
|
||||
attachments: _attachments,
|
||||
sender: sender,
|
||||
replyId: _replyTo?.id,
|
||||
replyTo: _replyTo,
|
||||
|
Reference in New Issue
Block a user