From 7dea0bdacd50fcbb326c5183282d89fab3c284db Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 21 Jul 2020 10:35:27 +0200 Subject: [PATCH] add link TextStyle for messages --- lib/src/message_text.dart | 1 + lib/src/stream_chat.dart | 4 ++-- lib/src/stream_chat_theme.dart | 17 ++++++++++------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/src/message_text.dart b/lib/src/message_text.dart index f35b8549..6ca99f6c 100644 --- a/lib/src/message_text.dart +++ b/lib/src/message_text.dart @@ -49,6 +49,7 @@ class MessageText extends StatelessWidget { ), ), ).copyWith( + a: messageTheme.messageLinks, p: messageTheme.messageText, ), ); diff --git a/lib/src/stream_chat.dart b/lib/src/stream_chat.dart index 92394ff0..97d504e5 100644 --- a/lib/src/stream_chat.dart +++ b/lib/src/stream_chat.dart @@ -124,7 +124,7 @@ class StreamChatState extends State with WidgetsBindingObserver { messageBackgroundColor: themeData?.ownMessageTheme?.messageBackgroundColor, messageAuthor: themeData?.ownMessageTheme?.messageAuthor, - messageMention: themeData?.ownMessageTheme?.messageMention, + messageMention: themeData?.ownMessageTheme?.messageLinks, avatarTheme: defaultTheme.ownMessageTheme.avatarTheme.copyWith( constraints: themeData?.ownMessageTheme?.avatarTheme?.constraints, borderRadius: themeData?.ownMessageTheme?.avatarTheme?.borderRadius, @@ -137,7 +137,7 @@ class StreamChatState extends State with WidgetsBindingObserver { messageBackgroundColor: themeData?.otherMessageTheme?.messageBackgroundColor, messageAuthor: themeData?.otherMessageTheme?.messageAuthor, - messageMention: themeData?.otherMessageTheme?.messageMention, + messageMention: themeData?.otherMessageTheme?.messageLinks, avatarTheme: defaultTheme.otherMessageTheme.avatarTheme.copyWith( constraints: themeData?.otherMessageTheme?.avatarTheme?.constraints, borderRadius: themeData?.otherMessageTheme?.avatarTheme?.borderRadius, diff --git a/lib/src/stream_chat_theme.dart b/lib/src/stream_chat_theme.dart index e75d30c3..2f8dc55e 100644 --- a/lib/src/stream_chat_theme.dart +++ b/lib/src/stream_chat_theme.dart @@ -168,8 +168,8 @@ class StreamChatThemeData { this.ownMessageTheme.messageText, messageAuthor: ownMessageTheme?.messageAuthor ?? this.ownMessageTheme.messageAuthor, - messageMention: ownMessageTheme?.messageMention ?? - this.ownMessageTheme.messageMention, + messageMention: ownMessageTheme?.messageLinks ?? + this.ownMessageTheme.messageLinks, createdAt: ownMessageTheme?.createdAt ?? this.ownMessageTheme.createdAt, replies: ownMessageTheme?.replies ?? this.ownMessageTheme.replies, @@ -184,8 +184,8 @@ class StreamChatThemeData { this.otherMessageTheme.messageText, messageAuthor: otherMessageTheme?.messageAuthor ?? this.otherMessageTheme.messageAuthor, - messageMention: otherMessageTheme?.messageMention ?? - this.otherMessageTheme.messageMention, + messageMention: otherMessageTheme?.messageLinks ?? + this.otherMessageTheme.messageLinks, createdAt: otherMessageTheme?.createdAt ?? this.otherMessageTheme.createdAt, replies: @@ -295,6 +295,9 @@ class StreamChatThemeData { width: 32, ), ), + messageLinks: TextStyle( + color: accentColor, + ), ), otherMessageTheme: MessageTheme( messageText: TextStyle( @@ -399,7 +402,7 @@ class AvatarTheme { class MessageTheme { final TextStyle messageText; final TextStyle messageAuthor; - final TextStyle messageMention; + final TextStyle messageLinks; final TextStyle createdAt; final TextStyle replies; final Color messageBackgroundColor; @@ -409,7 +412,7 @@ class MessageTheme { this.replies, this.messageText, this.messageAuthor, - this.messageMention, + this.messageLinks, this.messageBackgroundColor, this.avatarTheme, this.createdAt, @@ -428,7 +431,7 @@ class MessageTheme { MessageTheme( messageText: messageText ?? this.messageText, messageAuthor: messageAuthor ?? this.messageAuthor, - messageMention: messageMention ?? this.messageMention, + messageLinks: messageMention ?? this.messageLinks, createdAt: createdAt ?? this.createdAt, messageBackgroundColor: messageBackgroundColor ?? this.messageBackgroundColor,