implemented enlarged emoji rendering for chat messages containing up to three emojis
This commit is contained in:
@@ -5,6 +5,7 @@ import '../../../../api/marianumcloud/talk/chat/get_chat_response.dart';
|
||||
import '../../../../api/marianumcloud/talk/chat/rich_object_string_processor.dart';
|
||||
import '../../../../model/account_data.dart';
|
||||
import '../../../../model/endpoint_data.dart';
|
||||
import '../../../../utils/emoji_detection.dart';
|
||||
import '../../../../utils/url_opener.dart';
|
||||
import '../widgets/highlighted_linkify.dart';
|
||||
|
||||
@@ -28,13 +29,29 @@ class ChatMessage {
|
||||
}
|
||||
|
||||
Widget getWidget({String? highlightQuery, TextStyle? style}) {
|
||||
var contentWidget = HighlightedLinkify(
|
||||
final emojiFontSize = standaloneEmojiFontSize(content);
|
||||
final effectiveStyle = emojiFontSize == null
|
||||
? style
|
||||
: (style ?? const TextStyle()).copyWith(
|
||||
fontSize: emojiFontSize,
|
||||
height: 1.15,
|
||||
);
|
||||
|
||||
Widget contentWidget = HighlightedLinkify(
|
||||
text: content,
|
||||
onOpen: UrlOpener.onOpen,
|
||||
highlight: highlightQuery,
|
||||
style: style,
|
||||
style: effectiveStyle,
|
||||
);
|
||||
|
||||
// Enlarged emoji glyphs otherwise sit flush against the bubble edges.
|
||||
if (emojiFontSize != null) {
|
||||
contentWidget = Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6),
|
||||
child: contentWidget,
|
||||
);
|
||||
}
|
||||
|
||||
if (originalData?['object']?.type == RichObjectStringObjectType.talkPoll) {
|
||||
return ListTile(
|
||||
leading: const Icon(Icons.poll_outlined),
|
||||
|
||||
Reference in New Issue
Block a user