Skip to content

Commit 20296a3

Browse files
subscription_list [nfc]: Handle bottom insets explicitly in subscription list page
This reverts part of 742320c for SubscriptionListPageBody, as this widget is planned to be used outside the context of home page, specifically for the upcoming share page.
1 parent e56fc29 commit 20296a3

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

lib/widgets/subscription_list.dart

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,18 @@ 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+
//
125+
// When this page is used in the context of the home page, this
126+
// param and the below use of `SliverSafeArea` would be noop, because
127+
// `Scaffold.bottomNavigationBar` in the home page handles that for us.
128+
// But this page is planned to be used for share-to-zulip page, so we
129+
// need this to be handled here.
130+
//
131+
// Other *PageBody widgets don't handle this because they aren't
132+
// planned to be (re-)used outside the context of the home page.
133+
bottom: false,
123134
child: CustomScrollView(
124135
slivers: [
125136
if (pinned.isNotEmpty) ...[
@@ -140,6 +151,9 @@ class _SubscriptionListPageBodyState extends State<SubscriptionListPageBody> wit
140151
],
141152

142153
// TODO(#188): add button leading to "All Streams" page with ability to subscribe
154+
155+
// This ensures last item in scrollable can settle in an unobstructed area.
156+
const SliverSafeArea(sliver: SliverToBoxAdapter(child: SizedBox.shrink())),
143157
]));
144158
}
145159
}

0 commit comments

Comments
 (0)