@@ -91,6 +91,11 @@ class _RecentDmConversationsPageBodyState extends State<RecentDmConversationsPag
91
91
final zulipLocalizations = ZulipLocalizations .of (context);
92
92
final sorted = model! .sorted;
93
93
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
+
94
99
return Stack (
95
100
alignment: Alignment .bottomCenter,
96
101
clipBehavior: Clip .none,
@@ -99,9 +104,21 @@ class _RecentDmConversationsPageBodyState extends State<RecentDmConversationsPag
99
104
PageBodyEmptyContentPlaceholder (
100
105
message: zulipLocalizations.recentDmConversationsEmptyPlaceholder)
101
106
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 ,
103
120
child: ListView .builder (
104
- padding: EdgeInsets .only (bottom: 90 ),
121
+ padding: EdgeInsets .only (bottom: bottomInsets + 90 ),
105
122
itemCount: sorted.length,
106
123
itemBuilder: (context, index) {
107
124
final narrow = sorted[index];
@@ -125,7 +142,7 @@ class _RecentDmConversationsPageBodyState extends State<RecentDmConversationsPag
125
142
onDmSelect: _handleDmSelect);
126
143
})),
127
144
Positioned (
128
- bottom: 21 ,
145
+ bottom: bottomInsets + 21 ,
129
146
child: _NewDmButton (onDmSelect: _handleDmSelectForNewDms)),
130
147
]);
131
148
}
0 commit comments