diff --git a/CHANGELOG.md b/CHANGELOG.md index eb83c19a..0db3a916 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.2 + +- Add `messageLinks` property to `MessageTheme` to customize links color + ## 0.2.1+2 - Update llc dependency 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..ad6ba47c 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, + messageLinks: 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, + messageLinks: 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 23dfa90a..57aeec53 100644 --- a/lib/src/stream_chat_theme.dart +++ b/lib/src/stream_chat_theme.dart @@ -97,19 +97,25 @@ class StreamChatThemeData { primaryColor: theme.colorScheme.primary, secondaryColor: theme.colorScheme.secondary, backgroundColor: theme.scaffoldBackgroundColor, - channelTheme: ChannelTheme( + channelTheme: defaultTheme.channelTheme.copyWith( inputGradient: LinearGradient(colors: [ theme.accentColor.withOpacity(.5), theme.accentColor, ]), ), - ownMessageTheme: MessageTheme( + ownMessageTheme: defaultTheme.ownMessageTheme.copyWith( replies: defaultTheme.ownMessageTheme.replies.copyWith( color: theme.accentColor, ), + messageLinks: TextStyle( + color: theme.accentColor, + ), ), - otherMessageTheme: MessageTheme( - replies: defaultTheme.ownMessageTheme.replies.copyWith( + otherMessageTheme: defaultTheme.otherMessageTheme.copyWith( + replies: defaultTheme.otherMessageTheme.replies.copyWith( + color: theme.accentColor, + ), + messageLinks: TextStyle( color: theme.accentColor, ), ), @@ -168,8 +174,8 @@ class StreamChatThemeData { this.ownMessageTheme.messageText, messageAuthor: ownMessageTheme?.messageAuthor ?? this.ownMessageTheme.messageAuthor, - messageMention: ownMessageTheme?.messageMention ?? - this.ownMessageTheme.messageMention, + messageLinks: ownMessageTheme?.messageLinks ?? + this.ownMessageTheme.messageLinks, createdAt: ownMessageTheme?.createdAt ?? this.ownMessageTheme.createdAt, replies: ownMessageTheme?.replies ?? this.ownMessageTheme.replies, @@ -184,8 +190,8 @@ class StreamChatThemeData { this.otherMessageTheme.messageText, messageAuthor: otherMessageTheme?.messageAuthor ?? this.otherMessageTheme.messageAuthor, - messageMention: otherMessageTheme?.messageMention ?? - this.otherMessageTheme.messageMention, + messageLinks: otherMessageTheme?.messageLinks ?? + this.otherMessageTheme.messageLinks, createdAt: otherMessageTheme?.createdAt ?? this.otherMessageTheme.createdAt, replies: @@ -295,6 +301,9 @@ class StreamChatThemeData { width: 32, ), ), + messageLinks: TextStyle( + color: accentColor, + ), ), otherMessageTheme: MessageTheme( messageText: TextStyle( @@ -312,6 +321,9 @@ class StreamChatThemeData { fontWeight: FontWeight.bold, fontSize: 12, ), + messageLinks: TextStyle( + color: accentColor, + ), messageBackgroundColor: isDark ? Colors.black : Colors.white, avatarTheme: AvatarTheme( borderRadius: BorderRadius.circular(20), @@ -399,7 +411,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 +421,7 @@ class MessageTheme { this.replies, this.messageText, this.messageAuthor, - this.messageMention, + this.messageLinks, this.messageBackgroundColor, this.avatarTheme, this.createdAt, @@ -418,7 +430,7 @@ class MessageTheme { MessageTheme copyWith({ TextStyle messageText, TextStyle messageAuthor, - TextStyle messageMention, + TextStyle messageLinks, TextStyle createdAt, TextStyle replies, Color messageBackgroundColor, @@ -428,7 +440,7 @@ class MessageTheme { MessageTheme( messageText: messageText ?? this.messageText, messageAuthor: messageAuthor ?? this.messageAuthor, - messageMention: messageMention ?? this.messageMention, + messageLinks: messageLinks ?? this.messageLinks, createdAt: createdAt ?? this.createdAt, messageBackgroundColor: messageBackgroundColor ?? this.messageBackgroundColor, diff --git a/lib/src/video_attachment.dart b/lib/src/video_attachment.dart index a903147b..b0d1f60d 100644 --- a/lib/src/video_attachment.dart +++ b/lib/src/video_attachment.dart @@ -123,6 +123,7 @@ class _VideoAttachmentState extends State { ), if (widget.attachment.title != null) Material( + color: widget.messageTheme.messageBackgroundColor, child: AttachmentTitle( messageTheme: widget.messageTheme, attachment: widget.attachment, diff --git a/pubspec.yaml b/pubspec.yaml index bb45e910..b221a83b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: stream_chat_flutter homepage: https://github.com/GetStream/stream-chat-flutter description: Stream Chat official Flutter SDK. Build your own chat experience using Dart and Flutter. -version: 0.2.1+2 +version: 0.2.2 repository: https://github.com/GetStream/stream-chat-flutter issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues