Viewer: prevent tag navigation

This commit is contained in:
Thibault Deckers 2020-03-19 18:40:40 +09:00
parent d04f5da41d
commit 14cf1b3edf
2 changed files with 7 additions and 2 deletions

View file

@ -39,9 +39,13 @@ class CollectionLens with ChangeNotifier {
} }
factory CollectionLens.from(CollectionLens lens, CollectionFilter filter) { factory CollectionLens.from(CollectionLens lens, CollectionFilter filter) {
if (lens == null) return null;
return CollectionLens( return CollectionLens(
source: lens.source, source: lens.source,
filters: [...lens.filters, filter], filters: [
...lens.filters,
if (filter != null) filter,
],
groupFactor: lens.groupFactor, groupFactor: lens.groupFactor,
sortFactor: lens.sortFactor, sortFactor: lens.sortFactor,
); );

View file

@ -24,7 +24,7 @@ class XmpTagSectionSliver extends AnimatedWidget {
tags.isEmpty tags.isEmpty
? [] ? []
: [ : [
const SectionRow('XMP Tags'), const SectionRow('Tags'),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: TagButton.buttonBorderWidth / 2), padding: const EdgeInsets.symmetric(horizontal: TagButton.buttonBorderWidth / 2),
child: Wrap( child: Wrap(
@ -43,6 +43,7 @@ class XmpTagSectionSliver extends AnimatedWidget {
} }
void _goToTag(BuildContext context, String tag) { void _goToTag(BuildContext context, String tag) {
if (collection == null) return;
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(