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(
filters: [FavouriteFilter(), VideoFilter(), GifFilter()].where((f) => containQuery(f.label)),
),
..._buildFilterRow(
title: 'Countries',
filters: source.sortedCountries.where(containQuery).map((s) => CountryFilter(s)),
),
..._buildFilterRow(
title: 'Albums',
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(
title: 'Tags',
filters: source.sortedTags.where(containQuery).map((s) => TagFilter(s)),

View file

@ -79,24 +79,27 @@ class _AvesFilterChipState extends State<AvesFilterChip> {
borderRadius: BorderRadius.circular(42),
);
return ConstrainedBox(
constraints: const BoxConstraints(maxWidth: AvesFilterChip.maxChipWidth),
child: Tooltip(
message: filter.tooltip,
child: FutureBuilder(
future: _colorFuture,
builder: (context, AsyncSnapshot<Color> snapshot) {
return OutlineButton(
onPressed: widget.onPressed != null ? () => widget.onPressed(filter) : null,
borderSide: BorderSide(
color: snapshot.hasData ? snapshot.data : Colors.transparent,
width: AvesFilterChip.buttonBorderWidth,
),
padding: const EdgeInsets.symmetric(horizontal: AvesFilterChip.padding * 2),
shape: shape,
child: child,
);
},
return ButtonTheme(
minWidth: 0,
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: AvesFilterChip.maxChipWidth),
child: Tooltip(
message: filter.tooltip,
child: FutureBuilder(
future: _colorFuture,
builder: (context, AsyncSnapshot<Color> snapshot) {
return OutlineButton(
onPressed: widget.onPressed != null ? () => widget.onPressed(filter) : null,
borderSide: BorderSide(
color: snapshot.hasData ? snapshot.data : Colors.transparent,
width: AvesFilterChip.buttonBorderWidth,
),
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),
),
),
Expanded(
child: LinearPercentIndicator(
percent: percent,
lineHeight: 16,
backgroundColor: Colors.white24,
progressColor: stringToColor(label),
animation: true,
padding: const EdgeInsets.symmetric(horizontal: 16),
center: Text(NumberFormat.percentPattern().format(percent)),
),
LinearPercentIndicator(
percent: percent,
lineHeight: 16,
backgroundColor: Colors.white24,
progressColor: stringToColor(label),
animation: true,
padding: const EdgeInsets.symmetric(horizontal: 16),
center: Text(NumberFormat.percentPattern().format(percent)),
),
Text(
'${count}',