Skip to content

Commit a3b3e63

Browse files
recent dms [nfc]: Handle bottom insets explicitly in recent DMs page
This reverts part of 742320c for RecentDmConversationsPageBody, and also handles bottom insets for the list view and the new DMs button. As this widget is planned to be used outside the context of home page, specifically for the upcoming share page.
1 parent 20296a3 commit a3b3e63

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

lib/widgets/recent_dm_conversations.dart

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,20 @@ class _RecentDmConversationsPageBodyState extends State<RecentDmConversationsPag
7373
PageBodyEmptyContentPlaceholder(
7474
message: zulipLocalizations.recentDmConversationsEmptyPlaceholder)
7575
else
76-
SafeArea( // horizontal insets
76+
SafeArea(
77+
// Don't pad the bottom here; we want the list content to do that.
78+
//
79+
// When this page is used in the context of the home page, this
80+
// param and the below use of `MediaQuery.paddingOf(context).bottom`
81+
// would be noop, because `Scaffold.bottomNavigationBar` in the
82+
// home page handles that for us. But this page is planned to be
83+
// used for share-to-zulip page, so we need this to be handled here.
84+
//
85+
// Other *PageBody widgets don't handle this because they aren't
86+
// planned to be (re-)used outside the context of the home page.
87+
bottom: false,
7788
child: ListView.builder(
78-
padding: EdgeInsets.only(bottom: 90),
89+
padding: EdgeInsets.only(bottom: MediaQuery.paddingOf(context).bottom + 90),
7990
itemCount: sorted.length,
8091
itemBuilder: (context, index) {
8192
final narrow = sorted[index];
@@ -104,7 +115,7 @@ class _RecentDmConversationsPageBodyState extends State<RecentDmConversationsPag
104115
});
105116
})),
106117
Positioned(
107-
bottom: 21,
118+
bottom: MediaQuery.paddingOf(context).bottom + 21,
108119
child: _NewDmButton(onDmSelect: widget.onDmSelect)),
109120
]);
110121
}

0 commit comments

Comments
 (0)