Skip to content

Commit 2eb94c9

Browse files
committed
msglist: Move white background color to MessageItem, from whole list
This lets `colorScheme.background` (which we matched to the Figma in 21dbae1) come through in the area with the "Mark X messages as read" button, following a Figma frame: https://www.figma.com/file/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?node-id=147%3A9133&mode=dev (There's a different Figma frame that shows a stream-specific color there; more on that in the next commit.) The background color (`colorScheme.background`) will now also come through in these areas: - in the area with the "No earlier messages" text, when scrolled to the earliest messages - in the new blank space we added after the most recent message, earlier in this series of commits. Fixes: #401
1 parent 8ada8a6 commit 2eb94c9

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

lib/widgets/message_list.dart

+33-33
Original file line numberDiff line numberDiff line change
@@ -229,35 +229,33 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
229229
// TODO figure out text color -- web is supposedly hsl(0deg 0% 20%),
230230
// but seems much darker than that
231231
style: const TextStyle(color: Color.fromRGBO(0, 0, 0, 1)),
232-
child: ColoredBox(
233-
color: Colors.white,
234-
// Pad the left and right insets, for small devices in landscape.
235-
child: SafeArea(
236-
// Don't let this be the place we pad the bottom inset. When there's
237-
// no compose box, we want to let the message-list content pad it.
238-
// TODO(#311) Remove as unnecessary if we do a bottom nav.
239-
// The nav will pad the bottom inset, and an ancestor of this widget
240-
// will have a `MediaQuery.removePadding` with `removeBottom: true`.
241-
bottom: false,
242-
243-
child: Center(
244-
child: ConstrainedBox(
245-
constraints: const BoxConstraints(maxWidth: 760),
246-
child: NotificationListener<ScrollMetricsNotification>(
247-
onNotification: _metricsChanged,
248-
child: Stack(
249-
children: <Widget>[
250-
_buildListView(context),
251-
Positioned(
252-
bottom: 0,
253-
right: 0,
254-
// TODO(#311) SafeArea shouldn't be needed if we have a
255-
// bottom nav. That will pad the bottom inset.
256-
child: SafeArea(
257-
child: ScrollToBottomButton(
258-
scrollController: scrollController,
259-
visibleValue: _scrollToBottomVisibleValue))),
260-
])))))));
232+
// Pad the left and right insets, for small devices in landscape.
233+
child: SafeArea(
234+
// Don't let this be the place we pad the bottom inset. When there's
235+
// no compose box, we want to let the message-list content pad it.
236+
// TODO(#311) Remove as unnecessary if we do a bottom nav.
237+
// The nav will pad the bottom inset, and an ancestor of this widget
238+
// will have a `MediaQuery.removePadding` with `removeBottom: true`.
239+
bottom: false,
240+
241+
child: Center(
242+
child: ConstrainedBox(
243+
constraints: const BoxConstraints(maxWidth: 760),
244+
child: NotificationListener<ScrollMetricsNotification>(
245+
onNotification: _metricsChanged,
246+
child: Stack(
247+
children: <Widget>[
248+
_buildListView(context),
249+
Positioned(
250+
bottom: 0,
251+
right: 0,
252+
// TODO(#311) SafeArea shouldn't be needed if we have a
253+
// bottom nav. That will pad the bottom inset.
254+
child: SafeArea(
255+
child: ScrollToBottomButton(
256+
scrollController: scrollController,
257+
visibleValue: _scrollToBottomVisibleValue))),
258+
]))))));
261259
}
262260

263261
Widget _buildListView(context) {
@@ -464,10 +462,12 @@ class MessageItem extends StatelessWidget {
464462
header: RecipientHeader(message: message),
465463
child: _UnreadMarker(
466464
isRead: message.flags.contains(MessageFlag.read),
467-
child: Column(children: [
468-
MessageWithPossibleSender(item: item),
469-
if (trailingWhitespace != null && item.isLastInBlock) SizedBox(height: trailingWhitespace!),
470-
])));
465+
child: ColoredBox(
466+
color: Colors.white,
467+
child: Column(children: [
468+
MessageWithPossibleSender(item: item),
469+
if (trailingWhitespace != null && item.isLastInBlock) SizedBox(height: trailingWhitespace!),
470+
]))));
471471
}
472472
}
473473

0 commit comments

Comments
 (0)