Merge pull request #109 from krawieck/local-home

This commit is contained in:
Marcin Wojnarowski 2021-01-16 14:56:29 +01:00 committed by GitHub
commit e5d0c589fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 15 deletions

View File

@ -61,17 +61,15 @@ class HomeTab extends HookWidget {
VisualDensity(vertical: VisualDensity.minimumDensity),
leading: SizedBox.shrink(),
),
for (final listingType in [
PostListingType.subscribed,
PostListingType.local,
PostListingType.all,
])
ListTile(
title: const Text('Subscribed'),
title: Text(listingType.value),
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)),
onTap: () => pop(_SelectedList(listingType: listingType)),
),
for (final instance in accStore.instances) ...[
const Padding(
@ -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(
@ -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}';