Fix Exception

```
════════ Exception caught by widgets library ═══════════════════════════════════
The following UnsupportedError was thrown building CircularProgressIndicator(100.0%, dependencies: [InheritedCupertinoTheme, _InheritedTheme, _LocalizationsScope-[GlobalKey#3b6da]], state: _CircularProgressIndicatorState#8c03b(ticker inactive)):
Unsupported operation: Infinity or NaN toInt

The relevant error-causing widget was:
    CircularProgressIndicator CircularProgressIndicator (package:mangayomi/modules/manga/reader/widgets/circular_progress_indicator_animate_rotate.dart:56:27)
```
This commit is contained in:
Enbiya Olgun 2025-04-22 03:23:12 +02:00
parent 3e2d7ed5bd
commit 59b2389631

View file

@ -51,9 +51,13 @@ class _CircularProgressIndicatorAnimateRotateState
duration: const Duration(milliseconds: 500),
curve: Curves.easeInOut,
tween: Tween<double>(begin: 0, end: widget.progress),
builder:
(context, value, _) =>
CircularProgressIndicator(value: value),
builder: (context, value, _) {
final safeValue =
value.isNaN || value.isInfinite
? null
: value.clamp(0.0, 1.0);
return CircularProgressIndicator(value: safeValue);
},
),
),
);