minor fixes

This commit is contained in:
Thibault Deckers 2020-03-30 10:25:25 +09:00
parent ef130eb820
commit 1c18cc320e
3 changed files with 33 additions and 32 deletions

View file

@ -61,14 +61,14 @@ class ImageSearchDelegate extends SearchDelegate<CollectionFilter> {
..._buildFilterRow( ..._buildFilterRow(
filters: [FavouriteFilter(), VideoFilter(), GifFilter()].where((f) => containQuery(f.label)), filters: [FavouriteFilter(), VideoFilter(), GifFilter()].where((f) => containQuery(f.label)),
), ),
..._buildFilterRow(
title: 'Countries',
filters: source.sortedCountries.where(containQuery).map((s) => CountryFilter(s)),
),
..._buildFilterRow( ..._buildFilterRow(
title: 'Albums', title: 'Albums',
filters: source.sortedAlbums.where(containQuery).map((s) => AlbumFilter(s, CollectionSource.getUniqueAlbumName(s, source.sortedAlbums))).where((f) => containQuery(f.uniqueName)), filters: source.sortedAlbums.where(containQuery).map((s) => AlbumFilter(s, CollectionSource.getUniqueAlbumName(s, source.sortedAlbums))).where((f) => containQuery(f.uniqueName)),
), ),
..._buildFilterRow(
title: 'Countries',
filters: source.sortedCountries.where(containQuery).map((s) => CountryFilter(s)),
),
..._buildFilterRow( ..._buildFilterRow(
title: 'Tags', title: 'Tags',
filters: source.sortedTags.where(containQuery).map((s) => TagFilter(s)), filters: source.sortedTags.where(containQuery).map((s) => TagFilter(s)),

View file

@ -79,24 +79,27 @@ class _AvesFilterChipState extends State<AvesFilterChip> {
borderRadius: BorderRadius.circular(42), borderRadius: BorderRadius.circular(42),
); );
return ConstrainedBox( return ButtonTheme(
constraints: const BoxConstraints(maxWidth: AvesFilterChip.maxChipWidth), minWidth: 0,
child: Tooltip( child: ConstrainedBox(
message: filter.tooltip, constraints: const BoxConstraints(maxWidth: AvesFilterChip.maxChipWidth),
child: FutureBuilder( child: Tooltip(
future: _colorFuture, message: filter.tooltip,
builder: (context, AsyncSnapshot<Color> snapshot) { child: FutureBuilder(
return OutlineButton( future: _colorFuture,
onPressed: widget.onPressed != null ? () => widget.onPressed(filter) : null, builder: (context, AsyncSnapshot<Color> snapshot) {
borderSide: BorderSide( return OutlineButton(
color: snapshot.hasData ? snapshot.data : Colors.transparent, onPressed: widget.onPressed != null ? () => widget.onPressed(filter) : null,
width: AvesFilterChip.buttonBorderWidth, borderSide: BorderSide(
), color: snapshot.hasData ? snapshot.data : Colors.transparent,
padding: const EdgeInsets.symmetric(horizontal: AvesFilterChip.padding * 2), width: AvesFilterChip.buttonBorderWidth,
shape: shape, ),
child: child, padding: const EdgeInsets.symmetric(horizontal: AvesFilterChip.padding * 2),
); shape: shape,
}, child: child,
);
},
),
), ),
), ),
); );

View file

@ -188,16 +188,14 @@ class StatsPage extends StatelessWidget {
onPressed: (filter) => _goToFilteredCollection(context, filter), onPressed: (filter) => _goToFilteredCollection(context, filter),
), ),
), ),
Expanded( LinearPercentIndicator(
child: LinearPercentIndicator( percent: percent,
percent: percent, lineHeight: 16,
lineHeight: 16, backgroundColor: Colors.white24,
backgroundColor: Colors.white24, progressColor: stringToColor(label),
progressColor: stringToColor(label), animation: true,
animation: true, padding: const EdgeInsets.symmetric(horizontal: 16),
padding: const EdgeInsets.symmetric(horizontal: 16), center: Text(NumberFormat.percentPattern().format(percent)),
center: Text(NumberFormat.percentPattern().format(percent)),
),
), ),
Text( Text(
'${count}', '${count}',