@@ -17,6 +17,7 @@ class StreamMessageThemeData with Diagnosticable {
17
17
this .messageLinksStyle,
18
18
this .messageDeletedStyle,
19
19
this .messageBackgroundColor,
20
+ this .messageBackgroundGradient,
20
21
this .messageBorderColor,
21
22
this .reactionsBackgroundColor,
22
23
this .reactionsBorderColor,
@@ -54,6 +55,11 @@ class StreamMessageThemeData with Diagnosticable {
54
55
/// Color for messageBackgroundColor
55
56
final Color ? messageBackgroundColor;
56
57
58
+ /// Gradient for message background.
59
+ ///
60
+ /// Note: If this is set, it will override [messageBackgroundColor] .
61
+ final Gradient ? messageBackgroundGradient;
62
+
57
63
/// Color for message border color
58
64
final Color ? messageBorderColor;
59
65
@@ -96,6 +102,7 @@ class StreamMessageThemeData with Diagnosticable {
96
102
TextStyle ? createdAtStyle,
97
103
TextStyle ? repliesStyle,
98
104
Color ? messageBackgroundColor,
105
+ Gradient ? messageBackgroundGradient,
99
106
Color ? messageBorderColor,
100
107
StreamAvatarThemeData ? avatarTheme,
101
108
Color ? reactionsBackgroundColor,
@@ -116,6 +123,8 @@ class StreamMessageThemeData with Diagnosticable {
116
123
messageDeletedStyle: messageDeletedStyle ?? this .messageDeletedStyle,
117
124
messageBackgroundColor:
118
125
messageBackgroundColor ?? this .messageBackgroundColor,
126
+ messageBackgroundGradient:
127
+ messageBackgroundGradient ?? this .messageBackgroundGradient,
119
128
messageBorderColor: messageBorderColor ?? this .messageBorderColor,
120
129
avatarTheme: avatarTheme ?? this .avatarTheme,
121
130
repliesStyle: repliesStyle ?? this .repliesStyle,
@@ -154,6 +163,8 @@ class StreamMessageThemeData with Diagnosticable {
154
163
TextStyle .lerp (a.messageDeletedStyle, b.messageDeletedStyle, t),
155
164
messageBackgroundColor:
156
165
Color .lerp (a.messageBackgroundColor, b.messageBackgroundColor, t),
166
+ messageBackgroundGradient:
167
+ t < 0.5 ? a.messageBackgroundGradient : b.messageBackgroundGradient,
157
168
messageBorderColor:
158
169
Color .lerp (a.messageBorderColor, b.messageBorderColor, t),
159
170
messageLinksStyle:
@@ -218,6 +229,7 @@ class StreamMessageThemeData with Diagnosticable {
218
229
repliesStyle:
219
230
repliesStyle? .merge (other.repliesStyle) ?? other.repliesStyle,
220
231
messageBackgroundColor: other.messageBackgroundColor,
232
+ messageBackgroundGradient: other.messageBackgroundGradient,
221
233
messageBorderColor: other.messageBorderColor,
222
234
avatarTheme: avatarTheme? .merge (other.avatarTheme) ?? other.avatarTheme,
223
235
reactionsBackgroundColor: other.reactionsBackgroundColor,
@@ -244,6 +256,7 @@ class StreamMessageThemeData with Diagnosticable {
244
256
messageDeletedStyle == other.messageDeletedStyle &&
245
257
repliesStyle == other.repliesStyle &&
246
258
messageBackgroundColor == other.messageBackgroundColor &&
259
+ messageBackgroundGradient == other.messageBackgroundGradient &&
247
260
messageBorderColor == other.messageBorderColor &&
248
261
reactionsBackgroundColor == other.reactionsBackgroundColor &&
249
262
reactionsBorderColor == other.reactionsBorderColor &&
@@ -265,6 +278,7 @@ class StreamMessageThemeData with Diagnosticable {
265
278
messageDeletedStyle.hashCode ^
266
279
repliesStyle.hashCode ^
267
280
messageBackgroundColor.hashCode ^
281
+ messageBackgroundGradient.hashCode ^
268
282
messageBorderColor.hashCode ^
269
283
reactionsBackgroundColor.hashCode ^
270
284
reactionsBorderColor.hashCode ^
@@ -288,6 +302,8 @@ class StreamMessageThemeData with Diagnosticable {
288
302
..add (DiagnosticsProperty ('messageDeletedStyle' , messageDeletedStyle))
289
303
..add (DiagnosticsProperty ('repliesStyle' , repliesStyle))
290
304
..add (ColorProperty ('messageBackgroundColor' , messageBackgroundColor))
305
+ ..add (DiagnosticsProperty (
306
+ 'messageBackgroundGradient' , messageBackgroundGradient))
291
307
..add (ColorProperty ('messageBorderColor' , messageBorderColor))
292
308
..add (DiagnosticsProperty ('avatarTheme' , avatarTheme))
293
309
..add (ColorProperty ('reactionsBackgroundColor' , reactionsBackgroundColor))
0 commit comments