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,18 +61,16 @@ class HomeTab extends HookWidget {
VisualDensity(vertical: VisualDensity.minimumDensity), VisualDensity(vertical: VisualDensity.minimumDensity),
leading: SizedBox.shrink(), leading: SizedBox.shrink(),
), ),
ListTile( for (final listingType in [
title: const Text('Subscribed'), PostListingType.subscribed,
leading: const SizedBox(width: 20, height: 20), PostListingType.local,
onTap: () => pop(const _SelectedList( PostListingType.all,
listingType: PostListingType.subscribed)), ])
), ListTile(
ListTile( title: Text(listingType.value),
title: const Text('All'), leading: const SizedBox(width: 20, height: 20),
leading: const SizedBox(width: 20, height: 20), onTap: () => pop(_SelectedList(listingType: listingType)),
onTap: () => pop( ),
const _SelectedList(listingType: PostListingType.all)),
),
for (final instance in accStore.instances) ...[ for (final instance in accStore.instances) ...[
const Padding( const Padding(
padding: EdgeInsets.symmetric(horizontal: 10), padding: EdgeInsets.symmetric(horizontal: 10),
@ -125,6 +123,14 @@ class HomeTab extends HookWidget {
)), )),
leading: const SizedBox(width: 20), leading: const SizedBox(width: 20),
), ),
ListTile(
title: const Text('Local'),
onTap: () => pop(_SelectedList(
listingType: PostListingType.local,
instanceHost: instance,
)),
leading: const SizedBox(width: 20),
),
ListTile( ListTile(
title: const Text('All'), title: const Text('All'),
onTap: () => pop(_SelectedList( onTap: () => pop(_SelectedList(
@ -146,9 +152,8 @@ class HomeTab extends HookWidget {
} }
final title = () { final title = () {
final first = selectedList.value.listingType == PostListingType.subscribed final first = selectedList.value.listingType.value;
? 'Subscribed'
: 'All';
final last = selectedList.value.instanceHost == null final last = selectedList.value.instanceHost == null
? '' ? ''
: '@${selectedList.value.instanceHost}'; : '@${selectedList.value.instanceHost}';