diff --git a/packages/stream_chat_flutter/example/lib/tutorial_part_6.dart b/packages/stream_chat_flutter/example/lib/tutorial_part_6.dart index 28f061ff..dca8eaa1 100644 --- a/packages/stream_chat_flutter/example/lib/tutorial_part_6.dart +++ b/packages/stream_chat_flutter/example/lib/tutorial_part_6.dart @@ -75,7 +75,7 @@ class MyApp extends StatelessWidget { ), ), ownMessageTheme: const StreamMessageThemeData( - urlLinkTitleMaxLine: 1, + urlAttachmentTitleMaxLine: 1, ), otherMessageTheme: StreamMessageThemeData( messageBackgroundColor: colorTheme.textHighEmphasis, @@ -85,7 +85,7 @@ class MyApp extends StatelessWidget { avatarTheme: StreamAvatarThemeData( borderRadius: BorderRadius.circular(8), ), - urlLinkTitleMaxLine: 1, + urlAttachmentTitleMaxLine: 1, ), ).merge(defaultTheme); diff --git a/packages/stream_chat_flutter/lib/src/attachment/url_attachment.dart b/packages/stream_chat_flutter/lib/src/attachment/url_attachment.dart index 11cf4914..10170bb1 100644 --- a/packages/stream_chat_flutter/lib/src/attachment/url_attachment.dart +++ b/packages/stream_chat_flutter/lib/src/attachment/url_attachment.dart @@ -107,7 +107,7 @@ class StreamUrlAttachment extends StatelessWidget { if (urlAttachment.title != null) Text( urlAttachment.title!.trim(), - maxLines: messageTheme.urlLinkTitleMaxLine ?? 1, + maxLines: messageTheme.urlAttachmentTitleMaxLine ?? 1, overflow: TextOverflow.ellipsis, style: chatThemeData.textTheme.body .copyWith(fontWeight: FontWeight.w700), diff --git a/packages/stream_chat_flutter/lib/src/theme/message_theme.dart b/packages/stream_chat_flutter/lib/src/theme/message_theme.dart index 999d2fe1..7f34800c 100644 --- a/packages/stream_chat_flutter/lib/src/theme/message_theme.dart +++ b/packages/stream_chat_flutter/lib/src/theme/message_theme.dart @@ -21,7 +21,7 @@ class StreamMessageThemeData with Diagnosticable { this.avatarTheme, this.createdAtStyle, this.linkBackgroundColor, - this.urlLinkTitleMaxLine, + this.urlAttachmentTitleMaxLine, }); /// Text style for message text @@ -61,7 +61,7 @@ class StreamMessageThemeData with Diagnosticable { final Color? linkBackgroundColor; /// Max number of lines in Url link title - final int? urlLinkTitleMaxLine; + final int? urlAttachmentTitleMaxLine; /// Copy with a theme StreamMessageThemeData copyWith({ @@ -94,7 +94,8 @@ class StreamMessageThemeData with Diagnosticable { reactionsBorderColor: reactionsBorderColor ?? this.reactionsBorderColor, reactionsMaskColor: reactionsMaskColor ?? this.reactionsMaskColor, linkBackgroundColor: linkBackgroundColor ?? this.linkBackgroundColor, - urlLinkTitleMaxLine: urlLinkTitleMaxLine ?? this.urlLinkTitleMaxLine, + urlAttachmentTitleMaxLine: + urlLinkTitleMaxLine ?? this.urlAttachmentTitleMaxLine, ); } @@ -154,7 +155,7 @@ class StreamMessageThemeData with Diagnosticable { reactionsBorderColor: other.reactionsBorderColor, reactionsMaskColor: other.reactionsMaskColor, linkBackgroundColor: other.linkBackgroundColor, - urlLinkTitleMaxLine: other.urlLinkTitleMaxLine, + urlLinkTitleMaxLine: other.urlAttachmentTitleMaxLine, ); } @@ -175,7 +176,7 @@ class StreamMessageThemeData with Diagnosticable { reactionsMaskColor == other.reactionsMaskColor && avatarTheme == other.avatarTheme && linkBackgroundColor == other.linkBackgroundColor && - urlLinkTitleMaxLine == other.urlLinkTitleMaxLine; + urlAttachmentTitleMaxLine == other.urlAttachmentTitleMaxLine; @override int get hashCode => @@ -191,7 +192,7 @@ class StreamMessageThemeData with Diagnosticable { reactionsMaskColor.hashCode ^ avatarTheme.hashCode ^ linkBackgroundColor.hashCode ^ - urlLinkTitleMaxLine.hashCode; + urlAttachmentTitleMaxLine.hashCode; @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { @@ -209,6 +210,9 @@ class StreamMessageThemeData with Diagnosticable { ..add(ColorProperty('reactionsBorderColor', reactionsBorderColor)) ..add(ColorProperty('reactionsMaskColor', reactionsMaskColor)) ..add(ColorProperty('linkBackgroundColor', linkBackgroundColor)) - ..add(DiagnosticsProperty('urlLinkTitleMaxLine', urlLinkTitleMaxLine)); + ..add(DiagnosticsProperty( + 'urlAttachmentTitleMaxLine', + urlAttachmentTitleMaxLine, + )); } }