Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Commit

Permalink
Merge pull request #109 from krawieck/local-home
Browse files Browse the repository at this point in the history
  • Loading branch information
shilangyu authored Jan 16, 2021
2 parents 9669ba7 + 81fa4aa commit e5d0c58
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions lib/pages/home_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,16 @@ class HomeTab extends HookWidget {
VisualDensity(vertical: VisualDensity.minimumDensity),
leading: SizedBox.shrink(),
),
ListTile(
title: const Text('Subscribed'),
leading: const SizedBox(width: 20, height: 20),
onTap: () => pop(const _SelectedList(
listingType: PostListingType.subscribed)),
),
ListTile(
title: const Text('All'),
leading: const SizedBox(width: 20, height: 20),
onTap: () => pop(
const _SelectedList(listingType: PostListingType.all)),
),
for (final listingType in [
PostListingType.subscribed,
PostListingType.local,
PostListingType.all,
])
ListTile(
title: Text(listingType.value),
leading: const SizedBox(width: 20, height: 20),
onTap: () => pop(_SelectedList(listingType: listingType)),
),
for (final instance in accStore.instances) ...[
const Padding(
padding: EdgeInsets.symmetric(horizontal: 10),
Expand Down Expand Up @@ -125,6 +123,14 @@ class HomeTab extends HookWidget {
)),
leading: const SizedBox(width: 20),
),
ListTile(
title: const Text('Local'),
onTap: () => pop(_SelectedList(
listingType: PostListingType.local,
instanceHost: instance,
)),
leading: const SizedBox(width: 20),
),
ListTile(
title: const Text('All'),
onTap: () => pop(_SelectedList(
Expand All @@ -146,9 +152,8 @@ class HomeTab extends HookWidget {
}

final title = () {
final first = selectedList.value.listingType == PostListingType.subscribed
? 'Subscribed'
: 'All';
final first = selectedList.value.listingType.value;

final last = selectedList.value.instanceHost == null
? ''
: '@${selectedList.value.instanceHost}';
Expand Down

0 comments on commit e5d0c58

Please sign in to comment.