info: styled tags as buttons

This commit is contained in:
Thibault Deckers 2019-12-28 01:24:57 +09:00
parent d42ad00688
commit b3a21da574

View file

@ -24,25 +24,29 @@ class XmpTagSection extends AnimatedWidget {
children: [
const SectionRow('XMP Tags'),
Wrap(
children: tags
.map((tag) => Padding(
padding: const EdgeInsets.symmetric(horizontal: 4.0),
child: ActionChip(
label: Text(tag),
onPressed: () => Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FilteredCollectionPage(
collection: collection,
filter: (entry) => entry.xmpSubjects.contains(tag),
title: tag,
),
),
),
backgroundColor: Theme.of(context).accentColor,
),
))
.toList(),
spacing: 8,
children: tags.map((tag) {
final borderColor = Theme.of(context).accentColor;
return OutlineButton(
onPressed: () => Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FilteredCollectionPage(
collection: collection,
filter: (entry) => entry.xmpSubjects.contains(tag),
title: tag,
),
),
),
borderSide: BorderSide(
color: borderColor,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(42),
),
child: Text(tag),
);
}).toList(),
),
],
);