Skip to content

Commit

Permalink
msglist [nfc]: Comment more about another inset, for completeness
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbobbe committed Jan 18, 2025
1 parent 75b8e35 commit 666db74
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/widgets/compose_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,7 @@ class _ErrorBanner extends StatelessWidget {
/// The compose box.
///
/// Takes the full screen width, covering the horizontal insets with its surface.
/// Also covers the bottom inset with its surface.
class ComposeBox extends StatefulWidget {
ComposeBox({super.key, required this.narrow})
: assert(ComposeBox.hasComposeBox(narrow));
Expand Down
11 changes: 8 additions & 3 deletions lib/widgets/message_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ class _MessageListPageState extends State<MessageListPage> implements MessageLis
builder: (BuildContext context) => Column(
// Children are expected to take the full horizontal space
// and handle the horizontal device insets.
// The bottom inset should be handled by the last child only.
children: [
MediaQuery.removePadding(
// Scaffold knows about the app bar, and so has run this
Expand Down Expand Up @@ -449,6 +450,9 @@ const kFetchMessagesBufferPixels = (kMessageListFetchBatchSize / 2) * _kShortMes
/// Takes the full screen width,
/// keeping the message list and scroll-to-bottom button
/// out of the horizontal insets with transparent [SafeArea] padding.
/// When there is no [ComposeBox],
/// adds transparent [SliverSafeArea] and [SafeArea] padding
/// to the message-list content and the scroll-to-bottom button, respectively.
class MessageList extends StatefulWidget {
const MessageList({super.key, required this.narrow, required this.onNarrowChanged});

Expand Down Expand Up @@ -562,7 +566,8 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
bottom: 0,
right: 0,
// TODO(#311) SafeArea shouldn't be needed if we have a
// bottom nav. That will pad the bottom inset.
// bottom nav; that will pad the bottom inset. Remove it,
// and the mention of bottom padding in MessageList dartdoc.
child: SafeArea(
child: ScrollToBottomButton(
scrollController: scrollController,
Expand Down Expand Up @@ -613,8 +618,8 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
}));

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

Expand Down

0 comments on commit 666db74

Please sign in to comment.