File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ class SyncingButton extends StatefulWidget {
19
19
20
20
class _SyncingButtonState extends State <SyncingButton > {
21
21
/// The number of files transferred since we started listening.
22
- int filesTransferred = 0 ;
22
+ static int filesTransferred = 0 ;
23
23
24
24
late final StreamSubscription queueListener, transferListener;
25
25
@@ -43,6 +43,7 @@ class _SyncingButtonState extends State<SyncingButton> {
43
43
}
44
44
45
45
void _onUsernameChanged () {
46
+ filesTransferred = 0 ;
46
47
if (mounted) setState (() {});
47
48
}
48
49
@@ -51,11 +52,15 @@ class _SyncingButtonState extends State<SyncingButton> {
51
52
double ? getPercentage () {
52
53
if (syncer.downloader.isRefreshing) {
53
54
// If still refreshing, show an indeterminate progress indicator.
55
+ filesTransferred = 0 ;
54
56
return null ;
55
57
}
56
58
57
59
final numPending = syncer.downloader.numPending;
58
- if (numPending == 0 ) return 1 ;
60
+ if (numPending == 0 ) {
61
+ filesTransferred = 0 ;
62
+ return 1 ;
63
+ }
59
64
60
65
return (0.2 + filesTransferred) / (0.2 + filesTransferred + numPending);
61
66
}
You can’t perform that action at this time.
0 commit comments