@@ -46,13 +46,30 @@ class MessageListPage extends StatefulWidget {
46
46
State <MessageListPage > createState () => _MessageListPageState ();
47
47
}
48
48
49
+ const _kFallbackStreamColor = Color (0xfff5f5f5 );
50
+
49
51
class _MessageListPageState extends State <MessageListPage > {
50
52
final GlobalKey <ComposeBoxController > _composeBoxKey = GlobalKey ();
51
53
52
54
@override
53
55
Widget build (BuildContext context) {
56
+ final store = PerAccountStoreWidget .of (context);
57
+
58
+ final Color backgroundColor;
59
+ switch (widget.narrow) {
60
+ case AllMessagesNarrow ():
61
+ backgroundColor = _kFallbackStreamColor;
62
+ case StreamNarrow (: final streamId):
63
+ case TopicNarrow (: final streamId):
64
+ backgroundColor = store.subscriptions[streamId]? .colorSwatch ().barBackground
65
+ ?? _kFallbackStreamColor;
66
+ case DmNarrow ():
67
+ backgroundColor = _kFallbackStreamColor;
68
+ }
69
+
54
70
return Scaffold (
55
- appBar: AppBar (title: MessageListAppBarTitle (narrow: widget.narrow)),
71
+ appBar: AppBar (title: MessageListAppBarTitle (narrow: widget.narrow),
72
+ backgroundColor: backgroundColor),
56
73
// TODO question for Vlad: for a stream view, should we set
57
74
// [backgroundColor] based on stream color, as in this frame:
58
75
// https://www.figma.com/file/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?node-id=132%3A9684&mode=dev
0 commit comments