Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msglist: Have content pad bottom inset when the compose box isn't shown #379

Merged
merged 2 commits into from
Nov 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions lib/widgets/message_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ class _MessageListPageState extends State<MessageListPage> {
// MediaQuery.removePadding with `removeTop: true`.
context: context,

// The compose box pads the bottom inset.
removeBottom: true,
// The compose box, when present, pads the bottom inset.
// TODO this copies the details of when the compose box is shown;
// if those details get complicated, refactor to avoid copying.
// TODO(#311) If we have a bottom nav, it will pad the bottom
// inset, and this should always be true.
removeBottom: widget.narrow is! AllMessagesNarrow,

child: Expanded(
child: MessageList(narrow: widget.narrow))),
Expand Down Expand Up @@ -228,6 +232,13 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
color: Colors.white,
// Pad the left and right insets, for small devices in landscape.
child: SafeArea(
// Don't let this be the place we pad the bottom inset. When there's
// no compose box, we want to let the message-list content pad it.
// TODO(#311) Remove as unnecessary if we do a bottom nav.
// The nav will pad the bottom inset, and an ancestor of this widget
// will have a `MediaQuery.removePadding` with `removeBottom: true`.
bottom: false,

child: Center(
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 760),
Expand All @@ -239,9 +250,12 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
Positioned(
bottom: 0,
right: 0,
child: ScrollToBottomButton(
scrollController: scrollController,
visibleValue: _scrollToBottomVisibleValue)),
// TODO(#311) SafeArea shouldn't be needed if we have a
// bottom nav. That will pad the bottom inset.
child: SafeArea(
child: ScrollToBottomButton(
Comment on lines +255 to +256
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, I see.

scrollController: scrollController,
visibleValue: _scrollToBottomVisibleValue))),
])))))));
}

Expand Down