chore(llc): rename theme property

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2023-02-09 15:47:36 +05:30
committed by xsahil03x
parent c09d0fc20e
commit 6e9202fe61
3 changed files with 14 additions and 10 deletions
@@ -75,7 +75,7 @@ class MyApp extends StatelessWidget {
), ),
), ),
ownMessageTheme: const StreamMessageThemeData( ownMessageTheme: const StreamMessageThemeData(
urlLinkTitleMaxLine: 1, urlAttachmentTitleMaxLine: 1,
), ),
otherMessageTheme: StreamMessageThemeData( otherMessageTheme: StreamMessageThemeData(
messageBackgroundColor: colorTheme.textHighEmphasis, messageBackgroundColor: colorTheme.textHighEmphasis,
@@ -85,7 +85,7 @@ class MyApp extends StatelessWidget {
avatarTheme: StreamAvatarThemeData( avatarTheme: StreamAvatarThemeData(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
urlLinkTitleMaxLine: 1, urlAttachmentTitleMaxLine: 1,
), ),
).merge(defaultTheme); ).merge(defaultTheme);
@@ -107,7 +107,7 @@ class StreamUrlAttachment extends StatelessWidget {
if (urlAttachment.title != null) if (urlAttachment.title != null)
Text( Text(
urlAttachment.title!.trim(), urlAttachment.title!.trim(),
maxLines: messageTheme.urlLinkTitleMaxLine ?? 1, maxLines: messageTheme.urlAttachmentTitleMaxLine ?? 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: chatThemeData.textTheme.body style: chatThemeData.textTheme.body
.copyWith(fontWeight: FontWeight.w700), .copyWith(fontWeight: FontWeight.w700),
@@ -21,7 +21,7 @@ class StreamMessageThemeData with Diagnosticable {
this.avatarTheme, this.avatarTheme,
this.createdAtStyle, this.createdAtStyle,
this.linkBackgroundColor, this.linkBackgroundColor,
this.urlLinkTitleMaxLine, this.urlAttachmentTitleMaxLine,
}); });
/// Text style for message text /// Text style for message text
@@ -61,7 +61,7 @@ class StreamMessageThemeData with Diagnosticable {
final Color? linkBackgroundColor; final Color? linkBackgroundColor;
/// Max number of lines in Url link title /// Max number of lines in Url link title
final int? urlLinkTitleMaxLine; final int? urlAttachmentTitleMaxLine;
/// Copy with a theme /// Copy with a theme
StreamMessageThemeData copyWith({ StreamMessageThemeData copyWith({
@@ -94,7 +94,8 @@ class StreamMessageThemeData with Diagnosticable {
reactionsBorderColor: reactionsBorderColor ?? this.reactionsBorderColor, reactionsBorderColor: reactionsBorderColor ?? this.reactionsBorderColor,
reactionsMaskColor: reactionsMaskColor ?? this.reactionsMaskColor, reactionsMaskColor: reactionsMaskColor ?? this.reactionsMaskColor,
linkBackgroundColor: linkBackgroundColor ?? this.linkBackgroundColor, linkBackgroundColor: linkBackgroundColor ?? this.linkBackgroundColor,
urlLinkTitleMaxLine: urlLinkTitleMaxLine ?? this.urlLinkTitleMaxLine, urlAttachmentTitleMaxLine:
urlLinkTitleMaxLine ?? this.urlAttachmentTitleMaxLine,
); );
} }
@@ -154,7 +155,7 @@ class StreamMessageThemeData with Diagnosticable {
reactionsBorderColor: other.reactionsBorderColor, reactionsBorderColor: other.reactionsBorderColor,
reactionsMaskColor: other.reactionsMaskColor, reactionsMaskColor: other.reactionsMaskColor,
linkBackgroundColor: other.linkBackgroundColor, linkBackgroundColor: other.linkBackgroundColor,
urlLinkTitleMaxLine: other.urlLinkTitleMaxLine, urlLinkTitleMaxLine: other.urlAttachmentTitleMaxLine,
); );
} }
@@ -175,7 +176,7 @@ class StreamMessageThemeData with Diagnosticable {
reactionsMaskColor == other.reactionsMaskColor && reactionsMaskColor == other.reactionsMaskColor &&
avatarTheme == other.avatarTheme && avatarTheme == other.avatarTheme &&
linkBackgroundColor == other.linkBackgroundColor && linkBackgroundColor == other.linkBackgroundColor &&
urlLinkTitleMaxLine == other.urlLinkTitleMaxLine; urlAttachmentTitleMaxLine == other.urlAttachmentTitleMaxLine;
@override @override
int get hashCode => int get hashCode =>
@@ -191,7 +192,7 @@ class StreamMessageThemeData with Diagnosticable {
reactionsMaskColor.hashCode ^ reactionsMaskColor.hashCode ^
avatarTheme.hashCode ^ avatarTheme.hashCode ^
linkBackgroundColor.hashCode ^ linkBackgroundColor.hashCode ^
urlLinkTitleMaxLine.hashCode; urlAttachmentTitleMaxLine.hashCode;
@override @override
void debugFillProperties(DiagnosticPropertiesBuilder properties) { void debugFillProperties(DiagnosticPropertiesBuilder properties) {
@@ -209,6 +210,9 @@ class StreamMessageThemeData with Diagnosticable {
..add(ColorProperty('reactionsBorderColor', reactionsBorderColor)) ..add(ColorProperty('reactionsBorderColor', reactionsBorderColor))
..add(ColorProperty('reactionsMaskColor', reactionsMaskColor)) ..add(ColorProperty('reactionsMaskColor', reactionsMaskColor))
..add(ColorProperty('linkBackgroundColor', linkBackgroundColor)) ..add(ColorProperty('linkBackgroundColor', linkBackgroundColor))
..add(DiagnosticsProperty('urlLinkTitleMaxLine', urlLinkTitleMaxLine)); ..add(DiagnosticsProperty(
'urlAttachmentTitleMaxLine',
urlAttachmentTitleMaxLine,
));
} }
} }