Skip to content

Commit c9391df

Browse files
home [nfc]: Handle safe-area in recent DMs and subscription list page
This reverts part of 742320c for RecentDmConversationsPageBody and SubscriptionListPageBody, as these widgets will soon be used outside the context of home page, specifically for the upcoming share page. The other *PageBody widgets, currently only InboxPageBody, don't need these as they aren't used outside the context of the home page.
1 parent e461d98 commit c9391df

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

lib/widgets/recent_dm_conversations.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ 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+
bottom: false,
7779
child: ListView.builder(
78-
padding: EdgeInsets.only(bottom: 90),
80+
padding: EdgeInsets.only(bottom: MediaQuery.paddingOf(context).bottom + 90),
7981
itemCount: sorted.length,
8082
itemBuilder: (context, index) {
8183
final narrow = sorted[index];
@@ -104,7 +106,7 @@ class _RecentDmConversationsPageBodyState extends State<RecentDmConversationsPag
104106
});
105107
})),
106108
Positioned(
107-
bottom: 21,
109+
bottom: MediaQuery.paddingOf(context).bottom + 21,
108110
child: _NewDmButton(onDmSelect: widget.onDmSelect)),
109111
]);
110112
}

lib/widgets/subscription_list.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ class _SubscriptionListPageBodyState extends State<SubscriptionListPageBody> wit
119119
message: zulipLocalizations.channelsEmptyPlaceholder);
120120
}
121121

122-
return SafeArea( // horizontal insets
122+
return SafeArea(
123+
// Don't pad the bottom here; we want the list content to do that.
124+
bottom: false,
123125
child: CustomScrollView(
124126
slivers: [
125127
if (pinned.isNotEmpty) ...[
@@ -140,6 +142,9 @@ class _SubscriptionListPageBodyState extends State<SubscriptionListPageBody> wit
140142
],
141143

142144
// TODO(#188): add button leading to "All Streams" page with ability to subscribe
145+
146+
// This ensures last item in scrollable can settle in an unobstructed area.
147+
const SliverSafeArea(sliver: SliverToBoxAdapter(child: SizedBox.shrink())),
143148
]));
144149
}
145150
}

0 commit comments

Comments
 (0)