fluttercommunity / fluttercommunity/flutter_downloader

Why am I getting larger values as progress value?

Open
#168 5 comments 1 reaction 0 assignees View on GitHub
Dominant language
Kotlin
Stars
940
Forks
561
Avg merge
1h 18m
Merged PRs (30d)
1

Description

I added some logs to the progress value and I am seeing some unusual numbers as progress which breaks my application.

`I/flutter (18984): progress-------------------------------------------------------
I/flutter (18984): 0
I/flutter (18984): progress-------------------------------------------------------
I/flutter (18984): -107600
D/ViewRootImpl@e6138ee[MainActivity](18984): ViewPostIme pointer 0
D/ViewRootImpl@e6138ee[MainActivity](18984): ViewPostIme pointer 1
D/ViewRootImpl@e6138ee[MainActivity](18984): MSG_WINDOW_FOCUS_CHANGED 0
D/skia (18984): --- SkAndroidCodec::NewFromStream returned null
I/flutter (18984): progress-------------------------------------------------------
I/flutter (18984): 2147426496
════════ Exception caught by widgets library ═══════════════════════════════════
The following _Exception was thrown building MovieDownloads(dirty, state: _MovieDownloadsState#37025):
Exception: Percent value must be a double between 0.0 and 1.0
The relevant error-causing widget was
MovieDownloads
lib\widget\download_page.dart:105
When the exception was thrown, this was the stack
#0 new CircularPercentIndicator
package:percent_indicator/circular_percent_indicator.dart:103
#1 _MovieDownloadsState.build.
package:next_hour/widget/movie_downloads.dart:190
#2 MappedListIterable.elementAt (dart:_internal/iterable.dart:415:29)
#3 ListIterable.toList (dart:_internal/iterable.dart:219:19)
#4 _MovieDownloadsState.build
package:next_hour/widget/movie_downloads.dart:238
...
════════════════════════════════════════════════════════════════════════════════
D/ViewRootImpl@e6138ee[MainActivity](18984): MSG_WINDOW_FOCUS_CHANGED 1
D/skia (18984): --- SkAndroidCodec::NewFromStream returned null
I/flutter (18984): progress-------------------------------------------------------
I/flutter (18984): 100
D/DownloadWorker(18984): File downloaded`

As you can see the above logs, the progress is started with a 0, then gets a larger negative value, a larger positive value, and finally ends up with 100.

Why is this happening?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.