Skip to content

Commit 37f71c6

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 fb4d254 commit 37f71c6

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

lib/widgets/subscription_list.dart

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,18 @@ class _SubscriptionListPageBodyState extends State<SubscriptionListPageBody> wit
132132

133133
final onChannelSelect = widget.onChannelSelect ?? _handleChannelSelect;
134134

135-
return SafeArea( // horizontal insets
135+
return SafeArea(
136+
// Don't pad the bottom here; we want the list content to do that.
137+
//
138+
// When this page is used in the context of the home page, this
139+
// param and the below use of `SliverSafeArea` would be noop, because
140+
// `Scaffold.bottomNavigationBar` in the home page handles that for us.
141+
// But this page is planned to be used for share-to-zulip page, so we
142+
// need this to be handled here.
143+
//
144+
// Other *PageBody widgets don't handle this because they aren't
145+
// planned to be (re-)used outside the context of the home page.
146+
bottom: false,
136147
child: CustomScrollView(
137148
slivers: [
138149
if (pinned.isNotEmpty) ...[
@@ -153,6 +164,11 @@ class _SubscriptionListPageBodyState extends State<SubscriptionListPageBody> wit
153164
],
154165

155166
// TODO(#188): add button leading to "All Streams" page with ability to subscribe
167+
168+
// This ensures last item in scrollable can settle in an unobstructed area.
169+
// (Noop in the home-page case; see comment on `bottom: false` arg in
170+
// use of `SafeArea` above.)
171+
const SliverSafeArea(sliver: SliverToBoxAdapter(child: SizedBox.shrink())),
156172
]));
157173
}
158174
}

0 commit comments

Comments
 (0)