diff --git a/lib/widgets/compose_box.dart b/lib/widgets/compose_box.dart index c9b1a25017..750c703085 100644 --- a/lib/widgets/compose_box.dart +++ b/lib/widgets/compose_box.dart @@ -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)); diff --git a/lib/widgets/message_list.dart b/lib/widgets/message_list.dart index ca35154ffb..e6a9db5c1b 100644 --- a/lib/widgets/message_list.dart +++ b/lib/widgets/message_list.dart @@ -298,6 +298,7 @@ class _MessageListPageState extends State 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 @@ -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}); @@ -572,7 +575,9 @@ class _MessageListState extends State 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, @@ -623,8 +628,8 @@ class _MessageListState extends State 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); }