minor fixes

This commit is contained in:
Thibault Deckers 2022-04-18 11:08:10 +09:00
parent 2ec0baed09
commit 328a9c818f
2 changed files with 21 additions and 14 deletions

View file

@ -193,7 +193,7 @@ class _ReportOverlayState<T> extends State<ReportOverlay<T>> with SingleTickerPr
builder: (context, snapshot) { builder: (context, snapshot) {
final processedCount = processed.length.toDouble(); final processedCount = processed.length.toDouble();
final total = widget.itemCount; final total = widget.itemCount;
final percent = min(1.0, processedCount / total); final percent = total != 0 ? min(1.0, processedCount / total) : 1.0;
return FadeTransition( return FadeTransition(
opacity: _animation, opacity: _animation,
child: Stack( child: Stack(

View file

@ -129,22 +129,29 @@ class CoveredFilterChip<T extends CollectionFilter> extends StatelessWidget {
); );
}, },
child: entry == null child: entry == null
? FutureBuilder<Color>( ? StreamBuilder<Set<CollectionFilter>?>(
stream: covers.colorChangeStream.where((event) => event == null || event.contains(filter)),
builder: (context, snapshot) {
return FutureBuilder<Color>(
future: filter.color(context), future: filter.color(context),
builder: (context, snapshot) { builder: (context, snapshot) {
final color = snapshot.data;
const neutral = Colors.white;
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: LinearGradient( gradient: LinearGradient(
begin: Alignment.topLeft, begin: Alignment.topLeft,
end: Alignment.bottomRight, end: Alignment.bottomRight,
colors: [ colors: [
Colors.white, neutral,
snapshot.data ?? Colors.white, color ?? neutral,
], ],
), ),
), ),
); );
}, },
);
},
) )
: ThumbnailImage( : ThumbnailImage(
entry: entry, entry: entry,