Skip to content

Commit fd8699c

Browse files
authored
feat(ui): add appBarForegroundColor to poll dialogs (#2490)
1 parent 3f9de31 commit fd8699c

12 files changed

+72
-0
lines changed

packages/stream_chat_flutter/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Fixed `StreamChannelAvatar` crashing with `RangeError` when user/channel name is empty.
66
- Fixed audio tone bleeding into recorded voice message when playing custom feedback sound on recording start.
7+
- Fixed poll dialog AppBar back button color not being themeable. [[#2484]](https://github.com/GetStream/stream-chat-flutter/issues/2484)
78

89
## 9.22.0
910

packages/stream_chat_flutter/lib/src/poll/creator/stream_poll_creator_dialog.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ class _StreamPollCreatorFullScreenDialogState
228228
appBar: AppBar(
229229
elevation: theme.appBarElevation,
230230
backgroundColor: theme.appBarBackgroundColor,
231+
foregroundColor: theme.appBarForegroundColor,
231232
title: Text(
232233
context.translations.createPollLabel(),
233234
style: theme.appBarTitleStyle,

packages/stream_chat_flutter/lib/src/poll/stream_poll_comments_dialog.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ class _StreamPollCommentsDialogState extends State<StreamPollCommentsDialog> {
122122
appBar: AppBar(
123123
elevation: theme.appBarElevation,
124124
backgroundColor: theme.appBarBackgroundColor,
125+
foregroundColor: theme.appBarForegroundColor,
125126
title: Text(
126127
context.translations.pollCommentsLabel,
127128
style: theme.appBarTitleTextStyle,

packages/stream_chat_flutter/lib/src/poll/stream_poll_option_votes_dialog.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ class _StreamPollOptionVotesDialogState
115115
appBar: AppBar(
116116
elevation: theme.appBarElevation,
117117
backgroundColor: theme.appBarBackgroundColor,
118+
foregroundColor: theme.appBarForegroundColor,
118119
title: Text(
119120
widget.option.text,
120121
maxLines: 2,

packages/stream_chat_flutter/lib/src/poll/stream_poll_options_dialog.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ class StreamPollOptionsDialog extends StatelessWidget {
8585
appBar: AppBar(
8686
elevation: theme.appBarElevation,
8787
backgroundColor: theme.appBarBackgroundColor,
88+
foregroundColor: theme.appBarForegroundColor,
8889
title: Text(
8990
context.translations.pollOptionsLabel,
9091
style: theme.appBarTitleTextStyle,

packages/stream_chat_flutter/lib/src/poll/stream_poll_results_dialog.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ class StreamPollResultsDialog extends StatelessWidget {
9696
appBar: AppBar(
9797
elevation: theme.appBarElevation,
9898
backgroundColor: theme.appBarBackgroundColor,
99+
foregroundColor: theme.appBarForegroundColor,
99100
title: Text(
100101
context.translations.pollResultsLabel,
101102
style: theme.appBarTitleTextStyle,

packages/stream_chat_flutter/lib/src/theme/poll_comments_dialog_theme.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class StreamPollCommentsDialogThemeData with Diagnosticable {
5656
this.backgroundColor,
5757
this.appBarElevation,
5858
this.appBarBackgroundColor,
59+
this.appBarForegroundColor,
5960
this.appBarTitleTextStyle,
6061
this.pollCommentItemBackgroundColor,
6162
this.pollCommentItemBorderRadius,
@@ -71,6 +72,9 @@ class StreamPollCommentsDialogThemeData with Diagnosticable {
7172
/// The background color of the app bar.
7273
final Color? appBarBackgroundColor;
7374

75+
/// The foreground color of the app bar (icon and text color).
76+
final Color? appBarForegroundColor;
77+
7478
/// The text style of the app bar title.
7579
final TextStyle? appBarTitleTextStyle;
7680

@@ -88,6 +92,7 @@ class StreamPollCommentsDialogThemeData with Diagnosticable {
8892
Color? backgroundColor,
8993
double? appBarElevation,
9094
Color? appBarBackgroundColor,
95+
Color? appBarForegroundColor,
9196
TextStyle? appBarTitleTextStyle,
9297
Color? pollCommentItemBackgroundColor,
9398
BorderRadius? pollCommentItemBorderRadius,
@@ -98,6 +103,8 @@ class StreamPollCommentsDialogThemeData with Diagnosticable {
98103
appBarElevation: appBarElevation ?? this.appBarElevation,
99104
appBarBackgroundColor:
100105
appBarBackgroundColor ?? this.appBarBackgroundColor,
106+
appBarForegroundColor:
107+
appBarForegroundColor ?? this.appBarForegroundColor,
101108
appBarTitleTextStyle: appBarTitleTextStyle ?? this.appBarTitleTextStyle,
102109
pollCommentItemBackgroundColor: pollCommentItemBackgroundColor ??
103110
this.pollCommentItemBackgroundColor,
@@ -116,6 +123,7 @@ class StreamPollCommentsDialogThemeData with Diagnosticable {
116123
backgroundColor: other.backgroundColor,
117124
appBarElevation: other.appBarElevation,
118125
appBarBackgroundColor: other.appBarBackgroundColor,
126+
appBarForegroundColor: other.appBarForegroundColor,
119127
appBarTitleTextStyle: other.appBarTitleTextStyle,
120128
pollCommentItemBackgroundColor: other.pollCommentItemBackgroundColor,
121129
pollCommentItemBorderRadius: other.pollCommentItemBorderRadius,
@@ -134,6 +142,8 @@ class StreamPollCommentsDialogThemeData with Diagnosticable {
134142
appBarElevation: lerpDouble(a?.appBarElevation, b?.appBarElevation, t),
135143
appBarBackgroundColor:
136144
Color.lerp(a?.appBarBackgroundColor, b?.appBarBackgroundColor, t),
145+
appBarForegroundColor:
146+
Color.lerp(a?.appBarForegroundColor, b?.appBarForegroundColor, t),
137147
appBarTitleTextStyle:
138148
TextStyle.lerp(a?.appBarTitleTextStyle, b?.appBarTitleTextStyle, t),
139149
pollCommentItemBackgroundColor: Color.lerp(
@@ -161,6 +171,7 @@ class StreamPollCommentsDialogThemeData with Diagnosticable {
161171
other.backgroundColor == backgroundColor &&
162172
other.appBarElevation == appBarElevation &&
163173
other.appBarBackgroundColor == appBarBackgroundColor &&
174+
other.appBarForegroundColor == appBarForegroundColor &&
164175
other.appBarTitleTextStyle == appBarTitleTextStyle &&
165176
other.pollCommentItemBackgroundColor ==
166177
pollCommentItemBackgroundColor &&
@@ -172,6 +183,7 @@ class StreamPollCommentsDialogThemeData with Diagnosticable {
172183
backgroundColor.hashCode ^
173184
appBarElevation.hashCode ^
174185
appBarBackgroundColor.hashCode ^
186+
appBarForegroundColor.hashCode ^
175187
appBarTitleTextStyle.hashCode ^
176188
pollCommentItemBackgroundColor.hashCode ^
177189
pollCommentItemBorderRadius.hashCode ^

packages/stream_chat_flutter/lib/src/theme/poll_creator_theme.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class StreamPollCreatorThemeData with Diagnosticable {
6262
this.appBarTitleStyle,
6363
this.appBarElevation,
6464
this.appBarBackgroundColor,
65+
this.appBarForegroundColor,
6566
this.questionTextFieldFillColor,
6667
this.questionHeaderStyle,
6768
this.questionTextFieldStyle,
@@ -92,6 +93,9 @@ class StreamPollCreatorThemeData with Diagnosticable {
9293
/// The background color of the appBar.
9394
final Color? appBarBackgroundColor;
9495

96+
/// The foreground color of the appBar (icon and text color).
97+
final Color? appBarForegroundColor;
98+
9599
/// The fill color of the question text field.
96100
final Color? questionTextFieldFillColor;
97101

@@ -147,6 +151,7 @@ class StreamPollCreatorThemeData with Diagnosticable {
147151
TextStyle? appBarTitleStyle,
148152
double? appBarElevation,
149153
Color? appBarBackgroundColor,
154+
Color? appBarForegroundColor,
150155
Color? questionTextFieldFillColor,
151156
TextStyle? questionHeaderStyle,
152157
TextStyle? questionTextFieldStyle,
@@ -170,6 +175,8 @@ class StreamPollCreatorThemeData with Diagnosticable {
170175
appBarElevation: appBarElevation ?? this.appBarElevation,
171176
appBarBackgroundColor:
172177
appBarBackgroundColor ?? this.appBarBackgroundColor,
178+
appBarForegroundColor:
179+
appBarForegroundColor ?? this.appBarForegroundColor,
173180
questionTextFieldFillColor:
174181
questionTextFieldFillColor ?? this.questionTextFieldFillColor,
175182
questionHeaderStyle: questionHeaderStyle ?? this.questionHeaderStyle,
@@ -212,6 +219,8 @@ class StreamPollCreatorThemeData with Diagnosticable {
212219
appBarElevation: other.appBarElevation ?? appBarElevation,
213220
appBarBackgroundColor:
214221
other.appBarBackgroundColor ?? appBarBackgroundColor,
222+
appBarForegroundColor:
223+
other.appBarForegroundColor ?? appBarForegroundColor,
215224
questionTextFieldFillColor:
216225
other.questionTextFieldFillColor ?? questionTextFieldFillColor,
217226
questionHeaderStyle: other.questionHeaderStyle ?? questionHeaderStyle,
@@ -258,6 +267,8 @@ class StreamPollCreatorThemeData with Diagnosticable {
258267
appBarElevation: lerpDouble(a.appBarElevation, b.appBarElevation, t),
259268
appBarBackgroundColor:
260269
Color.lerp(a.appBarBackgroundColor, b.appBarBackgroundColor, t),
270+
appBarForegroundColor:
271+
Color.lerp(a.appBarForegroundColor, b.appBarForegroundColor, t),
261272
questionTextFieldFillColor: Color.lerp(
262273
a.questionTextFieldFillColor, b.questionTextFieldFillColor, t),
263274
questionHeaderStyle:
@@ -301,6 +312,7 @@ class StreamPollCreatorThemeData with Diagnosticable {
301312
other.appBarTitleStyle == appBarTitleStyle &&
302313
other.appBarElevation == appBarElevation &&
303314
other.appBarBackgroundColor == appBarBackgroundColor &&
315+
other.appBarForegroundColor == appBarForegroundColor &&
304316
other.questionTextFieldFillColor == questionTextFieldFillColor &&
305317
other.questionHeaderStyle == questionHeaderStyle &&
306318
other.questionTextFieldStyle == questionTextFieldStyle &&
@@ -325,6 +337,7 @@ class StreamPollCreatorThemeData with Diagnosticable {
325337
appBarTitleStyle.hashCode ^
326338
appBarElevation.hashCode ^
327339
appBarBackgroundColor.hashCode ^
340+
appBarForegroundColor.hashCode ^
328341
questionTextFieldFillColor.hashCode ^
329342
questionHeaderStyle.hashCode ^
330343
questionTextFieldStyle.hashCode ^

packages/stream_chat_flutter/lib/src/theme/poll_option_votes_dialog_theme.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class StreamPollOptionVotesDialogThemeData with Diagnosticable {
5757
this.backgroundColor,
5858
this.appBarElevation,
5959
this.appBarBackgroundColor,
60+
this.appBarForegroundColor,
6061
this.appBarTitleTextStyle,
6162
this.pollOptionVoteCountTextStyle,
6263
this.pollOptionWinnerVoteCountTextStyle,
@@ -73,6 +74,9 @@ class StreamPollOptionVotesDialogThemeData with Diagnosticable {
7374
/// The background color of the app bar.
7475
final Color? appBarBackgroundColor;
7576

77+
/// The foreground color of the app bar (icon and text color).
78+
final Color? appBarForegroundColor;
79+
7680
/// The text style of the app bar title.
7781
final TextStyle? appBarTitleTextStyle;
7882

@@ -93,6 +97,7 @@ class StreamPollOptionVotesDialogThemeData with Diagnosticable {
9397
Color? backgroundColor,
9498
double? appBarElevation,
9599
Color? appBarBackgroundColor,
100+
Color? appBarForegroundColor,
96101
TextStyle? appBarTitleTextStyle,
97102
TextStyle? pollOptionVoteCountTextStyle,
98103
TextStyle? pollOptionWinnerVoteCountTextStyle,
@@ -104,6 +109,8 @@ class StreamPollOptionVotesDialogThemeData with Diagnosticable {
104109
appBarElevation: appBarElevation ?? this.appBarElevation,
105110
appBarBackgroundColor:
106111
appBarBackgroundColor ?? this.appBarBackgroundColor,
112+
appBarForegroundColor:
113+
appBarForegroundColor ?? this.appBarForegroundColor,
107114
appBarTitleTextStyle: appBarTitleTextStyle ?? this.appBarTitleTextStyle,
108115
pollOptionVoteCountTextStyle:
109116
pollOptionVoteCountTextStyle ?? this.pollOptionVoteCountTextStyle,
@@ -125,6 +132,7 @@ class StreamPollOptionVotesDialogThemeData with Diagnosticable {
125132
backgroundColor: other.backgroundColor,
126133
appBarElevation: other.appBarElevation,
127134
appBarBackgroundColor: other.appBarBackgroundColor,
135+
appBarForegroundColor: other.appBarForegroundColor,
128136
appBarTitleTextStyle: other.appBarTitleTextStyle,
129137
pollOptionVoteCountTextStyle: other.pollOptionVoteCountTextStyle,
130138
pollOptionWinnerVoteCountTextStyle:
@@ -146,6 +154,8 @@ class StreamPollOptionVotesDialogThemeData with Diagnosticable {
146154
appBarElevation: lerpDouble(a?.appBarElevation, b?.appBarElevation, t),
147155
appBarBackgroundColor:
148156
Color.lerp(a?.appBarBackgroundColor, b?.appBarBackgroundColor, t),
157+
appBarForegroundColor:
158+
Color.lerp(a?.appBarForegroundColor, b?.appBarForegroundColor, t),
149159
appBarTitleTextStyle:
150160
TextStyle.lerp(a?.appBarTitleTextStyle, b?.appBarTitleTextStyle, t),
151161
pollOptionVoteCountTextStyle: TextStyle.lerp(
@@ -178,6 +188,7 @@ class StreamPollOptionVotesDialogThemeData with Diagnosticable {
178188
other.backgroundColor == backgroundColor &&
179189
other.appBarElevation == appBarElevation &&
180190
other.appBarBackgroundColor == appBarBackgroundColor &&
191+
other.appBarForegroundColor == appBarForegroundColor &&
181192
other.appBarTitleTextStyle == appBarTitleTextStyle &&
182193
other.pollOptionVoteCountTextStyle == pollOptionVoteCountTextStyle &&
183194
other.pollOptionWinnerVoteCountTextStyle ==
@@ -192,6 +203,7 @@ class StreamPollOptionVotesDialogThemeData with Diagnosticable {
192203
backgroundColor.hashCode ^
193204
appBarElevation.hashCode ^
194205
appBarBackgroundColor.hashCode ^
206+
appBarForegroundColor.hashCode ^
195207
appBarTitleTextStyle.hashCode ^
196208
pollOptionVoteCountTextStyle.hashCode ^
197209
pollOptionWinnerVoteCountTextStyle.hashCode ^

packages/stream_chat_flutter/lib/src/theme/poll_options_dialog_theme.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class StreamPollOptionsDialogThemeData with Diagnosticable {
5656
this.backgroundColor,
5757
this.appBarElevation,
5858
this.appBarBackgroundColor,
59+
this.appBarForegroundColor,
5960
this.appBarTitleTextStyle,
6061
this.pollTitleTextStyle,
6162
this.pollTitleDecoration,
@@ -71,6 +72,9 @@ class StreamPollOptionsDialogThemeData with Diagnosticable {
7172
/// The background color of the app bar.
7273
final Color? appBarBackgroundColor;
7374

75+
/// The foreground color of the app bar (icon and text color).
76+
final Color? appBarForegroundColor;
77+
7478
/// The text style of the app bar title.
7579
final TextStyle? appBarTitleTextStyle;
7680

@@ -89,6 +93,7 @@ class StreamPollOptionsDialogThemeData with Diagnosticable {
8993
Color? backgroundColor,
9094
double? appBarElevation,
9195
Color? appBarBackgroundColor,
96+
Color? appBarForegroundColor,
9297
TextStyle? appBarTitleTextStyle,
9398
TextStyle? pollTitleTextStyle,
9499
Decoration? pollTitleDecoration,
@@ -99,6 +104,8 @@ class StreamPollOptionsDialogThemeData with Diagnosticable {
99104
appBarElevation: appBarElevation ?? this.appBarElevation,
100105
appBarBackgroundColor:
101106
appBarBackgroundColor ?? this.appBarBackgroundColor,
107+
appBarForegroundColor:
108+
appBarForegroundColor ?? this.appBarForegroundColor,
102109
appBarTitleTextStyle: appBarTitleTextStyle ?? this.appBarTitleTextStyle,
103110
pollTitleTextStyle: pollTitleTextStyle ?? this.pollTitleTextStyle,
104111
pollTitleDecoration: pollTitleDecoration ?? this.pollTitleDecoration,
@@ -115,6 +122,7 @@ class StreamPollOptionsDialogThemeData with Diagnosticable {
115122
backgroundColor: other.backgroundColor,
116123
appBarElevation: other.appBarElevation,
117124
appBarBackgroundColor: other.appBarBackgroundColor,
125+
appBarForegroundColor: other.appBarForegroundColor,
118126
appBarTitleTextStyle: other.appBarTitleTextStyle,
119127
pollTitleTextStyle: other.pollTitleTextStyle,
120128
pollTitleDecoration: other.pollTitleDecoration,
@@ -133,6 +141,8 @@ class StreamPollOptionsDialogThemeData with Diagnosticable {
133141
appBarElevation: lerpDouble(a.appBarElevation, b.appBarElevation, t),
134142
appBarBackgroundColor:
135143
Color.lerp(a.appBarBackgroundColor, b.appBarBackgroundColor, t),
144+
appBarForegroundColor:
145+
Color.lerp(a.appBarForegroundColor, b.appBarForegroundColor, t),
136146
appBarTitleTextStyle:
137147
TextStyle.lerp(a.appBarTitleTextStyle, b.appBarTitleTextStyle, t),
138148
pollTitleTextStyle:
@@ -153,6 +163,7 @@ class StreamPollOptionsDialogThemeData with Diagnosticable {
153163
other.backgroundColor == backgroundColor &&
154164
other.appBarElevation == appBarElevation &&
155165
other.appBarBackgroundColor == appBarBackgroundColor &&
166+
other.appBarForegroundColor == appBarForegroundColor &&
156167
other.appBarTitleTextStyle == appBarTitleTextStyle &&
157168
other.pollTitleTextStyle == pollTitleTextStyle &&
158169
other.pollTitleDecoration == pollTitleDecoration &&
@@ -163,6 +174,7 @@ class StreamPollOptionsDialogThemeData with Diagnosticable {
163174
backgroundColor.hashCode ^
164175
appBarElevation.hashCode ^
165176
appBarBackgroundColor.hashCode ^
177+
appBarForegroundColor.hashCode ^
166178
appBarTitleTextStyle.hashCode ^
167179
pollTitleTextStyle.hashCode ^
168180
pollTitleDecoration.hashCode ^

0 commit comments

Comments
 (0)