From 1c18cc320e3092a15a92afedad4acc665f0aa86e Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Mon, 30 Mar 2020 10:25:25 +0900 Subject: [PATCH] minor fixes --- lib/widgets/album/search_delegate.dart | 8 ++--- lib/widgets/common/aves_filter_chip.dart | 39 +++++++++++++----------- lib/widgets/stats.dart | 18 +++++------ 3 files changed, 33 insertions(+), 32 deletions(-) diff --git a/lib/widgets/album/search_delegate.dart b/lib/widgets/album/search_delegate.dart index bb9f3db2f..15f181d85 100644 --- a/lib/widgets/album/search_delegate.dart +++ b/lib/widgets/album/search_delegate.dart @@ -61,14 +61,14 @@ class ImageSearchDelegate extends SearchDelegate { ..._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)), diff --git a/lib/widgets/common/aves_filter_chip.dart b/lib/widgets/common/aves_filter_chip.dart index 3a6286275..7ad0ac608 100644 --- a/lib/widgets/common/aves_filter_chip.dart +++ b/lib/widgets/common/aves_filter_chip.dart @@ -79,24 +79,27 @@ class _AvesFilterChipState extends State { borderRadius: BorderRadius.circular(42), ); - return ConstrainedBox( - constraints: const BoxConstraints(maxWidth: AvesFilterChip.maxChipWidth), - child: Tooltip( - message: filter.tooltip, - child: FutureBuilder( - future: _colorFuture, - builder: (context, AsyncSnapshot 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 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, + ); + }, + ), ), ), ); diff --git a/lib/widgets/stats.dart b/lib/widgets/stats.dart index 40cfa15a8..25b95de75 100644 --- a/lib/widgets/stats.dart +++ b/lib/widgets/stats.dart @@ -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}',