-
-
Notifications
You must be signed in to change notification settings - Fork 942
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
[riverpod_lint] Dependencies lint misses providers used in methods #2417
Comments
gaetschwartz
changed the title
[riverpod_lint] Dependencies lint misses providers used in functions
[riverpod_lint] Dependencies lint misses providers used in methods
Apr 1, 2023
It's not necessarily a bug Only scoped providers need to be specified. Is eventsWithStreamedCompletionProvider() scoped? I'd need to see eventsWithStreamedCompletionProvider() to be sure. |
rrousselGit
added
question
Further information is requested
and removed
needs triage
labels
Apr 1, 2023
I'm not sure what you mean by scoped. But here is a rough implementation of it: @Riverpod(dependencies: [eventsWith, profiles])
Stream<List<EventWithAsyncCompletion>> eventsWithStreamedCompletion(
EventsWithStreamedCompletionRef ref, [
EventProviderParam param = const EventProviderParam(),
]) async* {
final f = await ref.watch(profilesProvider.future);
final events = await ref.watch(eventsWithProvider(param).future);
final cache = events
.map((e) => EventWithAsyncCompletion(e, const AsyncLoading()))
.toList();
yield cache;
yield* Stream.fromFutures(events.map(updateCache)).map((_) => cache);
} |
rrousselGit
added a commit
that referenced
this issue
Apr 7, 2023
…ds other than `build` of a notifier. fixes #2417
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When using a provider inside a method that is being called in the build method, the provider usage is not detected.
To Reproduce
In this code, the linter doesn't detect the usage of
eventsWithStreamedCompletionProvider
:but it does here:
Expected behavior
It should detect it as well or at least give a way to add it manually to then dependencies without the linter complaining (forcing).
The text was updated successfully, but these errors were encountered: