Skip to content

Commit fe42d20

Browse files
rajveermalviyagnprice
authored andcommitted
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 e4deccb commit fe42d20

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
@@ -135,7 +135,18 @@ class _SubscriptionListPageBodyState extends State<SubscriptionListPageBody> wit
135135
message: zulipLocalizations.channelsEmptyPlaceholder);
136136
}
137137

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

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

0 commit comments

Comments
 (0)