Skip to content

Commit 93cefca

Browse files
chrisbobbegnprice
authored andcommitted
subscription_list: Handle insets with a SafeArea
1 parent 0618adc commit 93cefca

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

lib/widgets/subscription_list.dart

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -82,24 +82,28 @@ class _SubscriptionListPageState extends State<SubscriptionListPage> with PerAcc
8282

8383
return Scaffold(
8484
appBar: AppBar(title: const Text("Streams")),
85-
body: CustomScrollView(
86-
slivers: [
87-
if (pinned.isEmpty && unpinned.isEmpty)
88-
const _NoSubscriptionsItem(),
89-
if (pinned.isNotEmpty) ...[
90-
const _SubscriptionListHeader(label: "Pinned"),
91-
_SubscriptionList(unreadsModel: unreadsModel, subscriptions: pinned),
92-
],
93-
if (unpinned.isNotEmpty) ...[
94-
const _SubscriptionListHeader(label: "Unpinned"),
95-
_SubscriptionList(unreadsModel: unreadsModel, subscriptions: unpinned),
96-
],
97-
98-
// TODO(#188): add button leading to "All Streams" page with ability to subscribe
99-
100-
// This ensures last item in scrollable can settle in an unobstructed area.
101-
const SliverSafeArea(sliver: SliverToBoxAdapter(child: SizedBox.shrink())),
102-
]));
85+
body: SafeArea(
86+
// Don't pad the bottom here; we want the list content to do that.
87+
bottom: false,
88+
child: CustomScrollView(
89+
slivers: [
90+
if (pinned.isEmpty && unpinned.isEmpty)
91+
const _NoSubscriptionsItem(),
92+
if (pinned.isNotEmpty) ...[
93+
const _SubscriptionListHeader(label: "Pinned"),
94+
_SubscriptionList(unreadsModel: unreadsModel, subscriptions: pinned),
95+
],
96+
if (unpinned.isNotEmpty) ...[
97+
const _SubscriptionListHeader(label: "Unpinned"),
98+
_SubscriptionList(unreadsModel: unreadsModel, subscriptions: unpinned),
99+
],
100+
101+
// TODO(#188): add button leading to "All Streams" page with ability to subscribe
102+
103+
// This ensures last item in scrollable can settle in an unobstructed area.
104+
const SliverSafeArea(sliver: SliverToBoxAdapter(child: SizedBox.shrink())),
105+
]),
106+
));
103107
}
104108
}
105109

0 commit comments

Comments
 (0)