Skip to content

Commit e0511c4

Browse files
chrisbobbegnprice
authored andcommitted
msglist [nfc]: Comment more about another inset, for completeness
1 parent f53763a commit e0511c4

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lib/widgets/compose_box.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,6 +1278,7 @@ class _ErrorBanner extends StatelessWidget {
12781278
/// The compose box.
12791279
///
12801280
/// Takes the full screen width, covering the horizontal insets with its surface.
1281+
/// Also covers the bottom inset with its surface.
12811282
class ComposeBox extends StatefulWidget {
12821283
ComposeBox({super.key, required this.narrow})
12831284
: assert(ComposeBox.hasComposeBox(narrow));

lib/widgets/message_list.dart

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ class _MessageListPageState extends State<MessageListPage> implements MessageLis
297297
builder: (BuildContext context) => Column(
298298
// Children are expected to take the full horizontal space
299299
// and handle the horizontal device insets.
300+
// The bottom inset should be handled by the last child only.
300301
children: [
301302
MediaQuery.removePadding(
302303
// Scaffold knows about the app bar, and so has run this
@@ -438,6 +439,8 @@ const kFetchMessagesBufferPixels = (kMessageListFetchBatchSize / 2) * _kShortMes
438439
///
439440
/// Takes the full screen width, keeping its contents
440441
/// out of the horizontal insets with transparent [SafeArea] padding.
442+
/// When there is no [ComposeBox], also takes responsibility
443+
/// for dealing with the bottom inset.
441444
class MessageList extends StatefulWidget {
442445
const MessageList({super.key, required this.narrow, required this.onNarrowChanged});
443446

@@ -551,7 +554,9 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
551554
bottom: 0,
552555
right: 0,
553556
// TODO(#311) SafeArea shouldn't be needed if we have a
554-
// bottom nav. That will pad the bottom inset.
557+
// bottom nav; that will pad the bottom inset. Remove it,
558+
// and the mention of bottom-inset handling in
559+
// MessageList's dartdoc.
555560
child: SafeArea(
556561
child: ScrollToBottomButton(
557562
scrollController: scrollController,
@@ -602,8 +607,8 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
602607
}));
603608

604609
if (!ComposeBox.hasComposeBox(widget.narrow)) {
605-
// TODO(#311) If we have a bottom nav, it will pad the bottom
606-
// inset, and this shouldn't be necessary
610+
// TODO(#311) If we have a bottom nav, it will pad the bottom inset,
611+
// and this can be removed; also remove mention in MessageList dartdoc
607612
sliver = SliverSafeArea(sliver: sliver);
608613
}
609614

0 commit comments

Comments
 (0)