use a widget for edited
This commit is contained in:
parent
396a0f4c4f
commit
a1c7349b3b
2 changed files with 17 additions and 9 deletions
|
|
@ -142,8 +142,6 @@ class Html extends ConsumerWidget {
|
||||||
|
|
||||||
"data-mx-bg-color" => MapEntry("background-color", value),
|
"data-mx-bg-color" => MapEntry("background-color", value),
|
||||||
|
|
||||||
"edited" => MapEntry("display", "block"),
|
|
||||||
|
|
||||||
_ => null,
|
_ => null,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -244,7 +244,11 @@ class RoomChat extends HookConsumerWidget {
|
||||||
required bool isSentByMe,
|
required bool isSentByMe,
|
||||||
MessageGroupStatus? groupStatus,
|
MessageGroupStatus? groupStatus,
|
||||||
}) => FlyerChatTextMessage(
|
}) => FlyerChatTextMessage(
|
||||||
customWidget: Html(
|
customWidget: Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Html(
|
||||||
(message.metadata?["formatted"]
|
(message.metadata?["formatted"]
|
||||||
as String)
|
as String)
|
||||||
.replaceAllMapped(
|
.replaceAllMapped(
|
||||||
|
|
@ -264,12 +268,18 @@ class RoomChat extends HookConsumerWidget {
|
||||||
return "<a href=\"$url\">$url</a>";
|
return "<a href=\"$url\">$url</a>";
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.replaceAll("\n", "<br/>") +
|
.replaceAll("\n", "<br/>"),
|
||||||
((message.editedAt != null)
|
|
||||||
? "<sub edited>(edited)</sub>"
|
|
||||||
: ""),
|
|
||||||
client: room.roomData.client,
|
client: room.roomData.client,
|
||||||
),
|
),
|
||||||
|
if (message.editedAt != null)
|
||||||
|
Text(
|
||||||
|
"(edited)",
|
||||||
|
style: theme
|
||||||
|
.textTheme
|
||||||
|
.labelSmall,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
topWidget: TopWidget(
|
topWidget: TopWidget(
|
||||||
message,
|
message,
|
||||||
headers:
|
headers:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue