Skip to content

ui: Sweep through and fix safe-area bugs #413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 19 additions & 16 deletions lib/widgets/inbox.dart
Original file line number Diff line number Diff line change
Expand Up @@ -155,22 +155,25 @@ class _InboxPageState extends State<InboxPage> with PerAccountStoreAwareStateMix

return Scaffold(
appBar: AppBar(title: const Text('Inbox')),
body: StickyHeaderListView.builder(
itemCount: sections.length,
itemBuilder: (context, index) {
final section = sections[index];
switch (section) {
case _AllDmsSectionData():
return _AllDmsSection(
data: section,
collapsed: allDmsCollapsed,
pageState: this,
);
case _StreamSectionData(:var streamId):
final collapsed = collapsedStreamIds.contains(streamId);
return _StreamSection(data: section, collapsed: collapsed, pageState: this);
}
}));
body: SafeArea(
// Don't pad the bottom here; we want the list content to do that.
bottom: false,
child: StickyHeaderListView.builder(
itemCount: sections.length,
itemBuilder: (context, index) {
final section = sections[index];
switch (section) {
case _AllDmsSectionData():
return _AllDmsSection(
data: section,
collapsed: allDmsCollapsed,
pageState: this,
);
case _StreamSectionData(:var streamId):
final collapsed = collapsedStreamIds.contains(streamId);
return _StreamSection(data: section, collapsed: collapsed, pageState: this);
}
})));
}
}

Expand Down
22 changes: 13 additions & 9 deletions lib/widgets/recent_dm_conversations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,19 @@ class _RecentDmConversationsPageState extends State<RecentDmConversationsPage> w
final sorted = model!.sorted;
return Scaffold(
appBar: AppBar(title: const Text('Direct messages')),
body: ListView.builder(
itemCount: sorted.length,
itemBuilder: (context, index) {
final narrow = sorted[index];
return RecentDmConversationsItem(
narrow: narrow,
unreadCount: unreadsModel!.countInDmNarrow(narrow),
);
}));
body: SafeArea(
// Don't pad the bottom here; we want the list content to do that.
bottom: false,
child: ListView.builder(
itemCount: sorted.length,
itemBuilder: (context, index) {
final narrow = sorted[index];
return RecentDmConversationsItem(
narrow: narrow,
unreadCount: unreadsModel!.countInDmNarrow(narrow),
);
}),
));
}
}

Expand Down
7 changes: 5 additions & 2 deletions lib/widgets/subscription_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ class _SubscriptionListPageState extends State<SubscriptionListPage> with PerAcc

return Scaffold(
appBar: AppBar(title: const Text("Streams")),
body: Center(
body: SafeArea(
// Don't pad the bottom here; we want the list content to do that.
bottom: false,
child: CustomScrollView(
slivers: [
if (pinned.isEmpty && unpinned.isEmpty)
Expand All @@ -100,7 +102,8 @@ class _SubscriptionListPageState extends State<SubscriptionListPage> with PerAcc

// This ensures last item in scrollable can settle in an unobstructed area.
const SliverSafeArea(sliver: SliverToBoxAdapter(child: SizedBox.shrink())),
])));
]),
));
}
}

Expand Down