GithubHelp home page GithubHelp logo

Comments (10)

rrousselGit avatar rrousselGit commented on May 30, 2024

I'd need to see the other two providers to know. It could be normal

You should only specify providers which are themselves specifying dependencies

from riverpod.

TekExplorer avatar TekExplorer commented on May 30, 2024

They are specifying dependencies

// considering converting these two into a family parameter in all watchers
@Riverpod(keepAlive: true, dependencies: [])
String? maybeServerId(MaybeServerIdRef ref) => null;
@Riverpod(keepAlive: true, dependencies: [maybeServerId])
String serverId(ServerIdRef ref) {
  final maybeServerId = ref.watch(maybeServerIdProvider);
  if (maybeServerId != null) return maybeServerId;

  throw StateError(
    'serverIdProvider was not overridden!'
    ' Make sure you are scoping the correct BuildContext!',
  );
}
//
@Riverpod(dependencies: [pterodactylRepository])
PteroClient pterodactylClient(PterodactylClientRef ref) {
  final repo = ref.watch(pterodactylRepositoryProvider);
  return repo.client;
}
@Riverpod(dependencies: [authData, ProfileNotifier, localPterodactylRepository])
PterodactylRepository pterodactylRepository(PterodactylRepositoryRef ref) {...}
// etc etc.

from riverpod.

catalunha avatar catalunha commented on May 30, 2024

Enjoying the theme.
I still don't understand the use of dependencies in Riverpod.
What is it for?
When to use?
When not to use?
In the documentation I still haven't found enough content to form this concept.

from riverpod.

TekExplorer avatar TekExplorer commented on May 30, 2024

This isn't the place to ask.

Right now i have it specified everywhere because i override serverId in the route that uses it (scoping)

realistically serverId should be a family parameter and i should prop-drill the value

from riverpod.

catalunha avatar catalunha commented on May 30, 2024

This isn't the place to ask.

I'm sure this is not the place for questions. I just took the opportunity to highlight that some are unaware of its applications. Maybe Remi or another colleague I can build documentation. Success in resolving your issue.

from riverpod.

rrousselGit avatar rrousselGit commented on May 30, 2024

@TekExplorer In that case it may be because the analysis was out of date somehow.

Not sure what exactly is the issue as is. But that's more of a custom_lint issue for sure

from riverpod.

TekExplorer avatar TekExplorer commented on May 30, 2024

I think it shows up more when I use build_runner watch. Maybe that has something to do with it? Those periods where stuff doesnt exist confuses it maybe?

from riverpod.

rrousselGit avatar rrousselGit commented on May 30, 2024

A reliable way to reproduce the issue appears to be:

  • delete the generated files
  • open a file with a provider using depencies: [...]
  • run the generator

The lints will not update when the generated file appears

from riverpod.

rrousselGit avatar rrousselGit commented on May 30, 2024

My understanding is that this is an SDK issue. I've opened dart-lang/sdk#54113

from riverpod.

rrousselGit avatar rrousselGit commented on May 30, 2024

This is pretty much confirmed to be a Dart bug at this point, so closing as there's nothing I can do

As a workaround, you can tap on alt and hover a type in your IDE. This generally does the trick

from riverpod.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.