Skip to content

Commit d7e5964

Browse files
committed
msglist [nfc]: Comment more about another inset, for completeness
1 parent 75b8e35 commit d7e5964

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

lib/widgets/compose_box.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,6 +1245,7 @@ class _ErrorBanner extends StatelessWidget {
12451245
/// The compose box.
12461246
///
12471247
/// Takes the full screen width, covering the horizontal insets with its surface.
1248+
/// Also covers the bottom inset with its surface.
12481249
class ComposeBox extends StatefulWidget {
12491250
ComposeBox({super.key, required this.narrow})
12501251
: assert(ComposeBox.hasComposeBox(narrow));

lib/widgets/message_list.dart

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ class _MessageListPageState extends State<MessageListPage> implements MessageLis
291291
builder: (BuildContext context) => Column(
292292
// Children are expected to take the full horizontal space
293293
// and handle the horizontal device insets.
294+
// The bottom inset should be handled by the last child only.
294295
children: [
295296
MediaQuery.removePadding(
296297
// Scaffold knows about the app bar, and so has run this
@@ -448,7 +449,9 @@ const kFetchMessagesBufferPixels = (kMessageListFetchBatchSize / 2) * _kShortMes
448449
///
449450
/// Takes the full screen width,
450451
/// keeping the message list and scroll-to-bottom button
451-
/// out of the horizontal insets with transparent [SafeArea] padding.
452+
/// out of the horizontal and bottom insets with transparent [SafeArea] padding.
453+
/// When there is no [ComposeBox], adds a [SliverSafeArea], to ensure
454+
/// content can be scrolled out of the bottom inset.
452455
class MessageList extends StatefulWidget {
453456
const MessageList({super.key, required this.narrow, required this.onNarrowChanged});
454457

@@ -562,7 +565,8 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
562565
bottom: 0,
563566
right: 0,
564567
// TODO(#311) SafeArea shouldn't be needed if we have a
565-
// bottom nav. That will pad the bottom inset.
568+
// bottom nav; that will pad the bottom inset. Remove it,
569+
// and the mention of bottom padding in MessageList dartdoc.
566570
child: SafeArea(
567571
child: ScrollToBottomButton(
568572
scrollController: scrollController,
@@ -613,8 +617,8 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
613617
}));
614618

615619
if (!ComposeBox.hasComposeBox(widget.narrow)) {
616-
// TODO(#311) If we have a bottom nav, it will pad the bottom
617-
// inset, and this shouldn't be necessary
620+
// TODO(#311) If we have a bottom nav, it will pad the bottom inset,
621+
// and this can be removed; also remove mention in MessageList dartdoc
618622
sliver = SliverSafeArea(sliver: sliver);
619623
}
620624

0 commit comments

Comments
 (0)