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