rrousselGit / riverpod

A reactive caching and data-binding framework. Riverpod makes working with asynchronous code a breeze.
https://riverpod.dev
MIT License
5.85k stars 895 forks source link

Unexpected `avoid_manual_providers_as_generated_provider_dependency` lint #3245

Closed urusai88 closed 5 months ago

urusai88 commented 5 months ago

Hi! I am trying to store family provider in variable(getter) for using it in different places without modify the family name everywhere, but faced a lint Is it expected behavior?

image

rrousselGit commented 5 months ago

Yes, it is.

You can't do something like MyProvider get alias => another

Reprevise commented 2 weeks ago

@rrousselGit Even this is expected behavior?

@riverpod
int count(CountRef ref, int x) {
  // ...
}

@riverpod
int count2(Count2Ref ref) {
  final provider = countProvider(10);
  ref.watch(provider); // avoid_manual_providers_as_generated_provider_dependency
}