@@ -17,6 +17,7 @@ class StreamMessageThemeData with Diagnosticable {
1717 this .messageLinksStyle,
1818 this .messageDeletedStyle,
1919 this .messageBackgroundColor,
20+ this .messageBackgroundGradient,
2021 this .messageBorderColor,
2122 this .reactionsBackgroundColor,
2223 this .reactionsBorderColor,
@@ -54,6 +55,11 @@ class StreamMessageThemeData with Diagnosticable {
5455 /// Color for messageBackgroundColor
5556 final Color ? messageBackgroundColor;
5657
58+ /// Gradient for message background.
59+ ///
60+ /// Note: If this is set, it will override [messageBackgroundColor] .
61+ final Gradient ? messageBackgroundGradient;
62+
5763 /// Color for message border color
5864 final Color ? messageBorderColor;
5965
@@ -96,6 +102,7 @@ class StreamMessageThemeData with Diagnosticable {
96102 TextStyle ? createdAtStyle,
97103 TextStyle ? repliesStyle,
98104 Color ? messageBackgroundColor,
105+ Gradient ? messageBackgroundGradient,
99106 Color ? messageBorderColor,
100107 StreamAvatarThemeData ? avatarTheme,
101108 Color ? reactionsBackgroundColor,
@@ -116,6 +123,8 @@ class StreamMessageThemeData with Diagnosticable {
116123 messageDeletedStyle: messageDeletedStyle ?? this .messageDeletedStyle,
117124 messageBackgroundColor:
118125 messageBackgroundColor ?? this .messageBackgroundColor,
126+ messageBackgroundGradient:
127+ messageBackgroundGradient ?? this .messageBackgroundGradient,
119128 messageBorderColor: messageBorderColor ?? this .messageBorderColor,
120129 avatarTheme: avatarTheme ?? this .avatarTheme,
121130 repliesStyle: repliesStyle ?? this .repliesStyle,
@@ -154,6 +163,8 @@ class StreamMessageThemeData with Diagnosticable {
154163 TextStyle .lerp (a.messageDeletedStyle, b.messageDeletedStyle, t),
155164 messageBackgroundColor:
156165 Color .lerp (a.messageBackgroundColor, b.messageBackgroundColor, t),
166+ messageBackgroundGradient:
167+ t < 0.5 ? a.messageBackgroundGradient : b.messageBackgroundGradient,
157168 messageBorderColor:
158169 Color .lerp (a.messageBorderColor, b.messageBorderColor, t),
159170 messageLinksStyle:
@@ -218,6 +229,7 @@ class StreamMessageThemeData with Diagnosticable {
218229 repliesStyle:
219230 repliesStyle? .merge (other.repliesStyle) ?? other.repliesStyle,
220231 messageBackgroundColor: other.messageBackgroundColor,
232+ messageBackgroundGradient: other.messageBackgroundGradient,
221233 messageBorderColor: other.messageBorderColor,
222234 avatarTheme: avatarTheme? .merge (other.avatarTheme) ?? other.avatarTheme,
223235 reactionsBackgroundColor: other.reactionsBackgroundColor,
@@ -244,6 +256,7 @@ class StreamMessageThemeData with Diagnosticable {
244256 messageDeletedStyle == other.messageDeletedStyle &&
245257 repliesStyle == other.repliesStyle &&
246258 messageBackgroundColor == other.messageBackgroundColor &&
259+ messageBackgroundGradient == other.messageBackgroundGradient &&
247260 messageBorderColor == other.messageBorderColor &&
248261 reactionsBackgroundColor == other.reactionsBackgroundColor &&
249262 reactionsBorderColor == other.reactionsBorderColor &&
@@ -265,6 +278,7 @@ class StreamMessageThemeData with Diagnosticable {
265278 messageDeletedStyle.hashCode ^
266279 repliesStyle.hashCode ^
267280 messageBackgroundColor.hashCode ^
281+ messageBackgroundGradient.hashCode ^
268282 messageBorderColor.hashCode ^
269283 reactionsBackgroundColor.hashCode ^
270284 reactionsBorderColor.hashCode ^
@@ -288,6 +302,8 @@ class StreamMessageThemeData with Diagnosticable {
288302 ..add (DiagnosticsProperty ('messageDeletedStyle' , messageDeletedStyle))
289303 ..add (DiagnosticsProperty ('repliesStyle' , repliesStyle))
290304 ..add (ColorProperty ('messageBackgroundColor' , messageBackgroundColor))
305+ ..add (DiagnosticsProperty (
306+ 'messageBackgroundGradient' , messageBackgroundGradient))
291307 ..add (ColorProperty ('messageBorderColor' , messageBorderColor))
292308 ..add (DiagnosticsProperty ('avatarTheme' , avatarTheme))
293309 ..add (ColorProperty ('reactionsBackgroundColor' , reactionsBackgroundColor))
0 commit comments