Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AsyncLoading progress value doesn't propagate when setting state from AsyncLoading to AsyncLoading #3703

Open
r52 opened this issue Aug 15, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@r52
Copy link

r52 commented Aug 15, 2024

Describe the bug
AsyncLoading.progress doesn't propagate when setting state from AsyncLoading to AsyncLoading.

To Reproduce

@riverpod
Future<Model> example(ExampleRef ref) async {
  ref.state = AsyncLoading(progress: 0);   // <-- doesn't work
  ref.state = AsyncLoading(progress: 0.5); // <-- doesn't work

  await something();

  ref.state = AsyncLoading(progress: 1);   // <-- doesn't work
}
final test = const AsyncValue.loading(progress: 0.1).copyWithPrevious(const AsyncValue.loading(), isRefresh: false);
assert(test.progress == 0.1); // <-- fails, is null

Expected behavior
The new progress values are set.

@r52 r52 added bug Something isn't working needs triage labels Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants