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 23, 2025
1 parent 27f827d commit da9a369
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 @@ -1278,6 +1278,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 @@ -298,6 +298,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 @@ -459,6 +460,8 @@ const kFetchMessagesBufferPixels = (kMessageListFetchBatchSize / 2) * _kShortMes
///
/// Takes the full screen width, keeping its contents
/// out of the horizontal insets with transparent [SafeArea] padding.
/// When there is no [ComposeBox], also takes responsibility
/// for dealing with the bottom inset.
class MessageList extends StatefulWidget {
const MessageList({super.key, required this.narrow, required this.onNarrowChanged});

Expand Down Expand Up @@ -572,7 +575,9 @@ 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-inset handling in
// MessageList's dartdoc.
child: SafeArea(
child: ScrollToBottomButton(
scrollController: scrollController,
Expand Down Expand Up @@ -623,8 +628,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 da9a369

Please sign in to comment.