mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-05-11 04:10:53 +00:00
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:
parent
3e2d7ed5bd
commit
59b2389631
1 changed files with 7 additions and 3 deletions
|
|
@ -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);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue