@@ -91,6 +91,11 @@ class _RecentDmConversationsPageBodyState extends State<RecentDmConversationsPag
9191 final zulipLocalizations = ZulipLocalizations .of (context);
9292 final sorted = model! .sorted;
9393
94+ // This value will be zero when this page is used in the context of
95+ // home-page, see comment on `bottom: false` arg in use of `SafeArea`
96+ // below.
97+ final bottomInsets = MediaQuery .paddingOf (context).bottom;
98+
9499 return Stack (
95100 alignment: Alignment .bottomCenter,
96101 clipBehavior: Clip .none,
@@ -99,9 +104,21 @@ class _RecentDmConversationsPageBodyState extends State<RecentDmConversationsPag
99104 PageBodyEmptyContentPlaceholder (
100105 message: zulipLocalizations.recentDmConversationsEmptyPlaceholder)
101106 else
102- SafeArea ( // horizontal insets
107+ SafeArea (
108+ // Don't pad the bottom here; we want the list content to do that.
109+ //
110+ // When this page is used in the context of the home page, this
111+ // param and the below use of `MediaQuery.paddingOf(context).bottom`
112+ // via `bottomInsets` would be noop, because
113+ // `Scaffold.bottomNavigationBar` in the home page handles that for
114+ // us. But this page is planned to be used for share-to-zulip page,
115+ // so we need this to be handled here.
116+ //
117+ // Other *PageBody widgets don't handle this because they aren't
118+ // planned to be (re-)used outside the context of the home page.
119+ bottom: false ,
103120 child: ListView .builder (
104- padding: EdgeInsets .only (bottom: 90 ),
121+ padding: EdgeInsets .only (bottom: bottomInsets + 90 ),
105122 itemCount: sorted.length,
106123 itemBuilder: (context, index) {
107124 final narrow = sorted[index];
@@ -126,7 +143,7 @@ class _RecentDmConversationsPageBodyState extends State<RecentDmConversationsPag
126143 onDmSelect: _handleDmSelect);
127144 })),
128145 Positioned (
129- bottom: 21 ,
146+ bottom: bottomInsets + 21 ,
130147 child: _NewDmButton (onDmSelect: _handleDmSelectForNewDms)),
131148 ]);
132149 }
0 commit comments